aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-04-05 00:02:41 +0300
committerGitHub <noreply@github.com>2017-04-05 00:02:41 +0300
commitb42adc8a5460c44226dc42291df790c6ec954922 (patch)
tree41a8e726bc3afdd303f46880da68fea99261e669 /run_unittests.py
parent655757bc00d8588a64b4fcac5146c0dd8516b93f (diff)
parent41769d0c105f071cd7dad9eafaa4092683c583c4 (diff)
downloadmeson-b42adc8a5460c44226dc42291df790c6ec954922.zip
meson-b42adc8a5460c44226dc42291df790c6ec954922.tar.gz
meson-b42adc8a5460c44226dc42291df790c6ec954922.tar.bz2
Merge pull request #1511 from centricular/get-define
New compiler function: cc.get_define()
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py
index 0656f88..53abef7 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -947,6 +947,21 @@ class AllPlatformTests(BasePlatformTests):
m = re.search('build c-asm.*: c_LINKER', contents)
self.assertIsNotNone(m, msg=contents)
+ def test_preprocessor_checks_CPPFLAGS(self):
+ '''
+ Test that preprocessor compiler checks read CPPFLAGS but not CFLAGS
+ '''
+ testdir = os.path.join(self.common_test_dir, '140 get define')
+ define = 'MESON_TEST_DEFINE_VALUE'
+ # NOTE: this list can't have \n, ' or "
+ # \n is never substituted by the GNU pre-processor via a -D define
+ # ' and " confuse shlex.split() even when they are escaped
+ # % and # confuse the MSVC preprocessor
+ value = 'spaces and fun!@$^&*()-=_+{}[]:;<>?,./~`'
+ os.environ['CPPFLAGS'] = '-D{}="{}"'.format(define, value)
+ os.environ['CFLAGS'] = '-DMESON_FAIL_VALUE=cflags-read'.format(define)
+ self.init(testdir, ['-D{}={}'.format(define, value)])
+
class WindowsTests(BasePlatformTests):
'''