summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/cargo_package.py3
-rwxr-xr-xtools/complex_permissions_test.py25
-rwxr-xr-xtools/fetch_test.py3
-rwxr-xr-xtools/setup.py4
-rw-r--r--tools/target_test.py7
-rwxr-xr-xtools/test.py62
-rwxr-xr-xtools/unit_tests.py28
7 files changed, 16 insertions, 116 deletions
diff --git a/tools/cargo_package.py b/tools/cargo_package.py
index 7696681e7..29f5e7fb5 100755
--- a/tools/cargo_package.py
+++ b/tools/cargo_package.py
@@ -15,8 +15,7 @@ import errno
from shutil import copytree, ignore_patterns, copyfile
from tempfile import mkdtemp
from string import Template
-from util import root_path
-from util import run
+from util import root_path, run
if sys.platform == "linux2":
llvm_target = "x86_64-unknown-linux-gnu"
diff --git a/tools/complex_permissions_test.py b/tools/complex_permissions_test.py
index cc35577de..985f9a972 100755
--- a/tools/complex_permissions_test.py
+++ b/tools/complex_permissions_test.py
@@ -29,7 +29,7 @@ class BaseReadWritePermissionsTest(object):
def test_inside_project_dir(self):
code, _stdout, stderr = self._run_deno(
["--allow-" + self.test_type + "=" + root_path],
- [self.test_type, "package.json", "tests/subdir/config.json"])
+ [self.test_type, "package.json", "cli/tests/subdir/config.json"])
assert code == 0
assert PROMPT_PATTERN not in stderr
assert PERMISSION_DENIED_PATTERN not in stderr
@@ -37,7 +37,7 @@ class BaseReadWritePermissionsTest(object):
def test_outside_test_dir(self):
code, _stdout, stderr = self._run_deno([
"--allow-" + self.test_type + "=" + os.path.join(
- root_path, "tests")
+ root_path, "cli/tests")
], [self.test_type, "package.json"])
assert code == 1
assert PROMPT_PATTERN not in stderr
@@ -46,8 +46,8 @@ class BaseReadWritePermissionsTest(object):
def test_inside_test_dir(self):
code, _stdout, stderr = self._run_deno([
"--allow-" + self.test_type + "=" + os.path.join(
- root_path, "tests")
- ], [self.test_type, "tests/subdir/config.json"])
+ root_path, "cli/tests")
+ ], [self.test_type, "cli/tests/subdir/config.json"])
assert code == 0
assert PROMPT_PATTERN not in stderr
assert PERMISSION_DENIED_PATTERN not in stderr
@@ -55,7 +55,7 @@ class BaseReadWritePermissionsTest(object):
def test_outside_test_and_js_dir(self):
code, _stdout, stderr = self._run_deno([
"--allow-" + self.test_type + "=" + os.path.join(
- root_path, "tests") + "," + os.path.join(root_path, "js")
+ root_path, "cli/tests") + "," + os.path.join(root_path, "js")
], [self.test_type, "package.json"])
assert code == 1
assert PROMPT_PATTERN not in stderr
@@ -64,8 +64,8 @@ class BaseReadWritePermissionsTest(object):
def test_inside_test_and_js_dir(self):
code, _stdout, stderr = self._run_deno([
"--allow-" + self.test_type + "=" + os.path.join(
- root_path, "tests") + "," + os.path.join(root_path, "js")
- ], [self.test_type, "js/dir_test.ts", "tests/subdir/config.json"])
+ root_path, "cli/tests") + "," + os.path.join(root_path, "js")
+ ], [self.test_type, "js/dir_test.ts", "cli/tests/subdir/config.json"])
assert code == 0
assert PROMPT_PATTERN not in stderr
assert PERMISSION_DENIED_PATTERN not in stderr
@@ -75,8 +75,8 @@ class BaseReadWritePermissionsTest(object):
saved_curdir = os.getcwd()
os.chdir(root_path)
code, _stdout, stderr = self._run_deno(
- ["--allow-" + self.test_type + "=" + "./tests"],
- [self.test_type, "tests/subdir/config.json"])
+ ["--allow-" + self.test_type + "=" + "./cli/tests"],
+ [self.test_type, "cli/tests/subdir/config.json"])
assert code == 0
assert PROMPT_PATTERN not in stderr
assert PERMISSION_DENIED_PATTERN not in stderr
@@ -87,8 +87,8 @@ class BaseReadWritePermissionsTest(object):
saved_curdir = os.getcwd()
os.chdir(root_path)
code, _stdout, stderr = self._run_deno(
- ["--allow-" + self.test_type + "=" + "tests"],
- [self.test_type, "tests/subdir/config.json"])
+ ["--allow-" + self.test_type + "=" + "cli/tests"],
+ [self.test_type, "cli/tests/subdir/config.json"])
assert code == 0
assert PROMPT_PATTERN not in stderr
assert PERMISSION_DENIED_PATTERN not in stderr
@@ -215,5 +215,4 @@ def complex_permissions_tests():
if __name__ == "__main__":
- with http_server.spawn():
- run_tests()
+ run_tests()
diff --git a/tools/fetch_test.py b/tools/fetch_test.py
index b4bf1836c..e6e5cb6a0 100755
--- a/tools/fetch_test.py
+++ b/tools/fetch_test.py
@@ -29,5 +29,4 @@ class TestFetch(DenoTestCase):
if __name__ == "__main__":
- with http_server.spawn():
- run_tests()
+ run_tests()
diff --git a/tools/setup.py b/tools/setup.py
index aef65924d..b6c8cac92 100755
--- a/tools/setup.py
+++ b/tools/setup.py
@@ -127,9 +127,9 @@ def generate_gn_args(mode):
if "DENO_BUILD_ARGS" in os.environ:
out += os.environ["DENO_BUILD_ARGS"].split()
- cacher = third_party.get_prebuilt_tool_path("sccache")
+ cacher = find_executable("sccache")
if not os.path.exists(cacher):
- cacher = find_executable("sccache") or find_executable("ccache")
+ cacher = third_party.get_prebuilt_tool_path("sccache")
# Check if ccache or sccache are in the path, and if so we set cc_wrapper.
cc_wrapper = cacher
diff --git a/tools/target_test.py b/tools/target_test.py
index b4cb6996c..724dacdec 100644
--- a/tools/target_test.py
+++ b/tools/target_test.py
@@ -21,13 +21,6 @@ class TestTarget(DenoTestCase):
self.check_exists(bin_file)
run([bin_file], quiet=True)
- def test_cargo_test(self):
- cargo_test = ["cargo", "test", "--all", "--locked"]
- if build_mode() == "release":
- run(cargo_test + ["--release"])
- else:
- run(cargo_test)
-
def test_libdeno(self):
self._test("libdeno_test")
diff --git a/tools/test.py b/tools/test.py
deleted file mode 100755
index c3110c655..000000000
--- a/tools/test.py
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
-# Runs the full test suite.
-# Usage: ./tools/test.py out/Debug
-import os
-
-from benchmark_test import TestBenchmark
-from deno_dir_test import TestDenoDir
-from fetch_test import TestFetch
-from fmt_test import TestFmt
-from repl_test import TestRepl
-from setup_test import TestSetup
-from target_test import TestTarget
-from unit_tests import JsUnitTests
-from util_test import TestUtil
-# NOTE: These tests are skipped on Windows
-from is_tty_test import TestIsTty
-from permission_prompt_test import permission_prompt_tests
-from complex_permissions_test import complex_permissions_tests
-
-import http_server
-from util import (enable_ansi_colors, build_path, RESET, FG_RED, FG_GREEN,
- executable_suffix, rmtree, tests_path)
-from test_util import parse_test_args, run_tests
-
-
-def main():
- args = parse_test_args()
-
- deno_dir = os.path.join(args.build_dir, ".deno_test")
- if os.path.isdir(deno_dir):
- rmtree(deno_dir)
- os.environ["DENO_DIR"] = deno_dir
-
- enable_ansi_colors()
-
- test_cases = [
- TestSetup,
- TestUtil,
- TestTarget,
- JsUnitTests,
- TestFetch,
- TestRepl,
- TestDenoDir,
- TestBenchmark,
- ]
-
- # TODO(ry) This test isn't working yet on github actions.
- if "GH_ACTIONS" not in os.environ:
- test_cases += [TestIsTty]
-
- test_cases += permission_prompt_tests()
- test_cases += complex_permissions_tests()
- # It is very slow, so do TestFmt at the end.
- test_cases += [TestFmt]
-
- with http_server.spawn():
- run_tests(test_cases)
-
-
-if __name__ == '__main__':
- main()
diff --git a/tools/unit_tests.py b/tools/unit_tests.py
deleted file mode 100755
index 859afcea3..000000000
--- a/tools/unit_tests.py
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
-import sys
-import subprocess
-
-import http_server
-from test_util import DenoTestCase, run_tests
-
-
-class JsUnitTests(DenoTestCase):
- def test_unit_test_runner(self):
- cmd = [
- self.deno_exe, "run", "--reload", "--allow-run", "--allow-env",
- "js/unit_test_runner.ts"
- ]
- process = subprocess.Popen(
- cmd, bufsize=1, universal_newlines=True, stderr=subprocess.STDOUT)
-
- process.wait()
- errcode = process.returncode
- if errcode != 0:
- raise AssertionError(
- "js/unit_test_runner.ts exited with exit code %s" % errcode)
-
-
-if __name__ == '__main__':
- with http_server.spawn():
- run_tests()