summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/actions/test/main.lua16
1 files changed, 8 insertions, 8 deletions
diff --git a/xmake/actions/test/main.lua b/xmake/actions/test/main.lua
index b86029b52..84763017f 100644
--- a/xmake/actions/test/main.lua
+++ b/xmake/actions/test/main.lua
@@ -168,25 +168,25 @@ function _do_test_target(target, opt)
end
end
- if errors and #errors > 0 then
- opt.errors = errors
- end
-
if should_fail then
if not passed then
passed = true
- opt.errors = nil -- clear errors, since failure was expected
+ errors = nil -- clear errors, since failure was expected
else
passed = false
local extra_info = string.format("Test %s unexpectedly passed (should fail)", opt.name)
- if opt.errors and #opt.errors > 0 then
- opt.errors = opt.errors .. "\n" .. extra_info
+ if errors and #errors > 0 then
+ errors = errors .. "\n" .. extra_info
else
- opt.errors = extra_info
+ errors = extra_info
end
end
end
+ if errors and #errors > 0 then
+ opt.errors = errors
+ end
+
return passed
end