summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/benchmark.py7
-rwxr-xr-xtools/deno_dir_test.py2
-rwxr-xr-xtools/http_benchmark.py4
-rwxr-xr-xtools/is_tty_test.py2
-rwxr-xr-xtools/permission_prompt_test.py3
-rw-r--r--tools/repl_test.py2
-rwxr-xr-xtools/test.py6
-rwxr-xr-xtools/throughput_benchmark.py5
-rwxr-xr-xtools/unit_tests.py2
9 files changed, 18 insertions, 15 deletions
diff --git a/tools/benchmark.py b/tools/benchmark.py
index 55e919643..03fcc497e 100755
--- a/tools/benchmark.py
+++ b/tools/benchmark.py
@@ -143,7 +143,7 @@ def run_strace_benchmarks(deno_exe, new_data):
thread_count = {}
syscall_count = {}
for (name, args) in exec_time_benchmarks:
- s = get_strace_summary([deno_exe] + args)
+ s = get_strace_summary([deno_exe, "run"] + args)
thread_count[name] = s["clone"]["calls"] + 1
syscall_count[name] = s["total"]["calls"]
new_data["thread_count"] = thread_count
@@ -162,7 +162,7 @@ def find_max_mem_in_bytes(time_v_output):
def run_max_mem_benchmark(deno_exe):
results = {}
for (name, args) in exec_time_benchmarks:
- cmd = ["/usr/bin/time", "-v", deno_exe] + args
+ cmd = ["/usr/bin/time", "-v", deno_exe, "run"] + args
try:
out = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError:
@@ -179,7 +179,8 @@ def run_exec_time(deno_exe, build_dir):
hyperfine, "--ignore-failure", "--export-json", benchmark_file,
"--warmup", "3"
] + [
- deno_exe + " " + " ".join(args) for [_, args] in exec_time_benchmarks
+ deno_exe + " run " + " ".join(args)
+ for [_, args] in exec_time_benchmarks
])
hyperfine_results = read_json(benchmark_file)
results = {}
diff --git a/tools/deno_dir_test.py b/tools/deno_dir_test.py
index 4b6c3d8aa..bcfa370bf 100755
--- a/tools/deno_dir_test.py
+++ b/tools/deno_dir_test.py
@@ -35,7 +35,7 @@ def deno_dir_test(deno_exe, deno_dir):
def run_deno(deno_exe, deno_dir=None):
- cmd = [deno_exe, "tests/002_hello.ts"]
+ cmd = [deno_exe, "run", "tests/002_hello.ts"]
deno_dir_env = {"DENO_DIR": deno_dir} if deno_dir is not None else None
run(cmd, quiet=True, env=deno_dir_env)
diff --git a/tools/http_benchmark.py b/tools/http_benchmark.py
index 7db900a86..68d68e44a 100755
--- a/tools/http_benchmark.py
+++ b/tools/http_benchmark.py
@@ -11,14 +11,14 @@ DURATION = "10s"
def deno_http_benchmark(deno_exe):
- deno_cmd = [deno_exe, "--allow-net", "tests/http_bench.ts", ADDR]
+ deno_cmd = [deno_exe, "run", "--allow-net", "tests/http_bench.ts", ADDR]
print "http_benchmark testing DENO."
return run(deno_cmd)
def deno_net_http_benchmark(deno_exe):
deno_cmd = [
- deno_exe, "--allow-net",
+ deno_exe, "run", "--allow-net",
"js/deps/https/deno.land/std/http/http_bench.ts", ADDR
]
print "http_benchmark testing DENO using net/http."
diff --git a/tools/is_tty_test.py b/tools/is_tty_test.py
index 867fd7a1c..6f7509a8c 100755
--- a/tools/is_tty_test.py
+++ b/tools/is_tty_test.py
@@ -12,7 +12,7 @@ IS_TTY_TEST_TS = "tests/is_tty.ts"
def is_tty_test(deno_exe):
- cmd = [deno_exe, IS_TTY_TEST_TS]
+ cmd = [deno_exe, "run", IS_TTY_TEST_TS]
code, stdout, _ = tty_capture(cmd, b'')
assert code == 0
assert str(stdin.isatty()).lower() in stdout
diff --git a/tools/permission_prompt_test.py b/tools/permission_prompt_test.py
index 6e8922640..e3ee7d9c8 100755
--- a/tools/permission_prompt_test.py
+++ b/tools/permission_prompt_test.py
@@ -71,7 +71,8 @@ class Prompt(object):
def run(self, flags, args, bytes_input):
"Returns (return_code, stdout, stderr)."
- cmd = [self.deno_exe] + flags + [PERMISSIONS_PROMPT_TEST_TS] + args
+ cmd = [self.deno_exe, "run"] + flags + [PERMISSIONS_PROMPT_TEST_TS
+ ] + args
return tty_capture(cmd, bytes_input)
def warm_up(self):
diff --git a/tools/repl_test.py b/tools/repl_test.py
index 59346d3e8..9ea1b82af 100644
--- a/tools/repl_test.py
+++ b/tools/repl_test.py
@@ -19,7 +19,7 @@ class Repl(object):
def input(self, *lines, **kwargs):
exit_ = kwargs.pop("exit", True)
sleep_ = kwargs.pop("sleep", 0)
- p = Popen([self.deno_exe, "-A"], stdout=PIPE, stderr=PIPE, stdin=PIPE)
+ p = Popen([self.deno_exe], stdout=PIPE, stderr=PIPE, stdin=PIPE)
try:
# Note: The repl takes a >100ms until it's ready.
time.sleep(sleep_)
diff --git a/tools/test.py b/tools/test.py
index e4914ae50..2a59a0c87 100755
--- a/tools/test.py
+++ b/tools/test.py
@@ -30,16 +30,16 @@ def test_no_color(deno_exe):
sys.stdout.write("no_color test...")
sys.stdout.flush()
t = os.path.join(tests_path, "no_color.js")
- output = run_output([deno_exe, t], merge_env={"NO_COLOR": "1"})
+ output = run_output([deno_exe, "run", t], merge_env={"NO_COLOR": "1"})
assert output.strip() == "noColor true"
t = os.path.join(tests_path, "no_color.js")
- output = run_output([deno_exe, t])
+ output = run_output([deno_exe, "run", t])
assert output.strip() == "noColor false"
print green_ok()
def exec_path_test(deno_exe):
- cmd = [deno_exe, "tests/exec_path.ts"]
+ cmd = [deno_exe, "run", "tests/exec_path.ts"]
output = run_output(cmd)
assert deno_exe in output.strip()
diff --git a/tools/throughput_benchmark.py b/tools/throughput_benchmark.py
index 712edfe43..9343d9613 100755
--- a/tools/throughput_benchmark.py
+++ b/tools/throughput_benchmark.py
@@ -19,7 +19,8 @@ ADDR = "127.0.0.1:4544"
def cat(deno_exe, megs):
size = megs * MB
start = time.time()
- cmd = deno_exe + " --allow-read tests/cat.ts /dev/zero | head -c %s " % size
+ cmd = deno_exe + " run --allow-read "
+ cmd += "tests/cat.ts /dev/zero | head -c %s " % size
print cmd
subprocess.check_output(cmd, shell=True)
end = time.time()
@@ -30,7 +31,7 @@ def tcp(deno_exe, megs):
size = megs * MB
# Run deno echo server in the background.
echo_server = subprocess.Popen(
- [deno_exe, "--allow-net", "tests/echo_server.ts", ADDR])
+ [deno_exe, "run", "--allow-net", "tests/echo_server.ts", ADDR])
time.sleep(5) # wait for deno to wake up. TODO racy.
try:
diff --git a/tools/unit_tests.py b/tools/unit_tests.py
index abc9baf06..14284b325 100755
--- a/tools/unit_tests.py
+++ b/tools/unit_tests.py
@@ -34,7 +34,7 @@ def run_unit_test2(cmd):
def run_unit_test(deno_exe, permStr, flags=None):
if flags is None:
flags = []
- cmd = [deno_exe] + flags + ["js/unit_tests.ts", permStr]
+ cmd = [deno_exe, "run"] + flags + ["js/unit_tests.ts", permStr]
run_unit_test2(cmd)