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.
This commit is contained in:
Yves-Marie Haussonne 2024-10-04 15:45:46 +02:00
parent ad261f3e41
commit b322a1b6b1

View File

@ -440,6 +440,18 @@ local print_result_line = function(test)
end end
local display_tests_summary = function() 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 for mod, tests_list in pairs(tests_by_mod) do
pprint.baby_blue(string.format("%#80s\n", mod)) pprint.baby_blue(string.format("%#80s\n", mod))
for _, test in ipairs(tests_list) do for _, test in ipairs(tests_list) do
@ -452,7 +464,7 @@ local display_tests_summary = function()
else else
local s = ":"..test.mod..":" local s = ":"..test.mod..":"
local rest = s .. test.name 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
end end
pprint.baby_blue(string.rep("-",80),"\n") pprint.baby_blue(string.rep("-",80),"\n")
@ -555,7 +567,6 @@ test_harness.run_player_tests = function(list_player_tests, area)
end end
if tests_state == TESTS_STATE_ENUM.DONE then if tests_state == TESTS_STATE_ENUM.DONE then
print("All tests done, " .. failed .. " tests failed.")
display_tests_summary() display_tests_summary()
if minetest.settings:get_bool("test_harness_stop_server", true) then 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 tests_state = TESTS_STATE_ENUM.DONE
end end
if tests_state == TESTS_STATE_ENUM.DONE then if tests_state == TESTS_STATE_ENUM.DONE then
print("All tests done, " .. failed .. " tests failed.")
display_tests_summary() display_tests_summary()
if minetest.settings:get_bool("test_harness_stop_server", true) then if minetest.settings:get_bool("test_harness_stop_server", true) then