From b322a1b6b143d360056d2f0910f939ec1645f47e Mon Sep 17 00:00:00 2001 From: Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com> Date: Fri, 4 Oct 2024 15:45:46 +0200 Subject: [PATCH] fix(base.lua): fix 'skip' status in test result output Corrected the displayed status of skipped tests from 'skip' to 'dnr' (short for 'did not run'). This change ensures better clarity in the test summary by accurately reflecting the status of each test. The modification impacts the visual representation of skipped tests, enhancing the overall readability of the test results. --- base.lua | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/base.lua b/base.lua index d9fb553..69ee1a4 100644 --- a/base.lua +++ b/base.lua @@ -440,6 +440,18 @@ local print_result_line = function(test) end local display_tests_summary = function() + + print(string.rep("-",80)) + print("----"..string.rep(" ",72).."----") + pprint("----"..string.rep(" ",27)) + pprint.bold.underline.orange("TESTS RUN SUMMARY") + print(string.rep(" ",28).."----") + print("----"..string.rep(" ",72).."----") + print(string.rep("-",80)) + + print("All tests done, " .. failed .. " tests failed.") + print() + for mod, tests_list in pairs(tests_by_mod) do pprint.baby_blue(string.format("%#80s\n", mod)) for _, test in ipairs(tests_list) do @@ -452,7 +464,7 @@ local display_tests_summary = function() else local s = ":"..test.mod..":" local rest = s .. test.name - pprint.light_gray(s.." "..test.name..string.rep(" ", 80 - #rest).."skip\n") + pprint.light_gray(s.." "..test.name..string.rep(" ", 80 - #rest).."dnr\n") end end pprint.baby_blue(string.rep("-",80),"\n") @@ -555,7 +567,6 @@ test_harness.run_player_tests = function(list_player_tests, area) end if tests_state == TESTS_STATE_ENUM.DONE then - print("All tests done, " .. failed .. " tests failed.") display_tests_summary() if minetest.settings:get_bool("test_harness_stop_server", true) then @@ -647,7 +658,6 @@ local run_tests = function() tests_state = TESTS_STATE_ENUM.DONE end if tests_state == TESTS_STATE_ENUM.DONE then - print("All tests done, " .. failed .. " tests failed.") display_tests_summary() if minetest.settings:get_bool("test_harness_stop_server", true) then