aboutsummaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2023-03-28 08:43:15 -0400
committerEli Schwartz <eschwartz@archlinux.org>2023-03-30 17:10:53 -0400
commit0418a40e68704e2ad36148eb72e92a1206de72dd (patch)
treece86b96a61bb87379e481a3b9f8df499711bbb10 /unittests
parentad151d9f1123e84fea055848867c33bc965307f8 (diff)
downloadmeson-0418a40e68704e2ad36148eb72e92a1206de72dd.zip
meson-0418a40e68704e2ad36148eb72e92a1206de72dd.tar.gz
meson-0418a40e68704e2ad36148eb72e92a1206de72dd.tar.bz2
msetup: use more consistent exceptions on exit
- MesonException for errors is clearer than SystemExit('error message') and provides meson-formatted "ERROR: ..." - `raise SystemExit` with no parameter isn't obvious that it intends to exit successfully While clarifying the latter, it was observed to cause test_preprocessor_checks_CPPFLAGS() failure to be ignored. That test checks get_define() on both c and cpp compilers, which means we need to define either CPPFLAGS or both CFLAGS+CXXFLAGS.
Diffstat (limited to 'unittests')
-rw-r--r--unittests/allplatformstests.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/unittests/allplatformstests.py b/unittests/allplatformstests.py
index bb50128..ea9d795 100644
--- a/unittests/allplatformstests.py
+++ b/unittests/allplatformstests.py
@@ -1139,7 +1139,7 @@ class AllPlatformTests(BasePlatformTests):
def test_preprocessor_checks_CPPFLAGS(self):
'''
- Test that preprocessor compiler checks read CPPFLAGS and also CFLAGS but
+ Test that preprocessor compiler checks read CPPFLAGS and also CFLAGS/CXXFLAGS but
not LDFLAGS.
'''
testdir = os.path.join(self.common_test_dir, '132 get define')
@@ -1150,11 +1150,13 @@ class AllPlatformTests(BasePlatformTests):
# % and # confuse the MSVC preprocessor
# !, ^, *, and < confuse lcc preprocessor
value = 'spaces and fun@$&()-=_+{}[]:;>?,./~`'
- for env_var in ['CPPFLAGS', 'CFLAGS']:
+ for env_var in [{'CPPFLAGS'}, {'CFLAGS', 'CXXFLAGS'}]:
env = {}
- env[env_var] = f'-D{define}="{value}"'
+ for i in env_var:
+ env[i] = f'-D{define}="{value}"'
env['LDFLAGS'] = '-DMESON_FAIL_VALUE=cflags-read'
self.init(testdir, extra_args=[f'-D{define}={value}'], override_envvars=env)
+ self.new_builddir()
def test_custom_target_exe_data_deterministic(self):
testdir = os.path.join(self.common_test_dir, '109 custom target capture')