diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-05-07 11:15:40 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-05-09 14:23:15 +0530 |
commit | 1570a90822941b3f0e6cc8efa50002eb528bee43 (patch) | |
tree | d9ae927775b5794fc5c8c31e0ce82e5801e10763 /run_project_tests.py | |
parent | 41f51f567a167919b0e3bc88ae4b8cb05819971d (diff) | |
download | meson-1570a90822941b3f0e6cc8efa50002eb528bee43.zip meson-1570a90822941b3f0e6cc8efa50002eb528bee43.tar.gz meson-1570a90822941b3f0e6cc8efa50002eb528bee43.tar.bz2 |
project tests: Also regen before building
This actually caught a cached-dependency related bug for me that the
test-time regen did not. I also increased the ninja wait time to
1 second because that's actually how long you need to sleep to be
guaranteed that a change will be detected.
Must poke upstream about https://github.com/ninja-build/ninja/issues/371
Diffstat (limited to 'run_project_tests.py')
-rwxr-xr-x | run_project_tests.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/run_project_tests.py b/run_project_tests.py index 1abc199..b8ef0e9 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -36,6 +36,7 @@ import concurrent.futures as conc import re from run_tests import get_backend_commands, get_backend_args_for_dir, Backend +from run_tests import ensure_backend_detects_changes class BuildStep(Enum): @@ -342,6 +343,10 @@ def _run_test(testdir, test_build_dir, install_dir, extra_args, compiler, backen return TestResult('Test that should have failed succeeded', BuildStep.configure, stdo, stde, mesonlog, gen_time) if returncode != 0: return TestResult('Generating the build system failed.', BuildStep.configure, stdo, stde, mesonlog, gen_time) + # Touch the meson.build file to force a regenerate so we can test that + # regeneration works before a build is run. + ensure_backend_detects_changes(backend) + os.utime(os.path.join(testdir, 'meson.build')) # Build with subprocess dir_args = get_backend_args_for_dir(backend, test_build_dir) build_start = time.time() @@ -356,9 +361,8 @@ def _run_test(testdir, test_build_dir, install_dir, extra_args, compiler, backen if pc.returncode != 0: return TestResult('Compiling source code failed.', BuildStep.build, 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) + # regeneration works after a build is complete. + ensure_backend_detects_changes(backend) os.utime(os.path.join(testdir, 'meson.build')) test_start = time.time() # Test in-process |