Skip to content

Commit

Permalink
Fix WindowsTests.test_modules under VS tools env with clang-cl
Browse files Browse the repository at this point in the history
The windowstests.py 'test_modules' test incorrectly assumed we're dealing
with the msvc compiler, when it's perfectly reasonable to be using the
clang-cl compiler (i.e. through CXX=clang-cl env.var), which doesn't yet
support C++ modules, so have added an extra skip check, along with a
TODO/FIXME to refine the skip check with a version check when clang-cl
supports modules.
  • Loading branch information
GertyP committed Sep 10, 2023
1 parent ec331df commit 9a584f7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion unittests/windowstests.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,16 @@ def test_modules(self):
raise SkipTest('C++ modules is only supported with Visual Studio.')
if version_compare(os.environ['VSCMD_VER'], '<16.10.0'):
raise SkipTest('C++ modules are only supported with VS 2019 Preview or newer.')
self.init(os.path.join(self.unit_test_dir, '85 cpp modules'))
# Even after all the above, it's still possible that we're configured to
# build with the clang-cl compiler (i.e. with 'CXX=clang-cl' env.var),
# which, at least as of vesion 15.0.1, doesn't yet have modules support.
testdir = os.path.join(self.unit_test_dir, '85 cpp modules')
env = get_fake_env(testdir, self.builddir, self.prefix)
cc = detect_c_compiler(env, MachineChoice.HOST)
if cc.get_id() == 'clang-cl':
# FIXME: When supported, skip depending on version number.
raise SkipTest('clang-cl does not yet support C++ modules')
self.init(testdir)
self.build()

def test_non_utf8_fails(self):
Expand Down

0 comments on commit 9a584f7

Please sign in to comment.