diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2020-05-23 21:35:44 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2020-05-23 22:45:30 +0300 |
commit | 527536dd4ae102d2d14e7ee512b6886d57fc0149 (patch) | |
tree | eb8eb75bd5dd222a4078934be39b5b1d86821ee9 | |
parent | f2e2e910d9c646849e55f97215217b87de491805 (diff) | |
download | meson-527536dd4ae102d2d14e7ee512b6886d57fc0149.zip meson-527536dd4ae102d2d14e7ee512b6886d57fc0149.tar.gz meson-527536dd4ae102d2d14e7ee512b6886d57fc0149.tar.bz2 |
Clear internal caches before running each test.
-rwxr-xr-x | run_project_tests.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/run_project_tests.py b/run_project_tests.py index 18731d6..927d0fe 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -431,6 +431,15 @@ def _compare_output(expected: T.List[T.Dict[str, str]], output: str, desc: str) def validate_output(test: TestDef, stdo: str, stde: str) -> str: return _compare_output(test.stdout, stdo, 'stdout') +# There are some class variables and such that cahce +# information. Clear all of these. The better solution +# would be to change the code so that no state is persisted +# but that would be a lot of work given that Meson was originally +# coded to run as a batch process. +def clear_internal_caches(): + import mesonbuild.interpreterbase + mesonbuild.interpreterbase.FeatureNew.feature_registry = {} + def run_test_inprocess(testdir): old_stdout = sys.stdout sys.stdout = mystdout = StringIO() @@ -551,6 +560,7 @@ def _run_test(test: TestDef, test_build_dir: str, install_dir: str, extra_args, force_regenerate() # Test in-process + clear_internal_caches() test_start = time.time() (returncode, tstdo, tstde, test_log) = run_test_inprocess(test_build_dir) testresult.add_step(BuildStep.test, tstdo, tstde, test_log, time.time() - test_start) |