From 507b1dc40e3ba110eca77430e98d71b47f386b55 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 21 Mar 2019 00:14:28 -0400 Subject: 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. --- run_unittests.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'run_unittests.py') 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): -- cgit v1.1