diff options
author | Yang Guo <yangguo@chromium.org> | 2019-02-13 15:38:32 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-02-17 20:57:12 +0300 |
commit | d1d9daba46d6619325b67b90a3b5d5a3933a03cf (patch) | |
tree | cd3d51c24510fc48b2457ece3456e4fa91a65276 /tools/test.py | |
parent | 05292cbf6f645c46711f3fa5f1619a18501dd068 (diff) |
test: add --test-root option to test.py
This way we can specify a custom path for the test folder, e.g.
when building addons separately from the source tree.
PR-URL: https://github.com/nodejs/node/pull/26093
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'tools/test.py')
-rwxr-xr-x | tools/test.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/test.py b/tools/test.py index e6fc7be73f1..bf99c499024 100755 --- a/tools/test.py +++ b/tools/test.py @@ -1393,6 +1393,8 @@ def BuildOptions(): default="") result.add_option('--temp-dir', help='Optional path to change directory used for tests', default=False) + result.add_option('--test-root', + help='Optional path to change test directory', dest='test_root', default=None) result.add_option('--repeat', help='Number of times to repeat given tests', default=1, type="int") @@ -1576,8 +1578,10 @@ def Main(): workspace = abspath(join(dirname(sys.argv[0]), '..')) test_root = join(workspace, 'test') + if options.test_root is not None: + test_root = options.test_root suites = GetSuites(test_root) - repositories = [TestRepository(join(workspace, 'test', name)) for name in suites] + repositories = [TestRepository(join(test_root, name)) for name in suites] repositories += [TestRepository(a) for a in options.suite] root = LiteralTestSuite(repositories, test_root) |