diff options
| -rw-r--r-- | tests/actions/test/xmake.lua | 2 | ||||
| -rw-r--r-- | xmake/actions/test/main.lua | 8 |
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 |
