mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
0.2
- Added tests for all obj creation, transformation, window + system info graphics methods
- Added half the state methods for graphics + added placeholders for missing drawing methods
- Added TestMethod:assertNotNil() for quick nil checking
- Added time total to the end of each module summary in console log to match file output
- Removed a bunch of unessecary nil checks
- Removed :release() from test methods, collectgarbage("collect") is called between methods instead
- Renamed /output to /examples to avoid confusion
- Replaced love.filesystem.newFile with love.filesystem.openFile
- Replaced love.math.noise with love.math.perlinNoise / love.math.simplexNoise
- Fixed newGearJoint throwing an error in 12 as body needs to be dynamic not static now
- Some general cleanup, incl. better comments and time format in file output
This commit is contained in:
@@ -83,12 +83,13 @@ TestModule = {
|
||||
-- the XML + HTML for the test to the testsuite output
|
||||
-- @return {nil}
|
||||
printResult = function(self)
|
||||
local finaltime = UtilTimeFormat(self.time)
|
||||
-- add xml to main output
|
||||
love.test.xml = love.test.xml .. '\t<testsuite name="love.' .. self.module ..
|
||||
'" tests="' .. tostring(self.passed) ..
|
||||
'" failures="' .. tostring(self.failed) ..
|
||||
'" skipped="' .. tostring(self.skipped) ..
|
||||
'" time="' .. tostring(self.time*1000) .. '">\n' .. self.xml .. '\t</testsuite>\n'
|
||||
'" time="' .. finaltime .. '">\n' .. self.xml .. '\t</testsuite>\n'
|
||||
-- add html to main output
|
||||
local status = '🔴'
|
||||
if self.failed == 0 then status = '🟢' end
|
||||
@@ -96,8 +97,8 @@ TestModule = {
|
||||
'<li>🟢 ' .. tostring(self.passed) .. ' Tests</li>' ..
|
||||
'<li>🔴 ' .. tostring(self.failed) .. ' Failures</li>' ..
|
||||
'<li>🟡 ' .. tostring(self.skipped) .. ' Skipped</li>' ..
|
||||
'<li>' .. tostring(self.time*1000) .. 'ms</li>' .. '<ul><br/><br/>' ..
|
||||
'<table><thead><tr><td width="20px"></td><td width="100px">Method</td><td width="100px">Time</td><td>Details</td></tr></thead><tbody>' ..
|
||||
'<li>' .. finaltime .. 's</li>' .. '<ul><br/><br/>' ..
|
||||
'<table><thead><tr><td width="20px"></td><td width="100px">Method</td><td width="60px">Time</td><td>Details</td></tr></thead><tbody>' ..
|
||||
self.html .. '</tbody></table>'
|
||||
-- print module results to console
|
||||
self:log('yellow', 'love.' .. self.module .. '.testmodule.end')
|
||||
@@ -105,10 +106,10 @@ TestModule = {
|
||||
if self.failed == 0 then failedcol = '\27[37m' end
|
||||
self:log('green', tostring(self.passed) .. ' PASSED' .. ' || ' ..
|
||||
failedcol .. tostring(self.failed) .. ' FAILED || \27[37m' ..
|
||||
tostring(self.skipped) .. ' SKIPPED')
|
||||
tostring(self.skipped) .. ' SKIPPED || ' .. finaltime .. 's')
|
||||
self.start = false
|
||||
self.fakequit = false
|
||||
end
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user