aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2017-02-21 03:56:56 +0530
committerJussi Pakkanen <jpakkane@gmail.com>2017-07-17 19:20:00 +0300
commit5660c766ab276f91e9b8f79dbbea9cebbe17a395 (patch)
treee96263a2706bfa74f7b7b3a4228e6972dc75a5d5
parentef9e03b84786c4b8be63537eb9a1f58e991b19f3 (diff)
downloadmeson-5660c766ab276f91e9b8f79dbbea9cebbe17a395.zip
meson-5660c766ab276f91e9b8f79dbbea9cebbe17a395.tar.gz
meson-5660c766ab276f91e9b8f79dbbea9cebbe17a395.tar.bz2
unittests: Ensure that the compiler version is not blank
-rwxr-xr-xrun_unittests.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py
index 6a50302..e286a66 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -948,6 +948,7 @@ class AllPlatformTests(BasePlatformTests):
# Detect with evar and do sanity checks on that
if evar in os.environ:
ecc = getattr(env, 'detect_{}_compiler'.format(lang))(False)
+ self.assertTrue(ecc.version)
elinker = env.detect_static_linker(ecc)
# Pop it so we don't use it for the next detection
evalue = os.environ.pop(evar)
@@ -971,6 +972,7 @@ class AllPlatformTests(BasePlatformTests):
self.assertEqual(ecc.get_exelist(), shlex.split(evalue))
# Do auto-detection of compiler based on platform, PATH, etc.
cc = getattr(env, 'detect_{}_compiler'.format(lang))(False)
+ self.assertTrue(cc.version)
linker = env.detect_static_linker(cc)
# Check compiler type
if isinstance(cc, gnu):
@@ -1027,6 +1029,8 @@ class AllPlatformTests(BasePlatformTests):
# Ensure that the exelist is correct
self.assertEqual(wcc.get_exelist(), wrappercc)
self.assertEqual(wlinker.get_exelist(), wrapperlinker)
+ # Ensure that the version detection worked correctly
+ self.assertEqual(cc.version, wcc.version)
def test_always_prefer_c_compiler_for_asm(self):
testdir = os.path.join(self.common_test_dir, '141 c cpp and asm')