aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2020-05-23 21:35:44 +0300
committerNirbheek Chauhan <nirbheek@centricular.com>2020-06-15 11:11:40 +0530
commit4afe31ad4e4048411141b83a54878cfbeca92beb (patch)
treea864b0a84fb71979b19e8ee13f2ac67c225fc850
parent82afd16e2891e29f15827e89c7b89f1607bdda3c (diff)
downloadmeson-4afe31ad4e4048411141b83a54878cfbeca92beb.zip
meson-4afe31ad4e4048411141b83a54878cfbeca92beb.tar.gz
meson-4afe31ad4e4048411141b83a54878cfbeca92beb.tar.bz2
Clear internal caches before running each test.
-rwxr-xr-xrun_project_tests.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/run_project_tests.py b/run_project_tests.py
index 2ab6284..6d8930e 100755
--- a/run_project_tests.py
+++ b/run_project_tests.py
@@ -381,6 +381,15 @@ def run_ci_commands(raw_log: str) -> T.List[str]:
return res
+# 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()
@@ -496,6 +505,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)