Refactor test infrastructure (#2432)

* use subclass of unittest.TestCase for all test cases

* allow to run single test file (eg. python tools/integration_tests.py)

* test filtering (via --pattern/-p CLI flag)

* use common CLI parser for all tests:
  usage: test.py [-h] [--failfast] [--verbose] [--executable EXECUTABLE]
               [--release] [--pattern PATTERN] [--build-dir BUILD_DIR]

  optional arguments:
  -h, --help            show this help message and exit
  --failfast, -f        Stop on first failure
  --verbose, -v         Verbose output
  --executable EXECUTABLE
                        Use external executable of Deno
  --release             Test against release executable
  --pattern PATTERN, -p PATTERN
                        Run tests that match provided pattern
  --build-dir BUILD_DIR
                        Deno build directory

* respect NO_COLOR variable
This commit is contained in:
Bartek Iwańczuk 2019-06-03 18:35:55 +02:00 committed by Ryan Dahl
parent bbc8de0c7a
commit 43c6c1a9f5
17 changed files with 283 additions and 278 deletions

View file

@ -3,10 +3,9 @@
# Check deno dir is created properly
# Usage: deno_dir_test.py [path to deno dir]
import os
import subprocess
import sys
from util import DenoTestCase, mkdtemp, rmtree, run, test_main
from test_util import DenoTestCase, run_tests
from util import mkdtemp, rmtree, run
class TestDenoDir(DenoTestCase):
@ -43,4 +42,4 @@ class TestDenoDir(DenoTestCase):
if __name__ == '__main__':
test_main()
run_tests()