From 1570a90822941b3f0e6cc8efa50002eb528bee43 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sun, 7 May 2017 11:15:40 +0530 Subject: 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 --- run_unittests.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'run_unittests.py') diff --git a/run_unittests.py b/run_unittests.py index d285e6a..ed98cad 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -30,6 +30,7 @@ from mesonbuild.dependencies import PkgConfigDependency, ExternalProgram from run_tests import exe_suffix, get_fake_options, FakeEnvironment from run_tests import get_builddir_target_args, get_backend_commands, Backend +from run_tests import ensure_backend_detects_changes def get_soname(fname): @@ -355,13 +356,6 @@ class BasePlatformTests(unittest.TestCase): # XCode backend is untested with unit tests, help welcome! self.no_rebuild_stdout = 'UNKNOWN BACKEND {!r}'.format(self.backend.name) - def ensure_backend_detects_changes(self): - # This is needed to increase the difference between build.ninja's - # timestamp and the timestamp of whatever you changed due to a Ninja - # bug: https://github.com/ninja-build/ninja/issues/371 - if self.backend is Backend.ninja: - time.sleep(1) - def _print_meson_log(self): log = os.path.join(self.logdir, 'meson-log.txt') if not os.path.isfile(log): @@ -439,14 +433,14 @@ class BasePlatformTests(unittest.TestCase): def setconf(self, arg, will_build=True): if will_build: - self.ensure_backend_detects_changes() + ensure_backend_detects_changes(self.backend) self._run(self.mconf_command + [arg, self.builddir]) def wipe(self): shutil.rmtree(self.builddir) def utime(self, f): - self.ensure_backend_detects_changes() + ensure_backend_detects_changes(self.backend) os.utime(f) def get_compdb(self): -- cgit v1.1