aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2017-05-07 11:15:40 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2017-05-09 14:23:15 +0530
commit1570a90822941b3f0e6cc8efa50002eb528bee43 (patch)
treed9ae927775b5794fc5c8c31e0ce82e5801e10763 /run_unittests.py
parent41f51f567a167919b0e3bc88ae4b8cb05819971d (diff)
downloadmeson-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_unittests.py')
-rwxr-xr-xrun_unittests.py12
1 files changed, 3 insertions, 9 deletions
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):