From 7b4d08538adbca2fe5f0ec1203da911967c9ddad Mon Sep 17 00:00:00 2001 From: Francesco Guastella Date: Wed, 25 Jun 2025 19:45:22 +0200 Subject: Minor change --- xmake/actions/test/main.lua | 16 ++++++++-------- 1 file 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 -- cgit v1.3.1