Move VS C++17 test to a unit test since it requires env setup.

pull/4414/head
Jussi Pakkanen 6 years ago
parent 61348da069
commit c4a9f59dc4
  1. 13
      run_unittests.py
  2. 0
      test cases/unit/45 vscpp17/main.cpp
  3. 4
      test cases/unit/45 vscpp17/meson.build
  4. 9
      test cases/windows/17 cpp17/meson.build

@ -3097,6 +3097,19 @@ 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 subprocess.CalledProcessError:
# According to Python docs, output is only stored when
# using check_output. We don't use it, so we can't check
# that the output is correct (i.e. that it failed due
# to the right reason).
return
self.build()
class DarwinTests(BasePlatformTests):
'''
Tests that should run on macOS

@ -0,0 +1,4 @@
project('msvc_cpp17', 'cpp', default_options: ['cpp_std=c++17'])
exe = executable('msvc_cpp17', 'main.cpp')
test('msvc_cpp17', exe)

@ -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)
Loading…
Cancel
Save