aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-10-12 21:12:36 +0300
committerGitHub <noreply@github.com>2016-10-12 21:12:36 +0300
commitcb21c72ac848c3dec4de0b26fef96a2319bdefda (patch)
treeff88f9263b2e58cf764d4e176827df43dccc73e9
parent8faf0414ceebfdcc45081bfac0ed9d1b9f79ae9d (diff)
parent7307f6a5c84c507ae8801405d1d1ee1b68151edd (diff)
downloadmeson-cb21c72ac848c3dec4de0b26fef96a2319bdefda.zip
meson-cb21c72ac848c3dec4de0b26fef96a2319bdefda.tar.gz
meson-cb21c72ac848c3dec4de0b26fef96a2319bdefda.tar.bz2
Merge pull request #897 from centricular/fix-unittest-intermittent-failure
Fix PIC unittest failure and make it more useful
-rwxr-xr-xmeson.py6
-rwxr-xr-xrun_unittests.py12
2 files changed, 11 insertions, 7 deletions
diff --git a/meson.py b/meson.py
index 4d8a269..8c223e5 100755
--- a/meson.py
+++ b/meson.py
@@ -18,10 +18,8 @@ from mesonbuild import mesonmain
import sys, os
def main():
- launcher = sys.argv[0]
- # resolve the command path if not launched from $PATH
- if os.path.split(launcher)[0]:
- launcher = os.path.realpath(launcher)
+ # Always resolve the command path so Ninja can find it for regen, tests, etc.
+ launcher = os.path.realpath(sys.argv[0])
return mesonmain.run(launcher, sys.argv[1:])
if __name__ == '__main__':
diff --git a/run_unittests.py b/run_unittests.py
index 5cd7d0f..9ea9e23 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import unittest, os, sys, shutil
+import unittest, os, sys, shutil, time
import subprocess
import re, json
import tempfile
@@ -77,9 +77,15 @@ class LinuxlikeTests(unittest.TestCase):
self.init(testdir)
compdb = self.get_compdb()
self.assertTrue('-fPIC' in compdb[0]['command'])
- self.setconf('-Db_staticpic=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
+ time.sleep(1)
+ self.setconf('-Db_staticpic=false')
+ # Regenerate build
self.build()
- self.assertFalse('-fPIC' not in compdb[0]['command'])
+ compdb = self.get_compdb()
+ self.assertTrue('-fPIC' not in compdb[0]['command'])
if __name__ == '__main__':
unittest.main()