diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2023-05-19 19:21:10 +0100 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2023-05-19 19:21:10 +0100 |
commit | c44f3f231988dc05c4c7a8a96bc2e7b1a54da277 (patch) | |
tree | 39f30058987890a179cbc265a6b2f38d6389e677 /test/functional/test_runner.py | |
parent | 7be7e62fdf4623e0cc680ea8205750c16414453e (diff) |
test: Explicitly specify directory where to search tests for
This change allows `test_runner.py` to work from an out-of-source build
directory using a symlink, a hard link or a copy on any platform.
Diffstat (limited to 'test/functional/test_runner.py')
-rwxr-xr-x | test/functional/test_runner.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py index 77e4dab6e4..3dc22ccde3 100755 --- a/test/functional/test_runner.py +++ b/test/functional/test_runner.py @@ -528,6 +528,12 @@ def run_tests(*, test_list, src_dir, build_dir, tmpdir, jobs=1, enable_coverage= # Test Framework Tests print("Running Unit Tests for Test Framework Modules") + + tests_dir = src_dir + '/test/functional/' + # This allows `test_runner.py` to work from an out-of-source build directory using a symlink, + # a hard link or a copy on any platform. See https://github.com/bitcoin/bitcoin/pull/27561. + sys.path.append(tests_dir) + test_framework_tests = unittest.TestSuite() for module in TEST_FRAMEWORK_MODULES: test_framework_tests.addTest(unittest.TestLoader().loadTestsFromName("test_framework.{}".format(module))) @@ -536,8 +542,6 @@ def run_tests(*, test_list, src_dir, build_dir, tmpdir, jobs=1, enable_coverage= logging.debug("Early exiting after failure in TestFramework unit tests") sys.exit(False) - tests_dir = src_dir + '/test/functional/' - flags = ['--cachedir={}'.format(cache_dir)] + args if enable_coverage: |