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.
@@ -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):
