From 106fd80dfc621521e3bec6c31f628ed1fc82db25 Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Fri, 22 Mar 2024 15:12:58 +0000 Subject: [PATCH] update html report styling --- classes/TestMethod.lua | 6 +- classes/TestModule.lua | 26 +- classes/TestSuite.lua | 61 ++- examples/lovetest_runAllTests.html | 4 +- examples/lovetest_runAllTests.md | 54 +-- examples/lovetest_runAllTests.xml | 627 +++++++++++++++-------------- 6 files changed, 438 insertions(+), 340 deletions(-) diff --git a/classes/TestMethod.lua b/classes/TestMethod.lua index 274d5a9..aedffc2 100644 --- a/classes/TestMethod.lua +++ b/classes/TestMethod.lua @@ -576,10 +576,10 @@ TestMethod = { end -- append HTML for the test class result - local status = '🔴' + local status = '' local cls = 'red' - if self.passed then status = '🟢'; cls = '' end - if self.skipped then status = '🟡'; cls = '' end + if self.passed then status = '
'; cls = 'green' end + if self.skipped then status = ''; cls = 'yellow' end self.testmodule.html = self.testmodule.html .. '' .. '' .. status .. '' .. diff --git a/classes/TestModule.lua b/classes/TestModule.lua index 805738b..8ee34a8 100644 --- a/classes/TestModule.lua +++ b/classes/TestModule.lua @@ -82,8 +82,8 @@ TestModule = { -- @return {nil} printResult = function(self) local finaltime = UtilTimeFormat(self.time) - local status = '🔴' - if self.failed == 0 then status = '🟢' end + local status = '
' + if self.failed == 0 then status = '
' end -- add md row to main output love.test.mdrows = love.test.mdrows .. '| ' .. status .. ' ' .. self.module .. @@ -98,13 +98,23 @@ TestModule = { '" skipped="' .. tostring(self.skipped) .. '" time="' .. finaltime .. '">\n' .. self.xml .. '\t\n' -- add html to main output - love.test.html = love.test.html .. '

' .. status .. ' love.' .. self.module .. '