Skip to content

Commit d3525d7

Browse files
hashseedrvagg
authored andcommitted
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: #26093 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent f44f335 commit d3525d7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/test.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1393,6 +1393,8 @@ def BuildOptions():
13931393
default="")
13941394
result.add_option('--temp-dir',
13951395
help='Optional path to change directory used for tests', default=False)
1396+
result.add_option('--test-root',
1397+
help='Optional path to change test directory', dest='test_root', default=None)
13961398
result.add_option('--repeat',
13971399
help='Number of times to repeat given tests',
13981400
default=1, type="int")
@@ -1576,8 +1578,10 @@ def Main():
15761578

15771579
workspace = abspath(join(dirname(sys.argv[0]), '..'))
15781580
test_root = join(workspace, 'test')
1581+
if options.test_root is not None:
1582+
test_root = options.test_root
15791583
suites = GetSuites(test_root)
1580-
repositories = [TestRepository(join(workspace, 'test', name)) for name in suites]
1584+
repositories = [TestRepository(join(test_root, name)) for name in suites]
15811585
repositories += [TestRepository(a) for a in options.suite]
15821586

15831587
root = LiteralTestSuite(repositories, test_root)

0 commit comments

Comments
 (0)