aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2017-02-03 17:19:42 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2017-02-18 02:37:32 +0530
commit217eae4011fa7693f6538d4240009fca7722d756 (patch)
treefc62fd22801a43ece280feafebd0d0056cfbfda1
parentdd47bcd2105c7de36520b1477f9f51926b5da58f (diff)
downloadmeson-217eae4011fa7693f6538d4240009fca7722d756.zip
meson-217eae4011fa7693f6538d4240009fca7722d756.tar.gz
meson-217eae4011fa7693f6538d4240009fca7722d756.tar.bz2
run_unittests: Move sleep() ninja bug hack to setconf
-rwxr-xr-xrun_unittests.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/run_unittests.py b/run_unittests.py
index 1e9aa5b..115a8a7 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -235,7 +235,12 @@ class BasePlatformTests(unittest.TestCase):
def run_target(self, target):
self.output += subprocess.check_output(self.ninja_command + [target])
- def setconf(self, arg):
+ def setconf(self, arg, will_build=True):
+ # This is needed to increase the difference between build.ninja's
+ # timestamp and coredata.dat's timestamp due to a Ninja bug.
+ # https://github.com/ninja-build/ninja/issues/371
+ if will_build:
+ time.sleep(1)
self._run(self.mconf_command + [arg, self.builddir])
def wipe(self):
@@ -321,7 +326,7 @@ class AllPlatformTests(BasePlatformTests):
self.wipe()
# libdir must be inside prefix even when set via mesonconf
self.init(testdir)
- self.assertRaises(subprocess.CalledProcessError, self.setconf, '-Dlibdir=/opt')
+ self.assertRaises(subprocess.CalledProcessError, self.setconf, '-Dlibdir=/opt', False)
class LinuxlikeTests(BasePlatformTests):
@@ -366,10 +371,6 @@ class LinuxlikeTests(BasePlatformTests):
self.init(testdir)
compdb = self.get_compdb()
self.assertIn('-fPIC', compdb[0]['command'])
- # This is needed to increase the difference between build.ninja's
- # timestamp and coredata.dat's timestamp due to a Ninja bug.
- # https://github.com/ninja-build/ninja/issues/371
- time.sleep(1)
self.setconf('-Db_staticpic=false')
# Regenerate build
self.build()