Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
czoido committed Oct 23, 2024
1 parent bc1f7f2 commit 76edde9
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def package_info(self):


@pytest.mark.tool("cmake")
@pytest.mark.tool("clang", "16")
@pytest.mark.tool("clang", "17")
@pytest.mark.skipif(platform.system() != "Windows", reason="requires Win")
class TestLLVMClang:
""" External LLVM/clang, with different CMake generators
Expand All @@ -73,7 +73,7 @@ class TestLLVMClang:

@pytest.mark.tool("mingw64")
@pytest.mark.tool("visual_studio", "17")
@pytest.mark.tool("clang", "16") # repeated, for priority over the mingw64 clang
@pytest.mark.tool("clang", "17") # repeated, for priority over the mingw64 clang
@pytest.mark.parametrize("runtime", ["static", "dynamic"])
def test_clang_mingw(self, client, runtime):
""" compiling with an LLVM-clang installed, which uses by default the
Expand Down Expand Up @@ -115,28 +115,28 @@ def test_clang_cmake_ninja_nmake(self, client, generator):
cmd = cmd + ".exe"
check_vs_runtime(cmd, client, "17", build_type="Release", static_runtime=False)

@pytest.mark.tool("visual_studio", "16")
@pytest.mark.tool("clang", "16") # repeated, for priority over the mingw64 clang
@pytest.mark.tool("visual_studio", "17")
@pytest.mark.tool("clang", "17") # repeated, for priority over the mingw64 clang
def test_clang_cmake_runtime_version(self, client):
generator = "Ninja"
# Make sure that normal CMakeLists with verify=False works
client.save({"CMakeLists.txt": gen_cmakelists(verify=False, appname="my_app",
appsources=["src/main.cpp"], install=True)})
client.run("create . --name=pkg --version=0.1 -pr=clang -s compiler.runtime=dynamic -s compiler.cppstd=17 "
"-s compiler.runtime_version=v142 "
"-s compiler.runtime_version=v144 "
'-c tools.cmake.cmaketoolchain:generator="{}"'.format(generator))

assert 'cmake -G "{}"'.format(generator) in client.out
assert "GNU-like command-line" in client.out
assert "main __clang_major__17" in client.out
# Check this! Clang compiler in Windows is reporting MSC_VER and MSVC_LANG!
assert "main _MSC_VER192" in client.out
assert "main _MSC_VER1941" in client.out
assert "main _MSVC_LANG2017" in client.out
assert "main _M_X64 defined" in client.out
assert "main __x86_64__ defined" in client.out
cmd = re.search(r"MYCMD=(.*)!", str(client.out)).group(1)
cmd = cmd + ".exe"
check_vs_runtime(cmd, client, "16", build_type="Release", static_runtime=False)
check_vs_runtime(cmd, client, "17", build_type="Release", static_runtime=False)


@pytest.mark.skipif(platform.system() != "Windows", reason="requires Win")
Expand Down

0 comments on commit 76edde9

Please sign in to comment.