summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/actions/test/main.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/xmake/actions/test/main.lua b/xmake/actions/test/main.lua
index dfbc04038..5958325bc 100644
--- a/xmake/actions/test/main.lua
+++ b/xmake/actions/test/main.lua
@@ -387,7 +387,9 @@ function main()
if testinfo.build_should_fail then
local built, _ = _try_build_target(targetname)
testinfo.passed = not built
- testinfo.errors = "Build succeeded when failure was expected"
+ if built then
+ testinfo.errors = "Build succeeded when failure was expected"
+ end
else
table.insert(targetnames, targetname)
end