mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 20:29:11 +00:00
Add ability to unit test by permissions.
This commit is contained in:
parent
722c7e4a1b
commit
e13f3c10ca
7 changed files with 113 additions and 25 deletions
26
tools/unit_tests.py
Executable file
26
tools/unit_tests.py
Executable file
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/env python
|
||||
from util import run
|
||||
import sys
|
||||
|
||||
|
||||
# We want to test many ops in deno which have different behavior depending on
|
||||
# the permissions set. These tests can specify which permissions they expect,
|
||||
# which appends a special string like "permW1N0" to the end of the test name.
|
||||
# Here we run several copies of deno with different permissions, filtering the
|
||||
# tests by the special string. permW0N0 means allow-write but not allow-net.
|
||||
# See js/test_util.ts for more details.
|
||||
def unit_tests(deno_exe):
|
||||
run([deno_exe, "js/unit_tests.ts", "permW0N0"])
|
||||
run([deno_exe, "js/unit_tests.ts", "permW1N0", "--allow-write"])
|
||||
run([deno_exe, "js/unit_tests.ts", "permW0N1", "--allow-net"])
|
||||
run([
|
||||
deno_exe, "js/unit_tests.ts", "permW1N1", "--allow-write",
|
||||
"--allow-net"
|
||||
])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) < 2:
|
||||
print "Usage ./tools/unit_tests.py out/debug/deno"
|
||||
sys.exit(1)
|
||||
unit_tests(sys.argv[1])
|
Loading…
Add table
Add a link
Reference in a new issue