summaryrefslogtreecommitdiff
path: root/tests/projects/c++
diff options
context:
space:
mode:
authorArthur LAURENT <[email protected]>2025-05-22 08:51:48 +0200
committerArthur LAURENT <[email protected]>2025-05-22 08:51:48 +0200
commit481ada9f541be6754801d36bd03c84e7b8665b58 (patch)
tree951bba94cd5c7cb82b5d0239b1415fc26dccfdc4 /tests/projects/c++
parent42ba909a17dd780a8bf1ba51a8fcd05ad9418ebd (diff)
(C++ modules support) fix clang-cl
Diffstat (limited to 'tests/projects/c++')
-rw-r--r--tests/projects/c++/modules/hello_with_pch/test.lua12
-rw-r--r--tests/projects/c++/modules/test_base.lua12
2 files changed, 20 insertions, 4 deletions
diff --git a/tests/projects/c++/modules/hello_with_pch/test.lua b/tests/projects/c++/modules/hello_with_pch/test.lua
index 7717f8049..033d2882c 100644
--- a/tests/projects/c++/modules/hello_with_pch/test.lua
+++ b/tests/projects/c++/modules/hello_with_pch/test.lua
@@ -1 +1,13 @@
inherit(".test_base")
+
+CLANG_MIN_VER = "17"
+GCC_MIN_VER = "11"
+MSVC_MIN_VER = "14.29"
+
+function main(_)
+ -- clang-cl doesn't support mixing pch and C++ module atm
+ local clang_options = {compiler = "clang", version = CLANG_MIN_VER, disable_clang_cl = true}
+ local gcc_options = {compiler = "gcc", version = GCC_MIN_VER}
+ local msvc_options = {version = MSVC_MIN_VER}
+ run_tests(clang_options, gcc_options, msvc_options)
+end
diff --git a/tests/projects/c++/modules/test_base.lua b/tests/projects/c++/modules/test_base.lua
index 3f05281f3..0f030e065 100644
--- a/tests/projects/c++/modules/test_base.lua
+++ b/tests/projects/c++/modules/test_base.lua
@@ -4,6 +4,7 @@ import("core.tool.toolchain")
import("utils.ci.is_running", {alias = "ci_is_running"})
CLANG_MIN_VER = "17"
+CLANG_CL_MIN_VER = "19"
GCC_MIN_VER = "11"
MSVC_MIN_VER = "14.29"
@@ -83,7 +84,7 @@ function build_tests(toolchain_name, opt)
wprint(version_str .. "not found, skipping tests")
return
end
-
+
local policies = "--policies=build.c++.modules.std:" .. (opt.stdmodule and "y" or "n")
policies = policies .. ",build.c++.modules.fallbackscanner:" .. (opt.fallbackscanner and "y" or "n")
@@ -127,9 +128,12 @@ function run_tests(clang_options, gcc_options, msvc_options)
if clang_options then
build_tests("llvm", clang_options)
build_tests("clang", clang_options)
- local clang_cl_options = table.clone(clang_options)
- clang_cl_options.compiler = "clang-cl"
- build_tests("clang-cl", clang_cl_options)
+ if not clang_options.disable_clang_cl then
+ local clang_cl_options = table.clone(clang_options)
+ clang_cl_options.compiler = "clang-cl"
+ clang_cl_options.version = CLANG_CL_MIN_VER
+ build_tests("clang-cl", clang_cl_options)
+ end
if not clang_options.stdmodule then
build_tests("llvm", clang_libcpp_options)
build_tests("clang", clang_libcpp_options)