diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2023-02-07 14:07:55 -0800 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2023-02-19 02:55:58 +0530 |
commit | b68102102ccbfcb69398b06c751fc2b4fa19fbc4 (patch) | |
tree | a2d2acc87ac8a33b24236d085ba29e64d0437fef | |
parent | 095a6c4da2d5da95cf8c9a9e35f5c55895957859 (diff) | |
download | meson-b68102102ccbfcb69398b06c751fc2b4fa19fbc4.zip meson-b68102102ccbfcb69398b06c751fc2b4fa19fbc4.tar.gz meson-b68102102ccbfcb69398b06c751fc2b4fa19fbc4.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.
-rw-r--r-- | unittests/internaltests.py | 11 |
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): |