2018-07-21 19:08:24 -04:00
|
|
|
#!/usr/bin/env python
|
2019-01-21 14:03:30 -05:00
|
|
|
# Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
|
2018-07-21 19:08:24 -04:00
|
|
|
# Runs the full test suite.
|
|
|
|
# Usage: ./tools/test.py out/Debug
|
|
|
|
import os
|
2019-05-27 09:27:55 -04:00
|
|
|
|
2019-05-30 16:40:40 -04:00
|
|
|
from benchmark_test import TestBenchmark
|
|
|
|
from deno_dir_test import TestDenoDir
|
2019-06-08 07:46:57 -04:00
|
|
|
from fetch_test import TestFetch
|
|
|
|
from fmt_test import TestFmt
|
2019-05-30 16:40:40 -04:00
|
|
|
from integration_tests import TestIntegrations
|
|
|
|
from repl_test import TestRepl
|
|
|
|
from setup_test import TestSetup
|
2019-06-03 12:35:55 -04:00
|
|
|
from target_test import TestTarget
|
2019-05-30 16:40:40 -04:00
|
|
|
from unit_tests import JsUnitTests
|
|
|
|
from util_test import TestUtil
|
|
|
|
# NOTE: These tests are skipped on Windows
|
2019-06-03 12:35:55 -04:00
|
|
|
from is_tty_test import TestIsTty
|
2019-05-30 16:40:40 -04:00
|
|
|
from permission_prompt_test import permission_prompt_tests
|
|
|
|
from complex_permissions_test import complex_permissions_tests
|
|
|
|
|
2019-06-03 12:35:55 -04:00
|
|
|
import http_server
|
|
|
|
from util import (enable_ansi_colors, build_path, RESET, FG_RED, FG_GREEN,
|
2019-06-08 07:46:57 -04:00
|
|
|
executable_suffix, rmtree, tests_path)
|
2019-06-03 12:35:55 -04:00
|
|
|
from test_util import parse_test_args, run_tests
|
2019-05-30 16:40:40 -04:00
|
|
|
|
|
|
|
|
2019-06-03 12:35:55 -04:00
|
|
|
def main():
|
|
|
|
args = parse_test_args()
|
2019-05-30 16:40:40 -04:00
|
|
|
|
|
|
|
deno_dir = os.path.join(args.build_dir, ".deno_test")
|
2018-10-15 12:08:19 -04:00
|
|
|
if os.path.isdir(deno_dir):
|
|
|
|
rmtree(deno_dir)
|
|
|
|
os.environ["DENO_DIR"] = deno_dir
|
|
|
|
|
2018-09-02 17:37:14 -04:00
|
|
|
enable_ansi_colors()
|
|
|
|
|
2019-06-03 12:35:55 -04:00
|
|
|
test_cases = [
|
|
|
|
TestSetup,
|
|
|
|
TestUtil,
|
|
|
|
TestTarget,
|
|
|
|
JsUnitTests,
|
2019-06-08 07:46:57 -04:00
|
|
|
TestFetch,
|
2019-06-03 12:35:55 -04:00
|
|
|
TestIntegrations,
|
|
|
|
TestRepl,
|
|
|
|
TestDenoDir,
|
|
|
|
TestBenchmark,
|
|
|
|
TestIsTty,
|
|
|
|
]
|
|
|
|
test_cases += permission_prompt_tests()
|
|
|
|
test_cases += complex_permissions_tests()
|
2019-08-26 10:57:14 -04:00
|
|
|
# It is very slow, so do TestFmt at the end.
|
|
|
|
test_cases += [TestFmt]
|
2019-06-03 12:35:55 -04:00
|
|
|
|
|
|
|
with http_server.spawn():
|
|
|
|
run_tests(test_cases)
|
2019-03-15 12:59:53 -04:00
|
|
|
|
2018-07-21 19:08:24 -04:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2019-06-03 12:35:55 -04:00
|
|
|
main()
|