diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-10-23 21:17:37 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-10-24 13:41:04 +0300 |
commit | e43e9910905bf1b99f2a31e5224b3c0fbed12958 (patch) | |
tree | 50782dca850e4ea93da867ffc4d3f946ea92f8b1 | |
parent | 87355c81326edd253f433f08e8d58f9df059951f (diff) | |
download | meson-vs17test.tar.gz |
Move VS C++17 test to a unit test since it requires env setup.vs17test
-rwxr-xr-x | run_unittests.py | 11 | ||||
-rw-r--r-- | test cases/unit/45 vscpp17/main.cpp (renamed from test cases/windows/17 cpp17/main.cpp) | 0 | ||||
-rw-r--r-- | test cases/unit/45 vscpp17/meson.build | 4 | ||||
-rw-r--r-- | test cases/windows/17 cpp17/meson.build | 9 |
4 files changed, 15 insertions, 9 deletions
diff --git a/run_unittests.py b/run_unittests.py index 9e9ba040c..b94604077 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -3097,6 +3097,17 @@ class WindowsTests(BasePlatformTests): self.utime(os.path.join(testdir, 'res', 'resource.h')) self.assertRebuiltTarget('prog_1') + @unittest.skipIf(shutil.which('cl') is None, 'Test only applies to VS') + def test_msvc_cpp17(self): + testdir = os.path.join(self.unit_test_dir, '45 vscpp17') + try: + self.init(testdir) + except Exception as e: + fail_message = 'Value "c++17" for combo option "cpp_std" is not one of the choices.' + self.assertIn(fail_message, e.args[1]) + return + self.build() + class DarwinTests(BasePlatformTests): ''' Tests that should run on macOS diff --git a/test cases/windows/17 cpp17/main.cpp b/test cases/unit/45 vscpp17/main.cpp index 36e4156e4..36e4156e4 100644 --- a/test cases/windows/17 cpp17/main.cpp +++ b/test cases/unit/45 vscpp17/main.cpp diff --git a/test cases/unit/45 vscpp17/meson.build b/test cases/unit/45 vscpp17/meson.build new file mode 100644 index 000000000..afe740bbc --- /dev/null +++ b/test cases/unit/45 vscpp17/meson.build @@ -0,0 +1,4 @@ +project('msvc_cpp17', 'cpp', default_options: ['cpp_std=c++17']) + +exe = executable('msvc_cpp17', 'main.cpp') +test('msvc_cpp17', exe) diff --git a/test cases/windows/17 cpp17/meson.build b/test cases/windows/17 cpp17/meson.build deleted file mode 100644 index 367bfd895..000000000 --- a/test cases/windows/17 cpp17/meson.build +++ /dev/null @@ -1,9 +0,0 @@ -project('msvc_cpp17', 'cpp', default_options: ['cpp_std=c++17']) - -compiler = meson.get_compiler('cpp') -if compiler.get_id() != 'msvc' or compiler.version().version_compare('<19.11') - error('MESON_SKIP_TEST Visual Studio 2017 (version 15.3) or later is required for C++17 support') -endif - -exe = executable('msvc_cpp17', 'main.cpp') -test('msvc_cpp17', exe) |