aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2016-10-12 20:22:04 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2016-10-12 20:49:19 +0530
commit7307f6a5c84c507ae8801405d1d1ee1b68151edd (patch)
tree514cb9453bf02e2336cb8414b20ac330f79123b3 /run_unittests.py
parent69ca8f5b544f700210d9f18613311bcce3c2e37a (diff)
downloadmeson-7307f6a5c84c507ae8801405d1d1ee1b68151edd.zip
meson-7307f6a5c84c507ae8801405d1d1ee1b68151edd.tar.gz
meson-7307f6a5c84c507ae8801405d1d1ee1b68151edd.tar.bz2
unittests/pic: Actually test that setting b_staticpic works
The previous test was tautological for the second half because: a) b_staticpic=true is the default b) We weren't refetching the compdb
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py12
1 files changed, 9 insertions, 3 deletions
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()