From 8b4e9f90ba045edb14cb2800c506ee6bc5118cd7 Mon Sep 17 00:00:00 2001 From: Arthur LAURENT Date: Wed, 21 May 2025 01:37:17 +0200 Subject: (C++ modules support) refactor tests --- .../c++/modules/test_duplicate_modules.lua | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 tests/projects/c++/modules/test_duplicate_modules.lua (limited to 'tests/projects/c++/modules/test_duplicate_modules.lua') diff --git a/tests/projects/c++/modules/test_duplicate_modules.lua b/tests/projects/c++/modules/test_duplicate_modules.lua new file mode 100644 index 000000000..76e8806f7 --- /dev/null +++ b/tests/projects/c++/modules/test_duplicate_modules.lua @@ -0,0 +1,33 @@ +inherit("test_base") +import("utils.ci.is_running", {alias = "ci_is_running"}) + +CLANG_MIN_VER = "17" +GCC_MIN_VER = "11" +MSVC_MIN_VER = "14.29" + +function _build() + try { + function() + if ci_is_running() then + os.run("xmake -rvD") + else + os.run("xmake -r") + end + end, + catch { + function (errors) + errors = tostring(errors) + if not errors:find("duplicate module name detected", 1, true) then + raise("Modules duplicate name detection does not work\n%s", errors) + end + end + } + } +end + +function main(_) + local clang_options = {compiler = "clang", version = CLANG_MIN_VER, build = _build} + local gcc_options = {compiler = "gcc", version = GCC_MIN_VER, build = _build} + local msvc_options = {version = MSVC_MIN_VER, build = _build} + run_tests(clang_options, gcc_options, msvc_options) +end -- cgit v1.3.1