aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ericson <git@JohnEricson.me>2019-03-21 00:14:28 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2019-03-27 10:54:56 -0400
commit507b1dc40e3ba110eca77430e98d71b47f386b55 (patch)
tree2acc4ad83f95b9232c03a3bd6506953bf08483e4
parentf4da210f464446d92600456508439d2f926e6cea (diff)
downloadmeson-507b1dc40e3ba110eca77430e98d71b47f386b55.zip
meson-507b1dc40e3ba110eca77430e98d71b47f386b55.tar.gz
meson-507b1dc40e3ba110eca77430e98d71b47f386b55.tar.bz2
Fix test_compiler_*_stds tests after last commit
Since sanity check now includes CFLAGS, the test fails earlier. But if the compiler is ICC, it will only fail during the build proper as before, since that's where where the flag making `-std=unknown` an error not warning is used.
-rwxr-xr-xrun_unittests.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/run_unittests.py b/run_unittests.py
index f22a9b2..95e252c 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -4368,12 +4368,11 @@ class LinuxlikeTests(BasePlatformTests):
cmd_std = '-std=FAIL'
env_flags = p.upper() + 'FLAGS'
os.environ[env_flags] = cmd_std
- self.init(testdir)
- cmd = self.get_compdb()[0]['command']
- qcmd_std = " {} ".format(cmd_std)
- self.assertIn(qcmd_std, cmd)
- with self.assertRaises(subprocess.CalledProcessError,
- msg='{} should have failed'.format(qcmd_std)):
+ with self.assertRaises((subprocess.CalledProcessError, mesonbuild.mesonlib.EnvironmentException),
+ msg='C compiler should have failed with -std=FAIL'):
+ self.init(testdir)
+ # ICC won't fail in the above because additional flags are needed to
+ # make unknown -std=... options errors.
self.build()
def test_compiler_c_stds(self):