From 22d46b0b3586b535f183a256fee5b198ebb96237 Mon Sep 17 00:00:00 2001 From: Arthur LAURENT Date: Fri, 2 Feb 2024 18:27:52 +0100 Subject: add a test for circular dependency detection --- tests/projects/c++/modules/test_base_failed.lua | 46 +++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 tests/projects/c++/modules/test_base_failed.lua (limited to 'tests/projects/c++/modules/test_base_failed.lua') diff --git a/tests/projects/c++/modules/test_base_failed.lua b/tests/projects/c++/modules/test_base_failed.lua new file mode 100644 index 000000000..8f33d1fbf --- /dev/null +++ b/tests/projects/c++/modules/test_base_failed.lua @@ -0,0 +1,46 @@ +import("lib.detect.find_tool") +import("core.base.semver") + +function _build() + local ci = (os.getenv("CI") or os.getenv("GITHUB_ACTIONS") or ""):lower() + if ci == "true" then + assert(os.execv("xmake", {"-rvD"}, {try = true})) + else + assert(os.execv("xmake", {"-r"}, {try = true})) + end +end + +function main(t) + if is_subhost("windows") then + local clang = find_tool("clang", {version = true}) + if clang and clang.version and semver.compare(clang.version, "14.0") >= 0 then + os.exec("xmake f --toolchain=clang -c --yes") + _build() + os.exec("xmake clean -a") + os.exec("xmake f --toolchain=clang --runtimes=c++_shared -c --yes") + _build() + end + + os.exec("xmake clean -a") + os.exec("xmake f -c --yes") + _build() + elseif is_subhost("msys") then + os.exec("xmake f -c -p mingw --yes") + _build() + elseif is_host("linux") then + local gcc = find_tool("gcc", {version = true}) + if gcc and gcc.version and semver.compare(gcc.version, "11.0") >= 0 then + os.exec("xmake f -c --yes") + _build() + end + local clang = find_tool("clang", {version = true}) + if clang and clang.version and semver.compare(clang.version, "14.0") >= 0 then + os.exec("xmake clean -a") + os.exec("xmake f --toolchain=clang -c --yes") + _build() + os.exec("xmake clean -a") + os.exec("xmake f --toolchain=clang --runtimes=c++_shared -c --yes") + _build() + end + end +end -- cgit v1.3.1