aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2016-12-22 06:17:31 +0530
committerJussi Pakkanen <jpakkane@gmail.com>2016-12-23 19:07:45 +0200
commita3c02262f9051f9c830a765e744de9f520268aad (patch)
tree83cecb90555b4f84ba3b255c503bd635657885bf
parent7eb96375caa291e17367b1839194a5f6956ce7d7 (diff)
downloadmeson-a3c02262f9051f9c830a765e744de9f520268aad.zip
meson-a3c02262f9051f9c830a765e744de9f520268aad.tar.gz
meson-a3c02262f9051f9c830a765e744de9f520268aad.tar.bz2
Force a Ninja regeneration before each project test
We have no test coverage for regeneration at all, which is why issues like #1246 slide by without us noticing. With this, we will run a regen on every test during `ninja test` after it has been compiled. This will not affect test times too much since the regen will not rebuild anything at all since there have been no source changes.
-rwxr-xr-xrun_project_tests.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/run_project_tests.py b/run_project_tests.py
index 41db27c..61177ff 100755
--- a/run_project_tests.py
+++ b/run_project_tests.py
@@ -271,6 +271,11 @@ def _run_test(testdir, test_build_dir, install_dir, extra_args, flags, compile_c
return TestResult('Test that should have failed to build succeeded', stdo, stde, mesonlog, gen_time)
if pc.returncode != 0:
return TestResult('Compiling source code failed.', stdo, stde, mesonlog, gen_time, build_time)
+ # Touch the meson.build file to force a regenerate so we can test that
+ # regeneration works. We need to sleep for 0.2s because Ninja tracks mtimes
+ # at a low resolution: https://github.com/ninja-build/ninja/issues/371
+ time.sleep(0.2)
+ os.utime(os.path.join(testdir, 'meson.build'))
test_start = time.time()
# Note that we don't test that running e.g. 'ninja test' actually
# works. One hopes that this is a common enough happening that