aboutsummaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2023-02-07 14:07:55 -0800
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2023-02-08 15:31:58 +0530
commitd0f81fd024b8b5b0e862deb6689d7abe11427885 (patch)
treec4c64ee3495f56f2dee61e321fb9fbeb61af1e42 /unittests
parentd55d7bc45dc8660f99d8084a1a793e3776ded807 (diff)
downloadmeson-d0f81fd024b8b5b0e862deb6689d7abe11427885.zip
meson-d0f81fd024b8b5b0e862deb6689d7abe11427885.tar.gz
meson-d0f81fd024b8b5b0e862deb6689d7abe11427885.tar.bz2
internaltests: Fix tests for /utf-8 removal
Now that we don't insert /utf-8 into the always args for MSVC < 19.00 we need to use a version > 19.00 for testing. This also means that /Zc:__cplusplus will be added to the always args.
Diffstat (limited to 'unittests')
-rw-r--r--unittests/internaltests.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/unittests/internaltests.py b/unittests/internaltests.py
index a669558..79a3217 100644
--- a/unittests/internaltests.py
+++ b/unittests/internaltests.py
@@ -224,22 +224,23 @@ class InternalTests(unittest.TestCase):
def test_compiler_args_class_visualstudio(self):
linker = mesonbuild.linkers.MSVCDynamicLinker(MachineChoice.HOST, [])
- cc = VisualStudioCPPCompiler([], [], 'fake', MachineChoice.HOST, False, mock.Mock(), 'x64', linker=linker)
+ # Version just needs to be > 19.0.0
+ cc = VisualStudioCPPCompiler([], [], '20.00', MachineChoice.HOST, False, mock.Mock(), 'x64', linker=linker)
a = cc.compiler_args(cc.get_always_args())
- self.assertEqual(a.to_native(copy=True), ['/nologo', '/showIncludes', '/utf-8'])
+ self.assertEqual(a.to_native(copy=True), ['/nologo', '/showIncludes', '/utf-8', '/Zc:__cplusplus'])
# Ensure /source-charset: removes /utf-8
a.append('/source-charset:utf-8')
- self.assertEqual(a.to_native(copy=True), ['/nologo', '/showIncludes', '/source-charset:utf-8'])
+ self.assertEqual(a.to_native(copy=True), ['/nologo', '/showIncludes', '/Zc:__cplusplus', '/source-charset:utf-8'])
# Ensure /execution-charset: removes /utf-8
a = cc.compiler_args(cc.get_always_args() + ['/execution-charset:utf-8'])
- self.assertEqual(a.to_native(copy=True), ['/nologo', '/showIncludes', '/execution-charset:utf-8'])
+ self.assertEqual(a.to_native(copy=True), ['/nologo', '/showIncludes', '/Zc:__cplusplus', '/execution-charset:utf-8'])
# Ensure /validate-charset- removes /utf-8
a = cc.compiler_args(cc.get_always_args() + ['/validate-charset-'])
- self.assertEqual(a.to_native(copy=True), ['/nologo', '/showIncludes', '/validate-charset-'])
+ self.assertEqual(a.to_native(copy=True), ['/nologo', '/showIncludes', '/Zc:__cplusplus', '/validate-charset-'])
def test_compiler_args_class_gnuld(self):