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.
@@ -4368,12 +4368,11 @@ class LinuxlikeTests(BasePlatformTests):
cmd_std = '-std=FAIL'
env_flags = p.upper() + 'FLAGS'
os.environ[env_flags] = cmd_std
+ with self.assertRaises((subprocess.CalledProcessError, mesonbuild.mesonlib.EnvironmentException),
+ msg='C compiler should have failed with -std=FAIL'):
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)):
+ # 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):
