From e20c6cafdb241ad6f858556c33463da1a092abdc Mon Sep 17 00:00:00 2001 From: Arthur LAURENT Date: Tue, 23 Jan 2024 18:22:52 +0100 Subject: improve module tests --- tests/projects/c++/modules/test_stdmodules.lua | 32 ++++++++++++++++++-------- 1 file changed, 23 insertions(+), 9 deletions(-) (limited to 'tests/projects/c++/modules/test_stdmodules.lua') diff --git a/tests/projects/c++/modules/test_stdmodules.lua b/tests/projects/c++/modules/test_stdmodules.lua index 360a56cbc..0ba72cc50 100644 --- a/tests/projects/c++/modules/test_stdmodules.lua +++ b/tests/projects/c++/modules/test_stdmodules.lua @@ -13,33 +13,47 @@ 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, "18.0") >= 0 then + -- os.exec("xmake f --toolchain=clang -c --yes") + -- _build() + -- clang don't support libc++ std modules atm + -- os.exec("xmake clean -a") + -- os.exec("xmake f --toolchain=clang --cxxflags=\"-stdlib=libc++\" -c --yes") + -- _build() + -- end local msvc = toolchain.load("msvc") if msvc and msvc:check() then local vcvars = msvc:config("vcvars") if vcvars and vcvars.VCInstallDir and vcvars.VCToolsVersion and semver.compare(vcvars.VCToolsVersion, "14.35") then local stdmodulesdir = path.join(vcvars.VCInstallDir, "Tools", "MSVC", vcvars.VCToolsVersion, "modules") if os.isdir(stdmodulesdir) then - os.exec("xmake f -c") + os.exec("xmake clean -a") + os.exec("xmake f -c --yes") _build() end end end + elseif is_subhost("msys") then + -- os.exec("xmake f -c -p mingw --yes") + -- _build() elseif is_host("linux") then -- or is_host("macosx") then -- gcc don't support std modules atm -- local gcc = find_tool("gcc", {version = true}) -- if is_host("linux") and gcc and gcc.version and semver.compare(gcc.version, "11.0") >= 0 then - -- os.exec("xmake f -c") + -- 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 + -- local clang = find_tool("clang", {version = true}) + -- if clang and clang.version and semver.compare(clang.version, "18.0") >= 0 then -- clang don't support libstdc++ std modules atm -- os.exec("xmake clean -a") - -- os.exec("xmake f --toolchain=clang -c") + -- os.exec("xmake f --toolchain=clang -c --yes") -- _build() - os.exec("xmake clean -a") - os.exec("xmake f --toolchain=clang --cxxflags=\"-stdlib=libc++\" -c") - _build() - end + -- clang don't support libc++ std modules atm + -- os.exec("xmake clean -a") + -- os.exec("xmake f --toolchain=clang --cxxflags=\"-stdlib=libc++\" -c --yes") + -- _build() + -- end end end -- cgit v1.3.1 From cb8b45ba6e641156ca2e7544cce901c749b9d30a Mon Sep 17 00:00:00 2001 From: Arthur LAURENT Date: Fri, 26 Jan 2024 18:43:00 +0100 Subject: update tests to use XMake runtimes support --- tests/projects/c++/modules/test_base.lua | 4 ++-- tests/projects/c++/modules/test_headerunits.lua | 4 ++-- tests/projects/c++/modules/test_stdmodules.lua | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/projects/c++/modules/test_stdmodules.lua') diff --git a/tests/projects/c++/modules/test_base.lua b/tests/projects/c++/modules/test_base.lua index 08cda468b..c4252d41c 100644 --- a/tests/projects/c++/modules/test_base.lua +++ b/tests/projects/c++/modules/test_base.lua @@ -17,7 +17,7 @@ function main(t) os.exec("xmake f --toolchain=clang -c --yes") _build() os.exec("xmake clean -a") - os.exec("xmake f --toolchain=clang --cxxflags=\"-stdlib=libc++\" -c --yes") + os.exec("xmake f --toolchain=clang --runtimes=c++_shared -c --yes") _build() end @@ -39,7 +39,7 @@ function main(t) os.exec("xmake f --toolchain=clang -c --yes") _build() os.exec("xmake clean -a") - os.exec("xmake f --toolchain=clang --cxxflags=\"-stdlib=libc++\" -c --yes") + os.exec("xmake f --toolchain=clang --runtimes=c++_shared -c --yes") _build() end end diff --git a/tests/projects/c++/modules/test_headerunits.lua b/tests/projects/c++/modules/test_headerunits.lua index 0ece0992d..ba7fde015 100644 --- a/tests/projects/c++/modules/test_headerunits.lua +++ b/tests/projects/c++/modules/test_headerunits.lua @@ -21,7 +21,7 @@ function main(t) -- if semver.compare(clang.version, "17.0") >= 0 then -- os.exec("xmake clean -a") -- -- clang-scan-deps dependency detection doesn't support header units atm - -- os.exec("xmake f --toolchain=clang --policies=build.c++.clang.fallbackscanner --cxxflags=\"-stdlib=libc++\" -c --yes") + -- os.exec("xmake f --toolchain=clang --policies=build.c++.clang.fallbackscanner --runtimes=c++_shared -c --yes") -- _build() -- end end @@ -55,7 +55,7 @@ function main(t) -- if semver.compare(clang.version, "17.0") >= 0 then -- os.exec("xmake clean -a") -- -- clang-scan-deps dependency detection doesn't support header units atm - -- os.exec("xmake f --toolchain=clang --policies=build.c++.clang.fallbackscanner --cxxflags=\"-stdlib=libc++\" -c --yes") + -- os.exec("xmake f --toolchain=clang --policies=build.c++.clang.fallbackscanner --runtimes=c++_shared -c --yes") -- _build() -- end end diff --git a/tests/projects/c++/modules/test_stdmodules.lua b/tests/projects/c++/modules/test_stdmodules.lua index 0ba72cc50..222ec9458 100644 --- a/tests/projects/c++/modules/test_stdmodules.lua +++ b/tests/projects/c++/modules/test_stdmodules.lua @@ -19,7 +19,7 @@ function main(t) -- _build() -- clang don't support libc++ std modules atm -- os.exec("xmake clean -a") - -- os.exec("xmake f --toolchain=clang --cxxflags=\"-stdlib=libc++\" -c --yes") + -- os.exec("xmake f --toolchain=clang --runtimes=c++_shared -c --yes") -- _build() -- end local msvc = toolchain.load("msvc") @@ -52,7 +52,7 @@ function main(t) -- _build() -- clang don't support libc++ std modules atm -- os.exec("xmake clean -a") - -- os.exec("xmake f --toolchain=clang --cxxflags=\"-stdlib=libc++\" -c --yes") + -- os.exec("xmake f --toolchain=clang --runtimes=c++_shared -c --yes") -- _build() -- end end -- cgit v1.3.1