aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2019-04-17 19:14:26 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2019-04-18 09:01:23 +0000
commit7654db511c9341ae4e1b1ccca09d88c6554599b6 (patch)
treecdf51fa01e3495181a214f389e5d53b6cc567ac2 /run_unittests.py
parent3c86520b6f6f9bd4274974496f6a5b56ec9f9ecd (diff)
downloadmeson-7654db511c9341ae4e1b1ccca09d88c6554599b6.zip
meson-7654db511c9341ae4e1b1ccca09d88c6554599b6.tar.gz
meson-7654db511c9341ae4e1b1ccca09d88c6554599b6.tar.bz2
vs: Update toolset table for VS 2019
Also add a test to ensure that we don't forget it in the future.
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py
index aa93ee3..b28eab2 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -958,6 +958,22 @@ class InternalTests(unittest.TestCase):
self.assertEqual(ver_a.__cmp__(ver_b), result)
self.assertEqual(ver_b.__cmp__(ver_a), -result)
+ def test_msvc_toolset_version(self):
+ '''
+ Ensure that the toolset version returns the correct value for this MSVC
+ '''
+ env = get_fake_env()
+ cc = env.detect_c_compiler(False)
+ if cc.get_argument_syntax() != 'msvc':
+ raise unittest.SkipTest('Test only applies to MSVC-like compilers')
+ toolset_ver = cc.get_toolset_version()
+ self.assertIsNotNone(toolset_ver)
+ self.assertIn('VCToolsVersion', os.environ)
+ vctools_ver = os.environ['VCToolsVersion']
+ self.assertTrue(vctools_ver.startswith(toolset_ver),
+ msg='{!r} does not start with {!r}'.format(vctools_ver, toolset_ver))
+
+
@unittest.skipIf(is_tarball(), 'Skipping because this is a tarball release')
class DataTests(unittest.TestCase):