aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorDavid Seifert <soap@gentoo.org>2019-07-14 09:54:20 +0200
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2019-07-14 15:12:16 +0000
commitcd12a6fc391782fc9101f71e7bef56590358f06c (patch)
treefac1d62dfb2f73f0d1f1be8ff93cbae5670ac4de /run_unittests.py
parentfcf27c2a2d36f81168bd14d933799c171d2ffb81 (diff)
downloadmeson-cd12a6fc391782fc9101f71e7bef56590358f06c.zip
meson-cd12a6fc391782fc9101f71e7bef56590358f06c.tar.gz
meson-cd12a6fc391782fc9101f71e7bef56590358f06c.tar.bz2
Add test to catch `-Werror=unused-parameter` brittleness
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/run_unittests.py b/run_unittests.py
index 306c221..793e326 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -4553,10 +4553,17 @@ class LinuxlikeTests(BasePlatformTests):
Test that compiler check flags override all other flags. This can't be
an ordinary test case because it needs the environment to be set.
'''
+ testdir = os.path.join(self.common_test_dir, '40 has function')
+ env = get_fake_env(testdir, self.builddir, self.prefix)
+ cpp = env.detect_cpp_compiler(MachineChoice.HOST)
Oflag = '-O3'
+ OflagCPP = Oflag
+ if cpp.get_id() in ('clang', 'gcc'):
+ # prevent developers from adding "int main(int argc, char **argv)"
+ # to small Meson checks unless these parameters are actually used
+ OflagCPP += ' -Werror=unused-parameter'
env = {'CFLAGS': Oflag,
- 'CXXFLAGS': Oflag}
- testdir = os.path.join(self.common_test_dir, '40 has function')
+ 'CXXFLAGS': OflagCPP}
self.init(testdir, override_envvars=env)
cmds = self.get_meson_log_compiler_checks()
for cmd in cmds: