summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZachary Michaels <[email protected]>2023-10-29 10:59:38 -0700
committerZachary Michaels <[email protected]>2023-10-29 11:02:09 -0700
commitfb47c199a92c1f2f19e6b38686c4a69fd5af667a (patch)
tree03ab02b36985b400b1812368a349a79208316c6a
parent75307fc3b712f43a73c0b683350a308c660283e3 (diff)
Tests: build_only -> build_should_fail
Switch from testing for build success to testing for build failure.
-rw-r--r--tests/actions/test/xmake.lua2
-rw-r--r--xmake/actions/test/main.lua8
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/actions/test/xmake.lua b/tests/actions/test/xmake.lua
index 4823ca5da..641b4c764 100644
--- a/tests/actions/test/xmake.lua
+++ b/tests/actions/test/xmake.lua
@@ -17,4 +17,4 @@ target("test_10")
set_kind("binary")
set_default(false)
add_files("src/compile.cpp")
- add_tests("compile", {build_only = true})
+ add_tests("compile", {build_should_fail = true})
diff --git a/xmake/actions/test/main.lua b/xmake/actions/test/main.lua
index 56a52ad0b..5059140bb 100644
--- a/xmake/actions/test/main.lua
+++ b/xmake/actions/test/main.lua
@@ -384,10 +384,10 @@ function main()
local targetnames = {}
for _, testinfo in table.orderpairs(tests) do
local targetname = testinfo.target:name()
- if testinfo.build_only then
- local passed, errors = _try_build_target(targetname)
- testinfo.passed = passed
- testinfo.errors = errors
+ if testinfo.build_should_fail then
+ local built, _ = _try_build_target(targetname)
+ testinfo.passed = not built
+ testinfo.errors = "Build succeeded when failure was expected"
else
table.insert(targetnames, targetname)
end