Browse Source

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
ell 1 year ago
parent
commit
e03b2db08b

+ 16 - 10
testing/classes/TestMethod.lua

@@ -189,14 +189,23 @@ TestMethod = {
   -- @param {table} obj - table to check is a valid love object
   -- @param {table} obj - table to check is a valid love object
   -- @return {nil}
   -- @return {nil}
   assertObject = function(self, obj)
   assertObject = function(self, obj)
-    self:assertNotEquals(nil, obj, 'check not nill')
+    self:assertNotNil(obj)
     self:assertEquals('userdata', type(obj), 'check is userdata')
     self:assertEquals('userdata', type(obj), 'check is userdata')
-    if obj ~= nil then 
+    if obj ~= nil then
       self:assertNotEquals(nil, obj:type(), 'check has :type()')
       self:assertNotEquals(nil, obj:type(), 'check has :type()')
     end
     end
   end,
   end,
 
 
 
 
+  -- @method - TestMethod:assertNotNil()
+  -- @desc - quick assert for value not nil 
+  -- @param {any} value - value to check not nil
+  -- @return {nil}
+  assertNotNil = function (self, value)
+    self:assertNotEquals(nil, value, 'check not nil')
+  end,
+
+
 
 
   -- @method - TestMethod:skipTest()
   -- @method - TestMethod:skipTest()
   -- @desc - used to mark this test as skipped for a specific reason
   -- @desc - used to mark this test as skipped for a specific reason
@@ -289,10 +298,7 @@ TestMethod = {
     self.finish = love.timer.getTime() - self.start
     self.finish = love.timer.getTime() - self.start
     love.test.time = love.test.time + self.finish
     love.test.time = love.test.time + self.finish
     self.testmodule.time = self.testmodule.time + self.finish
     self.testmodule.time = self.testmodule.time + self.finish
-    local endtime = tostring(math.floor((love.timer.getTime() - self.start)*1000))
-    if string.len(endtime) == 1 then endtime = '   ' .. endtime end
-    if string.len(endtime) == 2 then endtime = '  ' .. endtime end
-    if string.len(endtime) == 3 then endtime = ' ' .. endtime end
+    local endtime = UtilTimeFormat(love.timer.getTime() - self.start)
 
 
     -- get failure/skip message for output (if any)
     -- get failure/skip message for output (if any)
     local failure = ''
     local failure = ''
@@ -309,7 +315,7 @@ TestMethod = {
     -- append XML for the test class result
     -- append XML for the test class result
     self.testmodule.xml = self.testmodule.xml .. '\t\t<testclass classname="' ..
     self.testmodule.xml = self.testmodule.xml .. '\t\t<testclass classname="' ..
       self.method .. '" name="' .. self.method ..
       self.method .. '" name="' .. self.method ..
-      '" time="' .. tostring(self.finish*1000) .. '">\n' ..
+      '" time="' .. endtime .. '">\n' ..
       failure .. '\t\t</testclass>\n'
       failure .. '\t\t</testclass>\n'
 
 
     -- unused currently, adds a preview image for certain graphics methods to the output
     -- unused currently, adds a preview image for certain graphics methods to the output
@@ -329,7 +335,7 @@ TestMethod = {
       '<tr class=" ' .. cls .. '">' ..
       '<tr class=" ' .. cls .. '">' ..
         '<td>' .. status .. '</td>' ..
         '<td>' .. status .. '</td>' ..
         '<td>' .. self.method .. '</td>' ..
         '<td>' .. self.method .. '</td>' ..
-        '<td>' .. tostring(self.finish*1000) .. 'ms</td>' ..
+        '<td>' .. endtime .. 's</td>' ..
         '<td>' .. output .. preview .. '</td>' ..
         '<td>' .. output .. preview .. '</td>' ..
       '</tr>'
       '</tr>'
 
 
@@ -350,10 +356,10 @@ TestMethod = {
     self.testmodule:log(
     self.testmodule:log(
       self.testmodule.colors[self.result.result],
       self.testmodule.colors[self.result.result],
       '  ' .. tested .. matching,
       '  ' .. tested .. matching,
-      ' ==> ' .. self.result.result .. ' - ' .. endtime .. 'ms ' ..
+      ' ==> ' .. self.result.result .. ' - ' .. endtime .. 's ' ..
       self.result.total .. msg
       self.result.total .. msg
     )
     )
   end
   end
 
 
 
 
-}
+}

+ 6 - 5
testing/classes/TestModule.lua

@@ -83,12 +83,13 @@ TestModule = {
   --         the XML + HTML for the test to the testsuite output
   --         the XML + HTML for the test to the testsuite output
   -- @return {nil}
   -- @return {nil}
   printResult = function(self)
   printResult = function(self)
+    local finaltime = UtilTimeFormat(self.time)
     -- add xml to main output
     -- add xml to main output
     love.test.xml = love.test.xml .. '\t<testsuite name="love.' .. self.module .. 
     love.test.xml = love.test.xml .. '\t<testsuite name="love.' .. self.module .. 
       '" tests="' .. tostring(self.passed) .. 
       '" tests="' .. tostring(self.passed) .. 
       '" failures="' .. tostring(self.failed) .. 
       '" failures="' .. tostring(self.failed) .. 
       '" skipped="' .. tostring(self.skipped) ..
       '" 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
     -- add html to main output
     local status = '🔴'
     local status = '🔴'
     if self.failed == 0 then status = '🟢' end
     if self.failed == 0 then status = '🟢' end
@@ -96,8 +97,8 @@ TestModule = {
       '<li>🟢&nbsp;' .. tostring(self.passed) .. ' Tests</li>' ..
       '<li>🟢&nbsp;' .. tostring(self.passed) .. ' Tests</li>' ..
       '<li>🔴&nbsp;' .. tostring(self.failed) .. ' Failures</li>' ..
       '<li>🔴&nbsp;' .. tostring(self.failed) .. ' Failures</li>' ..
       '<li>🟡&nbsp;' .. tostring(self.skipped) .. ' Skipped</li>' ..
       '<li>🟡&nbsp;' .. 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>'
       self.html .. '</tbody></table>'
     -- print module results to console
     -- print module results to console
     self:log('yellow', 'love.' .. self.module .. '.testmodule.end')
     self:log('yellow', 'love.' .. self.module .. '.testmodule.end')
@@ -105,10 +106,10 @@ TestModule = {
     if self.failed == 0 then failedcol = '\27[37m' end
     if self.failed == 0 then failedcol = '\27[37m' end
     self:log('green', tostring(self.passed) .. ' PASSED' .. ' || ' .. 
     self:log('green', tostring(self.passed) .. ' PASSED' .. ' || ' .. 
       failedcol .. tostring(self.failed) .. ' FAILED || \27[37m' .. 
       failedcol .. tostring(self.failed) .. ' FAILED || \27[37m' .. 
-      tostring(self.skipped) .. ' SKIPPED')
+      tostring(self.skipped) .. ' SKIPPED || ' .. finaltime .. 's')
     self.start = false
     self.start = false
     self.fakequit = false
     self.fakequit = false
   end
   end
 
 
 
 
-}
+}

+ 9 - 9
testing/classes/TestSuite.lua

@@ -10,7 +10,7 @@ TestSuite = {
       -- testsuite internals
       -- testsuite internals
       modules = {},
       modules = {},
       module = nil,
       module = nil,
-      testcanvas = love.graphics.newCanvas(16, 16),
+      testcanvas = nil,
       current = 1,
       current = 1,
       output = '',
       output = '',
       totals = {0, 0, 0},
       totals = {0, 0, 0},
@@ -91,6 +91,9 @@ TestSuite = {
                   test.fatal = tostring(chunk) .. tostring(err)
                   test.fatal = tostring(chunk) .. tostring(err)
                 end
                 end
               end
               end
+              -- save having to :release() anything we made in the last test
+              -- 7251ms > 7543ms
+              collectgarbage("collect")
               -- move onto the next test
               -- move onto the next test
               self.module.index = self.module.index + 1
               self.module.index = self.module.index + 1
             end
             end
@@ -124,15 +127,12 @@ TestSuite = {
   --         the XML + HTML of the testsuite output
   --         the XML + HTML of the testsuite output
   -- @return {nil}
   -- @return {nil}
   printResult = function(self)
   printResult = function(self)
-    local finaltime = tostring(math.floor(self.time*1000))
-    if string.len(finaltime) == 1 then finaltime = '   ' .. finaltime end
-    if string.len(finaltime) == 2 then finaltime = '  ' .. finaltime end
-    if string.len(finaltime) == 3 then finaltime = ' ' .. finaltime end
+    local finaltime = UtilTimeFormat(self.time)
 
 
     local xml = '<testsuites name="love.test" tests="' .. tostring(self.totals[1]) .. 
     local xml = '<testsuites name="love.test" tests="' .. tostring(self.totals[1]) .. 
       '" failures="' .. tostring(self.totals[2]) .. 
       '" failures="' .. tostring(self.totals[2]) .. 
       '" skipped="' .. tostring(self.totals[3]) .. 
       '" skipped="' .. tostring(self.totals[3]) .. 
-      '" time="' .. tostring(self.time*1000) .. '">\n'
+      '" time="' .. finaltime .. '">\n'
 
 
     local status = '🔴'
     local status = '🔴'
     if self.totals[2] == 0 then status = '🟢' end
     if self.totals[2] == 0 then status = '🟢' end
@@ -141,14 +141,14 @@ TestSuite = {
       '<li>🟢&nbsp;' .. tostring(self.totals[1]) .. ' Tests</li>' ..
       '<li>🟢&nbsp;' .. tostring(self.totals[1]) .. ' Tests</li>' ..
       '<li>🔴&nbsp;' .. tostring(self.totals[2]) .. ' Failures</li>' ..
       '<li>🔴&nbsp;' .. tostring(self.totals[2]) .. ' Failures</li>' ..
       '<li>🟡&nbsp;' .. tostring(self.totals[3]) .. ' Skipped</li>' ..
       '<li>🟡&nbsp;' .. tostring(self.totals[3]) .. ' Skipped</li>' ..
-      '<li>' .. tostring(self.time*1000) .. 'ms</li></ul><br/><br/>'
+      '<li>' .. finaltime .. 's</li></ul><br/><br/>'
 
 
     -- @TODO use mountFullPath to write output to src?
     -- @TODO use mountFullPath to write output to src?
     love.filesystem.createDirectory('output')
     love.filesystem.createDirectory('output')
     love.filesystem.write('output/' .. self.output .. '.xml', xml .. self.xml .. '</testsuites>')
     love.filesystem.write('output/' .. self.output .. '.xml', xml .. self.xml .. '</testsuites>')
     love.filesystem.write('output/' .. self.output .. '.html', html .. self.html .. '</div></body></html>')
     love.filesystem.write('output/' .. self.output .. '.html', html .. self.html .. '</div></body></html>')
 
 
-    self.module:log('grey', '\nFINISHED - ' .. finaltime .. 'ms\n')
+    self.module:log('grey', '\nFINISHED - ' .. finaltime .. 's\n')
     local failedcol = '\27[31m'
     local failedcol = '\27[31m'
     if self.totals[2] == 0 then failedcol = '\27[37m' end
     if self.totals[2] == 0 then failedcol = '\27[37m' end
     self.module:log('green', tostring(self.totals[1]) .. ' PASSED' .. ' || ' .. failedcol .. tostring(self.totals[2]) .. ' FAILED || \27[37m' .. tostring(self.totals[3]) .. ' SKIPPED')
     self.module:log('green', tostring(self.totals[1]) .. ' PASSED' .. ' || ' .. failedcol .. tostring(self.totals[2]) .. ' FAILED || \27[37m' .. tostring(self.totals[3]) .. ' SKIPPED')
@@ -156,4 +156,4 @@ TestSuite = {
   end
   end
 
 
 
 
-}
+}

+ 1 - 1
testing/conf.lua

@@ -21,4 +21,4 @@ function love.conf(t)
   t.modules.timer = true
   t.modules.timer = true
   t.modules.video = true
   t.modules.video = true
   t.modules.window = true
   t.modules.window = true
-end
+end

File diff suppressed because it is too large
+ 0 - 0
testing/examples/lovetest_runAllTests.html


+ 578 - 0
testing/examples/lovetest_runAllTests.xml

@@ -0,0 +1,578 @@
+<testsuites name="love.test" tests="226" failures="2" skipped="43" time="7.563">
+	<testsuite name="love.audio" tests="26" failures="0" skipped="0" time="0.006">
+		<testclass classname="getActiveEffects" name="getActiveEffects" time="0.000">
+		</testclass>
+		<testclass classname="getActiveSourceCount" name="getActiveSourceCount" time="0.001">
+		</testclass>
+		<testclass classname="getDistanceModel" name="getDistanceModel" time="0.000">
+		</testclass>
+		<testclass classname="getDopplerScale" name="getDopplerScale" time="0.000">
+		</testclass>
+		<testclass classname="getEffect" name="getEffect" time="0.000">
+		</testclass>
+		<testclass classname="getMaxSceneEffects" name="getMaxSceneEffects" time="0.000">
+		</testclass>
+		<testclass classname="getMaxSourceEffects" name="getMaxSourceEffects" time="0.000">
+		</testclass>
+		<testclass classname="getOrientation" name="getOrientation" time="0.000">
+		</testclass>
+		<testclass classname="getPosition" name="getPosition" time="0.000">
+		</testclass>
+		<testclass classname="getRecordingDevices" name="getRecordingDevices" time="0.000">
+		</testclass>
+		<testclass classname="getVelocity" name="getVelocity" time="0.000">
+		</testclass>
+		<testclass classname="getVolume" name="getVolume" time="0.000">
+		</testclass>
+		<testclass classname="isEffectsSupported" name="isEffectsSupported" time="0.000">
+		</testclass>
+		<testclass classname="newQueueableSource" name="newQueueableSource" time="0.000">
+		</testclass>
+		<testclass classname="newSource" name="newSource" time="0.001">
+		</testclass>
+		<testclass classname="pause" name="pause" time="0.001">
+		</testclass>
+		<testclass classname="play" name="play" time="0.001">
+		</testclass>
+		<testclass classname="setDistanceModel" name="setDistanceModel" time="0.000">
+		</testclass>
+		<testclass classname="setDopplerScale" name="setDopplerScale" time="0.000">
+		</testclass>
+		<testclass classname="setEffect" name="setEffect" time="0.000">
+		</testclass>
+		<testclass classname="setMixWithSystem" name="setMixWithSystem" time="0.000">
+		</testclass>
+		<testclass classname="setOrientation" name="setOrientation" time="0.000">
+		</testclass>
+		<testclass classname="setPosition" name="setPosition" time="0.000">
+		</testclass>
+		<testclass classname="setVelocity" name="setVelocity" time="0.000">
+		</testclass>
+		<testclass classname="setVolume" name="setVolume" time="0.000">
+		</testclass>
+		<testclass classname="stop" name="stop" time="0.001">
+		</testclass>
+	</testsuite>
+	<testsuite name="love.data" tests="7" failures="0" skipped="3" time="0.001">
+		<testclass classname="compress" name="compress" time="0.000">
+		</testclass>
+		<testclass classname="decode" name="decode" time="0.000">
+		</testclass>
+		<testclass classname="decompress" name="decompress" time="0.000">
+		</testclass>
+		<testclass classname="encode" name="encode" time="0.000">
+		</testclass>
+		<testclass classname="getPackedSize" name="getPackedSize" time="0.000">
+		</testclass>
+		<testclass classname="hash" name="hash" time="0.000">
+		</testclass>
+		<testclass classname="newByteData" name="newByteData" time="0.000">
+		</testclass>
+		<testclass classname="newDataView" name="newDataView" time="0.000">
+		</testclass>
+		<testclass classname="pack" name="pack" time="0.000">
+		</testclass>
+		<testclass classname="unpack" name="unpack" time="0.000">
+		</testclass>
+	</testsuite>
+	<testsuite name="love.event" tests="4" failures="0" skipped="2" time="0.000">
+		<testclass classname="clear" name="clear" time="0.000">
+		</testclass>
+		<testclass classname="poll" name="poll" time="0.000">
+		</testclass>
+		<testclass classname="pump" name="pump" time="0.000">
+		</testclass>
+		<testclass classname="push" name="push" time="0.000">
+		</testclass>
+		<testclass classname="quit" name="quit" time="0.000">
+		</testclass>
+		<testclass classname="wait" name="wait" time="0.000">
+		</testclass>
+	</testsuite>
+	<testsuite name="love.filesystem" tests="27" failures="0" skipped="2" time="0.018">
+		<testclass classname="append" name="append" time="0.002">
+		</testclass>
+		<testclass classname="areSymlinksEnabled" name="areSymlinksEnabled" time="0.000">
+		</testclass>
+		<testclass classname="createDirectory" name="createDirectory" time="0.001">
+		</testclass>
+		<testclass classname="getAppdataDirectory" name="getAppdataDirectory" time="0.000">
+		</testclass>
+		<testclass classname="getCRequirePath" name="getCRequirePath" time="0.000">
+		</testclass>
+		<testclass classname="getDirectoryItems" name="getDirectoryItems" time="0.002">
+		</testclass>
+		<testclass classname="getIdentity" name="getIdentity" time="0.000">
+		</testclass>
+		<testclass classname="getInfo" name="getInfo" time="0.002">
+		</testclass>
+		<testclass classname="getRealDirectory" name="getRealDirectory" time="0.001">
+		</testclass>
+		<testclass classname="getRequirePath" name="getRequirePath" time="0.000">
+		</testclass>
+		<testclass classname="getSaveDirectory" name="getSaveDirectory" time="0.000">
+		</testclass>
+		<testclass classname="getSource" name="getSource" time="0.000">
+		</testclass>
+		<testclass classname="getSourceBaseDirectory" name="getSourceBaseDirectory" time="0.000">
+		</testclass>
+		<testclass classname="getUserDirectory" name="getUserDirectory" time="0.000">
+		</testclass>
+		<testclass classname="getWorkingDirectory" name="getWorkingDirectory" time="0.000">
+		</testclass>
+		<testclass classname="isFused" name="isFused" time="0.000">
+		</testclass>
+		<testclass classname="lines" name="lines" time="0.001">
+		</testclass>
+		<testclass classname="load" name="load" time="0.001">
+		</testclass>
+		<testclass classname="mount" name="mount" time="0.002">
+		</testclass>
+		<testclass classname="newFileData" name="newFileData" time="0.000">
+		</testclass>
+		<testclass classname="openFile" name="openFile" time="0.000">
+		</testclass>
+		<testclass classname="read" name="read" time="0.000">
+		</testclass>
+		<testclass classname="remove" name="remove" time="0.002">
+		</testclass>
+		<testclass classname="setCRequirePath" name="setCRequirePath" time="0.000">
+		</testclass>
+		<testclass classname="setIdentity" name="setIdentity" time="0.000">
+		</testclass>
+		<testclass classname="setRequirePath" name="setRequirePath" time="0.000">
+		</testclass>
+		<testclass classname="setSource" name="setSource" time="0.000">
+		</testclass>
+		<testclass classname="unmount" name="unmount" time="0.002">
+		</testclass>
+		<testclass classname="write" name="write" time="0.002">
+		</testclass>
+	</testsuite>
+	<testsuite name="love.font" tests="4" failures="0" skipped="1" time="0.002">
+		<testclass classname="newBMFontRasterizer" name="newBMFontRasterizer" time="0.000">
+		</testclass>
+		<testclass classname="newGlyphData" name="newGlyphData" time="0.001">
+		</testclass>
+		<testclass classname="newImageRasterizer" name="newImageRasterizer" time="0.000">
+		</testclass>
+		<testclass classname="newRasterizer" name="newRasterizer" time="0.000">
+		</testclass>
+		<testclass classname="newTrueTypeRasterizer" name="newTrueTypeRasterizer" time="0.000">
+		</testclass>
+	</testsuite>
+	<testsuite name="love.graphics" tests="65" failures="0" skipped="31" time="0.079">
+		<testclass classname="applyTransform" name="applyTransform" time="0.002">
+		</testclass>
+		<testclass classname="arc" name="arc" time="0.000">
+		</testclass>
+		<testclass classname="captureScreenshot" name="captureScreenshot" time="0.000">
+		</testclass>
+		<testclass classname="circle" name="circle" time="0.000">
+		</testclass>
+		<testclass classname="clear" name="clear" time="0.000">
+		</testclass>
+		<testclass classname="discard" name="discard" time="0.000">
+		</testclass>
+		<testclass classname="draw" name="draw" time="0.000">
+		</testclass>
+		<testclass classname="drawInstanced" name="drawInstanced" time="0.000">
+		</testclass>
+		<testclass classname="drawLayer" name="drawLayer" time="0.000">
+		</testclass>
+		<testclass classname="ellipse" name="ellipse" time="0.000">
+		</testclass>
+		<testclass classname="flushBatch" name="flushBatch" time="0.000">
+		</testclass>
+		<testclass classname="getBackgroundColor" name="getBackgroundColor" time="0.000">
+		</testclass>
+		<testclass classname="getBlendMode" name="getBlendMode" time="0.000">
+		</testclass>
+		<testclass classname="getCanvas" name="getCanvas" time="0.000">
+		</testclass>
+		<testclass classname="getColor" name="getColor" time="0.000">
+		</testclass>
+		<testclass classname="getColorMask" name="getColorMask" time="0.000">
+		</testclass>
+		<testclass classname="getDPIScale" name="getDPIScale" time="0.000">
+		</testclass>
+		<testclass classname="getDefaultFilter" name="getDefaultFilter" time="0.000">
+		</testclass>
+		<testclass classname="getDepthMode" name="getDepthMode" time="0.000">
+		</testclass>
+		<testclass classname="getDimensions" name="getDimensions" time="0.000">
+		</testclass>
+		<testclass classname="getFont" name="getFont" time="0.001">
+		</testclass>
+		<testclass classname="getFrontFaceWinding" name="getFrontFaceWinding" time="0.000">
+		</testclass>
+		<testclass classname="getHeight" name="getHeight" time="0.000">
+		</testclass>
+		<testclass classname="getLineJoin" name="getLineJoin" time="0.000">
+		</testclass>
+		<testclass classname="getLineStyle" name="getLineStyle" time="0.000">
+		</testclass>
+		<testclass classname="getLineWidth" name="getLineWidth" time="0.000">
+		</testclass>
+		<testclass classname="getMeshCullMode" name="getMeshCullMode" time="0.000">
+		</testclass>
+		<testclass classname="getPixelDimensions" name="getPixelDimensions" time="0.000">
+		</testclass>
+		<testclass classname="getPixelHeight" name="getPixelHeight" time="0.000">
+		</testclass>
+		<testclass classname="getPixelWidth" name="getPixelWidth" time="0.000">
+		</testclass>
+		<testclass classname="getPointSize" name="getPointSize" time="0.000">
+		</testclass>
+		<testclass classname="getRendererInfo" name="getRendererInfo" time="0.000">
+		</testclass>
+		<testclass classname="getScissor" name="getScissor" time="0.000">
+		</testclass>
+		<testclass classname="getShader" name="getShader" time="0.000">
+		</testclass>
+		<testclass classname="getStackDepth" name="getStackDepth" time="0.000">
+		</testclass>
+		<testclass classname="getStats" name="getStats" time="0.000">
+		</testclass>
+		<testclass classname="getStencilMode" name="getStencilMode" time="0.000">
+		</testclass>
+		<testclass classname="getSupported" name="getSupported" time="0.000">
+		</testclass>
+		<testclass classname="getSystemLimits" name="getSystemLimits" time="0.000">
+		</testclass>
+		<testclass classname="getTextureFormats" name="getTextureFormats" time="0.001">
+		</testclass>
+		<testclass classname="getTextureTypes" name="getTextureTypes" time="0.000">
+		</testclass>
+		<testclass classname="getWidth" name="getWidth" time="0.000">
+		</testclass>
+		<testclass classname="intersectScissor" name="intersectScissor" time="0.003">
+		</testclass>
+		<testclass classname="inverseTransformPoint" name="inverseTransformPoint" time="0.000">
+		</testclass>
+		<testclass classname="isActive" name="isActive" time="0.000">
+		</testclass>
+		<testclass classname="isGammaCorrect" name="isGammaCorrect" time="0.000">
+		</testclass>
+		<testclass classname="isWireframe" name="isWireframe" time="0.000">
+		</testclass>
+		<testclass classname="line" name="line" time="0.000">
+		</testclass>
+		<testclass classname="newArrayImage" name="newArrayImage" time="0.002">
+		</testclass>
+		<testclass classname="newCanvas" name="newCanvas" time="0.001">
+		</testclass>
+		<testclass classname="newCubeImage" name="newCubeImage" time="0.003">
+		</testclass>
+		<testclass classname="newFont" name="newFont" time="0.001">
+		</testclass>
+		<testclass classname="newImage" name="newImage" time="0.001">
+		</testclass>
+		<testclass classname="newImageFont" name="newImageFont" time="0.001">
+		</testclass>
+		<testclass classname="newMesh" name="newMesh" time="0.000">
+		</testclass>
+		<testclass classname="newParticleSystem" name="newParticleSystem" time="0.002">
+		</testclass>
+		<testclass classname="newQuad" name="newQuad" time="0.002">
+		</testclass>
+		<testclass classname="newShader" name="newShader" time="0.015">
+		</testclass>
+		<testclass classname="newSpriteBatch" name="newSpriteBatch" time="0.001">
+		</testclass>
+		<testclass classname="newTextBatch" name="newTextBatch" time="0.002">
+		</testclass>
+		<testclass classname="newVideo" name="newVideo" time="0.004">
+		</testclass>
+		<testclass classname="newVolumeImage" name="newVolumeImage" time="0.001">
+		</testclass>
+		<testclass classname="origin" name="origin" time="0.000">
+		</testclass>
+		<testclass classname="points" name="points" time="0.000">
+		</testclass>
+		<testclass classname="polygon" name="polygon" time="0.000">
+		</testclass>
+		<testclass classname="pop" name="pop" time="0.001">
+		</testclass>
+		<testclass classname="present" name="present" time="0.000">
+		</testclass>
+		<testclass classname="print" name="print" time="0.000">
+		</testclass>
+		<testclass classname="printf" name="printf" time="0.000">
+		</testclass>
+		<testclass classname="push" name="push" time="0.002">
+		</testclass>
+		<testclass classname="rectangle" name="rectangle" time="0.007">
+		</testclass>
+		<testclass classname="replaceTransform" name="replaceTransform" time="0.002">
+		</testclass>
+		<testclass classname="reset" name="reset" time="0.001">
+		</testclass>
+		<testclass classname="rotate" name="rotate" time="0.004">
+		</testclass>
+		<testclass classname="scale" name="scale" time="0.002">
+		</testclass>
+		<testclass classname="setBackgroundColor" name="setBackgroundColor" time="0.000">
+		</testclass>
+		<testclass classname="setBlendMode" name="setBlendMode" time="0.001">
+		</testclass>
+		<testclass classname="setCanvas" name="setCanvas" time="0.000">
+		</testclass>
+		<testclass classname="setColor" name="setColor" time="0.000">
+		</testclass>
+		<testclass classname="setColorMask" name="setColorMask" time="0.000">
+		</testclass>
+		<testclass classname="setDefaultFilter" name="setDefaultFilter" time="0.000">
+		</testclass>
+		<testclass classname="setDepthMode" name="setDepthMode" time="0.000">
+		</testclass>
+		<testclass classname="setFont" name="setFont" time="0.000">
+		</testclass>
+		<testclass classname="setFrontFaceWinding" name="setFrontFaceWinding" time="0.000">
+		</testclass>
+		<testclass classname="setLineJoin" name="setLineJoin" time="0.000">
+		</testclass>
+		<testclass classname="setLineStyle" name="setLineStyle" time="0.000">
+		</testclass>
+		<testclass classname="setLineWidth" name="setLineWidth" time="0.000">
+		</testclass>
+		<testclass classname="setMeshCullMode" name="setMeshCullMode" time="0.000">
+		</testclass>
+		<testclass classname="setScissor" name="setScissor" time="0.000">
+		</testclass>
+		<testclass classname="setShader" name="setShader" time="0.000">
+		</testclass>
+		<testclass classname="setStencilMode" name="setStencilMode" time="0.000">
+		</testclass>
+		<testclass classname="setWireframe" name="setWireframe" time="0.000">
+		</testclass>
+		<testclass classname="shear" name="shear" time="0.002">
+		</testclass>
+		<testclass classname="transformPoint" name="transformPoint" time="0.000">
+		</testclass>
+		<testclass classname="translate" name="translate" time="0.001">
+		</testclass>
+		<testclass classname="validateShader" name="validateShader" time="0.010">
+		</testclass>
+	</testsuite>
+	<testsuite name="love.image" tests="3" failures="0" skipped="0" time="0.002">
+		<testclass classname="isCompressed" name="isCompressed" time="0.001">
+		</testclass>
+		<testclass classname="newCompressedData" name="newCompressedData" time="0.001">
+		</testclass>
+		<testclass classname="newImageData" name="newImageData" time="0.000">
+		</testclass>
+	</testsuite>
+	<testsuite name="love.math" tests="17" failures="0" skipped="0" time="0.003">
+		<testclass classname="colorFromBytes" name="colorFromBytes" time="0.000">
+		</testclass>
+		<testclass classname="colorToBytes" name="colorToBytes" time="0.001">
+		</testclass>
+		<testclass classname="gammaToLinear" name="gammaToLinear" time="0.000">
+		</testclass>
+		<testclass classname="getRandomSeed" name="getRandomSeed" time="0.000">
+		</testclass>
+		<testclass classname="getRandomState" name="getRandomState" time="0.000">
+		</testclass>
+		<testclass classname="isConvex" name="isConvex" time="0.000">
+		</testclass>
+		<testclass classname="linearToGamma" name="linearToGamma" time="0.000">
+		</testclass>
+		<testclass classname="newBezierCurve" name="newBezierCurve" time="0.000">
+		</testclass>
+		<testclass classname="newRandomGenerator" name="newRandomGenerator" time="0.000">
+		</testclass>
+		<testclass classname="newTransform" name="newTransform" time="0.000">
+		</testclass>
+		<testclass classname="perlinNoise" name="perlinNoise" time="0.000">
+		</testclass>
+		<testclass classname="random" name="random" time="0.000">
+		</testclass>
+		<testclass classname="randomNormal" name="randomNormal" time="0.000">
+		</testclass>
+		<testclass classname="setRandomSeed" name="setRandomSeed" time="0.000">
+		</testclass>
+		<testclass classname="setRandomState" name="setRandomState" time="0.000">
+		</testclass>
+		<testclass classname="simplexNoise" name="simplexNoise" time="0.000">
+		</testclass>
+		<testclass classname="triangulate" name="triangulate" time="0.000">
+		</testclass>
+	</testsuite>
+	<testsuite name="love.objects" tests="1" failures="0" skipped="0" time="0.008">
+		<testclass classname="File" name="File" time="0.008">
+		</testclass>
+	</testsuite>
+	<testsuite name="love.physics" tests="22" failures="0" skipped="0" time="0.005">
+		<testclass classname="getDistance" name="getDistance" time="0.000">
+		</testclass>
+		<testclass classname="getMeter" name="getMeter" time="0.000">
+		</testclass>
+		<testclass classname="newBody" name="newBody" time="0.000">
+		</testclass>
+		<testclass classname="newChainShape" name="newChainShape" time="0.000">
+		</testclass>
+		<testclass classname="newCircleShape" name="newCircleShape" time="0.000">
+		</testclass>
+		<testclass classname="newDistanceJoint" name="newDistanceJoint" time="0.000">
+		</testclass>
+		<testclass classname="newEdgeShape" name="newEdgeShape" time="0.000">
+		</testclass>
+		<testclass classname="newFixture" name="newFixture" time="0.000">
+		</testclass>
+		<testclass classname="newFrictionJoint" name="newFrictionJoint" time="0.000">
+		</testclass>
+		<testclass classname="newGearJoint" name="newGearJoint" time="0.000">
+		</testclass>
+		<testclass classname="newMotorJoint" name="newMotorJoint" time="0.000">
+		</testclass>
+		<testclass classname="newMouseJoint" name="newMouseJoint" time="0.000">
+		</testclass>
+		<testclass classname="newPolygonShape" name="newPolygonShape" time="0.000">
+		</testclass>
+		<testclass classname="newPrismaticJoint" name="newPrismaticJoint" time="0.000">
+		</testclass>
+		<testclass classname="newPulleyJoint" name="newPulleyJoint" time="0.000">
+		</testclass>
+		<testclass classname="newRectangleShape" name="newRectangleShape" time="0.001">
+		</testclass>
+		<testclass classname="newRevoluteJoint" name="newRevoluteJoint" time="0.000">
+		</testclass>
+		<testclass classname="newRopeJoint" name="newRopeJoint" time="0.000">
+		</testclass>
+		<testclass classname="newWeldJoint" name="newWeldJoint" time="0.000">
+		</testclass>
+		<testclass classname="newWheelJoint" name="newWheelJoint" time="0.001">
+		</testclass>
+		<testclass classname="newWorld" name="newWorld" time="0.000">
+		</testclass>
+		<testclass classname="setMeter" name="setMeter" time="0.000">
+		</testclass>
+	</testsuite>
+	<testsuite name="love.sound" tests="2" failures="0" skipped="0" time="0.004">
+		<testclass classname="newDecoder" name="newDecoder" time="0.001">
+		</testclass>
+		<testclass classname="newSoundData" name="newSoundData" time="0.003">
+		</testclass>
+	</testsuite>
+	<testsuite name="love.system" tests="6" failures="0" skipped="2" time="0.007">
+		<testclass classname="getClipboardText" name="getClipboardText" time="0.006">
+		</testclass>
+		<testclass classname="getOS" name="getOS" time="0.000">
+		</testclass>
+		<testclass classname="getPowerInfo" name="getPowerInfo" time="0.000">
+		</testclass>
+		<testclass classname="getProcessorCount" name="getProcessorCount" time="0.000">
+		</testclass>
+		<testclass classname="hasBackgroundMusic" name="hasBackgroundMusic" time="0.000">
+		</testclass>
+		<testclass classname="openURL" name="openURL" time="0.000">
+		</testclass>
+		<testclass classname="setClipboardText" name="setClipboardText" time="0.001">
+		</testclass>
+		<testclass classname="vibrate" name="vibrate" time="0.000">
+		</testclass>
+	</testsuite>
+	<testsuite name="love.thread" tests="3" failures="0" skipped="0" time="0.002">
+		<testclass classname="getChannel" name="getChannel" time="0.000">
+		</testclass>
+		<testclass classname="newChannel" name="newChannel" time="0.000">
+		</testclass>
+		<testclass classname="newThread" name="newThread" time="0.001">
+		</testclass>
+	</testsuite>
+	<testsuite name="love.timer" tests="6" failures="0" skipped="0" time="2.002">
+		<testclass classname="getAverageDelta" name="getAverageDelta" time="0.000">
+		</testclass>
+		<testclass classname="getDelta" name="getDelta" time="0.000">
+		</testclass>
+		<testclass classname="getFPS" name="getFPS" time="0.000">
+		</testclass>
+		<testclass classname="getTime" name="getTime" time="1.001">
+		</testclass>
+		<testclass classname="sleep" name="sleep" time="1.001">
+		</testclass>
+		<testclass classname="step" name="step" time="0.000">
+		</testclass>
+	</testsuite>
+	<testsuite name="love.video" tests="1" failures="0" skipped="0" time="0.005">
+		<testclass classname="newVideoStream" name="newVideoStream" time="0.005">
+		</testclass>
+	</testsuite>
+	<testsuite name="love.window" tests="32" failures="2" skipped="2" time="5.419">
+		<testclass classname="close" name="close" time="0.037">
+		</testclass>
+		<testclass classname="fromPixels" name="fromPixels" time="0.000">
+		</testclass>
+		<testclass classname="getDPIScale" name="getDPIScale" time="0.000">
+		</testclass>
+		<testclass classname="getDesktopDimensions" name="getDesktopDimensions" time="0.000">
+		</testclass>
+		<testclass classname="getDisplayCount" name="getDisplayCount" time="0.000">
+		</testclass>
+		<testclass classname="getDisplayName" name="getDisplayName" time="0.000">
+		</testclass>
+		<testclass classname="getDisplayOrientation" name="getDisplayOrientation" time="0.000">
+		</testclass>
+		<testclass classname="getFullscreen" name="getFullscreen" time="1.347">
+		</testclass>
+		<testclass classname="getFullscreenModes" name="getFullscreenModes" time="0.001">
+		</testclass>
+		<testclass classname="getIcon" name="getIcon" time="0.004">
+		</testclass>
+		<testclass classname="getMode" name="getMode" time="0.000">
+		</testclass>
+		<testclass classname="getPosition" name="getPosition" time="0.001">
+		</testclass>
+		<testclass classname="getSafeArea" name="getSafeArea" time="0.000">
+		</testclass>
+		<testclass classname="getTitle" name="getTitle" time="0.001">
+		</testclass>
+		<testclass classname="getVSync" name="getVSync" time="0.000">
+		</testclass>
+		<testclass classname="hasFocus" name="hasFocus" time="0.000">
+		</testclass>
+		<testclass classname="hasMouseFocus" name="hasMouseFocus" time="0.000">
+		</testclass>
+		<testclass classname="isDisplaySleepEnabled" name="isDisplaySleepEnabled" time="0.000">
+		</testclass>
+		<testclass classname="isMaximized" name="isMaximized" time="0.640">
+			<failure message="assert #2 [check window not maximized] expected 'true' got 'false'"></failure>
+		</testclass>
+		<testclass classname="isMinimized" name="isMinimized" time="0.645">
+		</testclass>
+		<testclass classname="isOpen" name="isOpen" time="0.036">
+		</testclass>
+		<testclass classname="isVisible" name="isVisible" time="0.031">
+		</testclass>
+		<testclass classname="maximize" name="maximize" time="0.000">
+			<failure message="assert #1 [check window maximized] expected 'true' got 'false'"></failure>
+		</testclass>
+		<testclass classname="minimize" name="minimize" time="0.646">
+		</testclass>
+		<testclass classname="requestAttention" name="requestAttention" time="0.000">
+		</testclass>
+		<testclass classname="restore" name="restore" time="0.642">
+		</testclass>
+		<testclass classname="setDisplaySleepEnabled" name="setDisplaySleepEnabled" time="0.000">
+		</testclass>
+		<testclass classname="setFullscreen" name="setFullscreen" time="1.370">
+		</testclass>
+		<testclass classname="setIcon" name="setIcon" time="0.002">
+		</testclass>
+		<testclass classname="setMode" name="setMode" time="0.008">
+		</testclass>
+		<testclass classname="setPosition" name="setPosition" time="0.001">
+		</testclass>
+		<testclass classname="setTitle" name="setTitle" time="0.000">
+		</testclass>
+		<testclass classname="setVSync" name="setVSync" time="0.000">
+		</testclass>
+		<testclass classname="showMessageBox" name="showMessageBox" time="0.000">
+		</testclass>
+		<testclass classname="toPixels" name="toPixels" time="0.000">
+		</testclass>
+		<testclass classname="updateMode" name="updateMode" time="0.006">
+		</testclass>
+	</testsuite>
+</testsuites>

+ 7 - 1
testing/main.lua

@@ -169,4 +169,10 @@ function UtilStringSplit(str, splitter)
     table.insert(splits, word)
     table.insert(splits, word)
   end
   end
   return splits
   return splits
-end
+end
+
+
+-- string time formatter
+function UtilTimeFormat(seconds)
+  return string.format("%.3f", tostring(seconds))
+end

File diff suppressed because it is too large
+ 0 - 0
testing/output/lovetest_runAllTests.html


+ 0 - 385
testing/output/lovetest_runAllTests.xml

@@ -1,385 +0,0 @@
-<testsuites name="love.test" tests="157" failures="5" skipped="11" time="7341.71">
-	<testsuite name="love.audio" tests="26" failures="0" skipped="0" time="0.40991666666712">
-		<testclass classname="getActiveEffects" name="getActiveEffects" time="0.045083333333418">
-		</testclass>
-		<testclass classname="getActiveSourceCount" name="getActiveSourceCount" time="1.1385">
-		</testclass>
-		<testclass classname="getDistanceModel" name="getDistanceModel" time="0.018125000000202">
-		</testclass>
-		<testclass classname="getDopplerScale" name="getDopplerScale" time="0.012208333333374">
-		</testclass>
-		<testclass classname="getEffect" name="getEffect" time="0.035250000000042">
-		</testclass>
-		<testclass classname="getMaxSceneEffects" name="getMaxSceneEffects" time="0.0089583333331422">
-		</testclass>
-		<testclass classname="getMaxSourceEffects" name="getMaxSourceEffects" time="0.022874999999978">
-		</testclass>
-		<testclass classname="getOrientation" name="getOrientation" time="0.037541666666696">
-		</testclass>
-		<testclass classname="getPosition" name="getPosition" time="0.024500000000316">
-		</testclass>
-		<testclass classname="getRecordingDevices" name="getRecordingDevices" time="0.039250000000157">
-		</testclass>
-		<testclass classname="getVelocity" name="getVelocity" time="0.021333333333207">
-		</testclass>
-		<testclass classname="getVolume" name="getVolume" time="0.046083333333335">
-		</testclass>
-		<testclass classname="isEffectsSupported" name="isEffectsSupported" time="0.016749999999899">
-		</testclass>
-		<testclass classname="newQueueableSource" name="newQueueableSource" time="0.041958333333314">
-		</testclass>
-		<testclass classname="newSource" name="newSource" time="2.8378333333332">
-		</testclass>
-		<testclass classname="pause" name="pause" time="2.6265416666664">
-		</testclass>
-		<testclass classname="play" name="play" time="1.7924166666665">
-		</testclass>
-		<testclass classname="setDistanceModel" name="setDistanceModel" time="0.023249999999919">
-		</testclass>
-		<testclass classname="setDopplerScale" name="setDopplerScale" time="0.094375000000646">
-		</testclass>
-		<testclass classname="setEffect" name="setEffect" time="0.024166666666936">
-		</testclass>
-		<testclass classname="setMixWithSystem" name="setMixWithSystem" time="0.0052083333330621">
-		</testclass>
-		<testclass classname="setOrientation" name="setOrientation" time="0.017000000000156">
-		</testclass>
-		<testclass classname="setPosition" name="setPosition" time="0.0091666666666157">
-		</testclass>
-		<testclass classname="setVelocity" name="setVelocity" time="0.0070416666657636">
-		</testclass>
-		<testclass classname="setVolume" name="setVolume" time="0.0075833333332831">
-		</testclass>
-		<testclass classname="stop" name="stop" time="1.787666666667">
-		</testclass>
-	</testsuite>
-	<testsuite name="love.data" tests="7" failures="0" skipped="3" time="0.34008333333449">
-		<testclass classname="compress" name="compress" time="0.39495833333403">
-		</testclass>
-		<testclass classname="decode" name="decode" time="0.027791666666666">
-		</testclass>
-		<testclass classname="decompress" name="decompress" time="0.28366666666635">
-		</testclass>
-		<testclass classname="encode" name="encode" time="0.044000000000377">
-		</testclass>
-		<testclass classname="getPackedSize" name="getPackedSize" time="0.0069999999996462">
-		</testclass>
-		<testclass classname="hash" name="hash" time="0.12045833333341">
-		</testclass>
-		<testclass classname="newByteData" name="newByteData" time="0.021916666666844">
-		</testclass>
-		<testclass classname="newDataView" name="newDataView" time="0.025416666666889">
-		</testclass>
-		<testclass classname="pack" name="pack" time="0.0070833333332132">
-		</testclass>
-		<testclass classname="unpack" name="unpack" time="0.0091250000000542">
-		</testclass>
-	</testsuite>
-	<testsuite name="love.event" tests="4" failures="0" skipped="2" time="0.47999999999884">
-		<testclass classname="clear" name="clear" time="0.028666666666233">
-		</testclass>
-		<testclass classname="poll" name="poll" time="0.022374999999464">
-		</testclass>
-		<testclass classname="pump" name="pump" time="0.0079583333327804">
-		</testclass>
-		<testclass classname="push" name="push" time="0.022500000000036">
-		</testclass>
-		<testclass classname="quit" name="quit" time="0.014125000000753">
-		</testclass>
-		<testclass classname="wait" name="wait" time="0.0069166666669673">
-		</testclass>
-	</testsuite>
-	<testsuite name="love.filesystem" tests="26" failures="1" skipped="2" time="1.0150000000023">
-		<testclass classname="append" name="append" time="1.3135833333333">
-		</testclass>
-		<testclass classname="areSymlinksEnabled" name="areSymlinksEnabled" time="0.01433333333356">
-		</testclass>
-		<testclass classname="createDirectory" name="createDirectory" time="0.39929166666663">
-		</testclass>
-		<testclass classname="getAppdataDirectory" name="getAppdataDirectory" time="0.014166666668203">
-		</testclass>
-		<testclass classname="getCRequirePath" name="getCRequirePath" time="0.015749999999315">
-		</testclass>
-		<testclass classname="getDirectoryItems" name="getDirectoryItems" time="1.0962083333332">
-		</testclass>
-		<testclass classname="getIdentity" name="getIdentity" time="0.10579166666691">
-		</testclass>
-		<testclass classname="getInfo" name="getInfo" time="0.9892916666665">
-		</testclass>
-		<testclass classname="getRealDirectory" name="getRealDirectory" time="0.98024999999957">
-		</testclass>
-		<testclass classname="getRequirePath" name="getRequirePath" time="0.097583333333873">
-		</testclass>
-		<testclass classname="getSaveDirectory" name="getSaveDirectory" time="0.01891666666598">
-		</testclass>
-		<testclass classname="getSource" name="getSource" time="0.020666666666003">
-		</testclass>
-		<testclass classname="getSourceBaseDirectory" name="getSourceBaseDirectory" time="0.015083333334331">
-		</testclass>
-		<testclass classname="getUserDirectory" name="getUserDirectory" time="0.043666666666553">
-		</testclass>
-		<testclass classname="getWorkingDirectory" name="getWorkingDirectory" time="0.018791666667184">
-		</testclass>
-		<testclass classname="isFused" name="isFused" time="0.017999999998963">
-		</testclass>
-		<testclass classname="lines" name="lines" time="13.630166666666">
-		</testclass>
-		<testclass classname="load" name="load" time="7.9870833333331">
-		</testclass>
-		<testclass classname="mount" name="mount" time="0.48216666666789">
-		</testclass>
-		<testclass classname="newFile" name="newFile" time="0.37395833333331">
-			<failure message="assert #2 [check file made] avoiding 'nil' got 'nil'"></failure>
-		</testclass>
-		<testclass classname="newFileData" name="newFileData" time="0.030666666666512">
-		</testclass>
-		<testclass classname="read" name="read" time="0.19545833333368">
-		</testclass>
-		<testclass classname="remove" name="remove" time="0.81487500000055">
-		</testclass>
-		<testclass classname="setCRequirePath" name="setCRequirePath" time="0.017416666667103">
-		</testclass>
-		<testclass classname="setIdentity" name="setIdentity" time="0.086666666666346">
-		</testclass>
-		<testclass classname="setRequirePath" name="setRequirePath" time="0.014500000001583">
-		</testclass>
-		<testclass classname="setSource" name="setSource" time="0.0082916666652721">
-		</testclass>
-		<testclass classname="unmount" name="unmount" time="1.1363333333341">
-		</testclass>
-		<testclass classname="write" name="write" time="1.0965416666666">
-		</testclass>
-	</testsuite>
-	<testsuite name="love.font" tests="4" failures="0" skipped="1" time="0.11233333333444">
-		<testclass classname="newBMFontRasterizer" name="newBMFontRasterizer" time="0.007625000002065">
-		</testclass>
-		<testclass classname="newGlyphData" name="newGlyphData" time="0.28787499999972">
-		</testclass>
-		<testclass classname="newImageRasterizer" name="newImageRasterizer" time="0.22408333333424">
-		</testclass>
-		<testclass classname="newRasterizer" name="newRasterizer" time="0.18954166666596">
-		</testclass>
-		<testclass classname="newTrueTypeRasterizer" name="newTrueTypeRasterizer" time="0.18991666666501">
-		</testclass>
-	</testsuite>
-	<testsuite name="love.graphics" tests="0" failures="1" skipped="0" time="0.94387500000009">
-		<testclass classname="rectangle" name="rectangle" time="3.7313333333344">
-			<failure message="assert #2 [check 0x,0y G] expected '1' got '0'"></failure>
-		</testclass>
-	</testsuite>
-	<testsuite name="love.image" tests="3" failures="0" skipped="0" time="1.2476249999999">
-		<testclass classname="isCompressed" name="isCompressed" time="0.21679166666644">
-		</testclass>
-		<testclass classname="newCompressedData" name="newCompressedData" time="0.19920833333309">
-		</testclass>
-		<testclass classname="newImageData" name="newImageData" time="0.40049999999958">
-		</testclass>
-	</testsuite>
-	<testsuite name="love.math" tests="16" failures="0" skipped="0" time="0.062999999998231">
-		<testclass classname="colorFromBytes" name="colorFromBytes" time="0.29325000000036">
-		</testclass>
-		<testclass classname="colorToBytes" name="colorToBytes" time="0.27899999999903">
-		</testclass>
-		<testclass classname="gammaToLinear" name="gammaToLinear" time="0.021624999998693">
-		</testclass>
-		<testclass classname="getRandomSeed" name="getRandomSeed" time="0.014708333333502">
-		</testclass>
-		<testclass classname="getRandomState" name="getRandomState" time="0.071791666666599">
-		</testclass>
-		<testclass classname="isConvex" name="isConvex" time="0.056666666665706">
-		</testclass>
-		<testclass classname="linearToGamma" name="linearToGamma" time="0.01791666666584">
-		</testclass>
-		<testclass classname="newBezierCurve" name="newBezierCurve" time="0.053125000000875">
-		</testclass>
-		<testclass classname="newRandomGenerator" name="newRandomGenerator" time="0.019874999999558">
-		</testclass>
-		<testclass classname="newTransform" name="newTransform" time="0.02287499999909">
-		</testclass>
-		<testclass classname="noise" name="noise" time="0.076916666666094">
-		</testclass>
-		<testclass classname="random" name="random" time="0.17783333333377">
-		</testclass>
-		<testclass classname="randomNormal" name="randomNormal" time="0.020458333334972">
-		</testclass>
-		<testclass classname="setRandomSeed" name="setRandomSeed" time="0.019541666667067">
-		</testclass>
-		<testclass classname="setRandomState" name="setRandomState" time="0.053750000001074">
-		</testclass>
-		<testclass classname="triangulate" name="triangulate" time="0.023874999998341">
-		</testclass>
-	</testsuite>
-	<testsuite name="love.objects" tests="0" failures="0" skipped="0" time="1.6546249999983">
-	</testsuite>
-	<testsuite name="love.physics" tests="21" failures="1" skipped="0" time="0.014583333332624">
-		<testclass classname="getDistance" name="getDistance" time="0.075333333334981">
-		</testclass>
-		<testclass classname="getMeter" name="getMeter" time="0.015125000000893">
-		</testclass>
-		<testclass classname="newBody" name="newBody" time="0.03362500000037">
-		</testclass>
-		<testclass classname="newChainShape" name="newChainShape" time="0.028624999998783">
-		</testclass>
-		<testclass classname="newCircleShape" name="newCircleShape" time="0.020624999999441">
-		</testclass>
-		<testclass classname="newDistanceJoint" name="newDistanceJoint" time="0.037833333333737">
-		</testclass>
-		<testclass classname="newEdgeShape" name="newEdgeShape" time="0.020624999999441">
-		</testclass>
-		<testclass classname="newFixture" name="newFixture" time="0.077750000000876">
-		</testclass>
-		<testclass classname="newFrictionJoint" name="newFrictionJoint" time="0.031708333333214">
-		</testclass>
-		<testclass classname="newGearJoint" name="newGearJoint" time="0.12670833333139">
-			<failure message="test tests/physics.lua:134: Box2D assertion failed: m_bodyA->m_type == b2_dynamicBody"></failure>
-		</testclass>
-		<testclass classname="newMotorJoint" name="newMotorJoint" time="0.092416666667816">
-		</testclass>
-		<testclass classname="newMouseJoint" name="newMouseJoint" time="0.050208333334467">
-		</testclass>
-		<testclass classname="newPolygonShape" name="newPolygonShape" time="0.025333333333322">
-		</testclass>
-		<testclass classname="newPrismaticJoint" name="newPrismaticJoint" time="0.034124999999108">
-		</testclass>
-		<testclass classname="newPulleyJoint" name="newPulleyJoint" time="0.035041666665236">
-		</testclass>
-		<testclass classname="newRectangleShape" name="newRectangleShape" time="0.077833333332222">
-		</testclass>
-		<testclass classname="newRevoluteJoint" name="newRevoluteJoint" time="0.040416666667653">
-		</testclass>
-		<testclass classname="newRopeJoint" name="newRopeJoint" time="0.03037500000147">
-		</testclass>
-		<testclass classname="newWeldJoint" name="newWeldJoint" time="0.074916666664038">
-		</testclass>
-		<testclass classname="newWheelJoint" name="newWheelJoint" time="0.1102083333322">
-		</testclass>
-		<testclass classname="newWorld" name="newWorld" time="0.075416666666328">
-		</testclass>
-		<testclass classname="setMeter" name="setMeter" time="0.031208333336252">
-		</testclass>
-	</testsuite>
-	<testsuite name="love.sound" tests="2" failures="0" skipped="0" time="0.93524999999842">
-		<testclass classname="newDecoder" name="newDecoder" time="0.31383333333501">
-		</testclass>
-		<testclass classname="newSoundData" name="newSoundData" time="1.1787083333292">
-		</testclass>
-	</testsuite>
-	<testsuite name="love.system" tests="6" failures="0" skipped="2" time="1.3057500000059">
-		<testclass classname="getClipboardText" name="getClipboardText" time="1.6217916666665">
-		</testclass>
-		<testclass classname="getOS" name="getOS" time="0.034041666669538">
-		</testclass>
-		<testclass classname="getPowerInfo" name="getPowerInfo" time="0.080041666665309">
-		</testclass>
-		<testclass classname="getProcessorCount" name="getProcessorCount" time="0.017791666669709">
-		</testclass>
-		<testclass classname="hasBackgroundMusic" name="hasBackgroundMusic" time="0.086708333334684">
-		</testclass>
-		<testclass classname="openURL" name="openURL" time="0.016333333334728">
-		</testclass>
-		<testclass classname="setClipboardText" name="setClipboardText" time="0.59291666666716">
-		</testclass>
-		<testclass classname="vibrate" name="vibrate" time="0.0090416666651549">
-		</testclass>
-	</testsuite>
-	<testsuite name="love.thread" tests="3" failures="0" skipped="0" time="0.96195833333323">
-		<testclass classname="getChannel" name="getChannel" time="0.47320833333231">
-		</testclass>
-		<testclass classname="newChannel" name="newChannel" time="0.028374999999414">
-		</testclass>
-		<testclass classname="newThread" name="newThread" time="0.2556250000012">
-		</testclass>
-	</testsuite>
-	<testsuite name="love.timer" tests="6" failures="0" skipped="0" time="3713.5796666667">
-		<testclass classname="getAverageDelta" name="getAverageDelta" time="0.023208333331581">
-		</testclass>
-		<testclass classname="getDelta" name="getDelta" time="0.015708333332753">
-		</testclass>
-		<testclass classname="getFPS" name="getFPS" time="0.011125000000334">
-		</testclass>
-		<testclass classname="getTime" name="getTime" time="1001.1531666667">
-		</testclass>
-		<testclass classname="sleep" name="sleep" time="1000.4330833333">
-		</testclass>
-		<testclass classname="step" name="step" time="0.032958333331834">
-		</testclass>
-	</testsuite>
-	<testsuite name="love.video" tests="1" failures="0" skipped="0" time="0.67754166666772">
-		<testclass classname="newVideoStream" name="newVideoStream" time="3.4201249999981">
-		</testclass>
-	</testsuite>
-	<testsuite name="love.window" tests="32" failures="2" skipped="1" time="7985.3964583333">
-		<testclass classname="close" name="close" time="11.641583333336">
-		</testclass>
-		<testclass classname="fromPixels" name="fromPixels" time="0.015333333330148">
-		</testclass>
-		<testclass classname="getDPIScale" name="getDPIScale" time="0.014499999998918">
-		</testclass>
-		<testclass classname="getDesktopDimensions" name="getDesktopDimensions" time="0.015083333330779">
-		</testclass>
-		<testclass classname="getDisplayCount" name="getDisplayCount" time="0.010291666665552">
-		</testclass>
-		<testclass classname="getDisplayName" name="getDisplayName" time="0.014875000001524">
-		</testclass>
-		<testclass classname="getDisplayOrientation" name="getDisplayOrientation" time="0.016250000001605">
-		</testclass>
-		<testclass classname="getFullscreen" name="getFullscreen" time="1305.7451666667">
-		</testclass>
-		<testclass classname="getFullscreenModes" name="getFullscreenModes" time="0.48033333332853">
-		</testclass>
-		<testclass classname="getIcon" name="getIcon" time="2.0577083333322">
-		</testclass>
-		<testclass classname="getMode" name="getMode" time="0.10416666667012">
-		</testclass>
-		<testclass classname="getPosition" name="getPosition" time="4.9660833333327">
-		</testclass>
-		<testclass classname="getSafeArea" name="getSafeArea" time="0.067875000002715">
-		</testclass>
-		<testclass classname="getTitle" name="getTitle" time="0.55745833333276">
-		</testclass>
-		<testclass classname="getVSync" name="getVSync" time="0.095124999997864">
-		</testclass>
-		<testclass classname="hasFocus" name="hasFocus" time="0.055624999998116">
-		</testclass>
-		<testclass classname="hasMouseFocus" name="hasMouseFocus" time="0.022541666666598">
-		</testclass>
-		<testclass classname="isDisplaySleepEnabled" name="isDisplaySleepEnabled" time="0.14775000000355">
-		</testclass>
-		<testclass classname="isMaximized" name="isMaximized" time="642.02083333333">
-			<failure message="assert #2 [check window not maximized] expected 'true' got 'false'"></failure>
-		</testclass>
-		<testclass classname="isMinimized" name="isMinimized" time="641.41475">
-		</testclass>
-		<testclass classname="isOpen" name="isOpen" time="25.519625000001">
-		</testclass>
-		<testclass classname="isVisible" name="isVisible" time="18.191791666666">
-		</testclass>
-		<testclass classname="maximize" name="maximize" time="0.23570833333508">
-			<failure message="assert #1 [check window maximized] expected 'true' got 'false'"></failure>
-		</testclass>
-		<testclass classname="minimize" name="minimize" time="640.26066666666">
-		</testclass>
-		<testclass classname="restore" name="restore" time="643.01916666667">
-		</testclass>
-		<testclass classname="setDisplaySleepEnabled" name="setDisplaySleepEnabled" time="0.59508333333014">
-		</testclass>
-		<testclass classname="setFullscreen" name="setFullscreen" time="1329.778375">
-		</testclass>
-		<testclass classname="setIcon" name="setIcon" time="2.0223750000028">
-		</testclass>
-		<testclass classname="setMode" name="setMode" time="4.5707499999992">
-		</testclass>
-		<testclass classname="setPosition" name="setPosition" time="0.16512499999521">
-		</testclass>
-		<testclass classname="setTitle" name="setTitle" time="0.47262500000045">
-		</testclass>
-		<testclass classname="setVSync" name="setVSync" time="0.022583333333159">
-		</testclass>
-		<testclass classname="showMessageBox" name="showMessageBox" time="0.068958333333313">
-		</testclass>
-		<testclass classname="toPixels" name="toPixels" time="0.067666666666355">
-		</testclass>
-		<testclass classname="updateMode" name="updateMode" time="6.8227083333348">
-		</testclass>
-	</testsuite>
-</testsuites>

+ 14 - 18
testing/readme.md

@@ -84,19 +84,22 @@ This is the status of all module tests currently.
 -- [x] audio        26 PASSED |  0 FAILED |  0 SKIPPED
 -- [x] audio        26 PASSED |  0 FAILED |  0 SKIPPED
 -- [x] data          7 PASSED |  0 FAILED |  3 SKIPPED      [SEE BELOW]
 -- [x] data          7 PASSED |  0 FAILED |  3 SKIPPED      [SEE BELOW]
 -- [x] event         4 PASSED |  0 FAILED |  2 SKIPPED      [SEE BELOW]
 -- [x] event         4 PASSED |  0 FAILED |  2 SKIPPED      [SEE BELOW]
--- [x] filesystem   26 PASSED |  1 FAILED |  2 SKIPPED      [SEE BELOW]
+-- [x] filesystem   27 PASSED |  0 FAILED |  2 SKIPPED
 -- [x] font          4 PASSED |  0 FAILED |  1 SKIPPED      [SEE BELOW]
 -- [x] font          4 PASSED |  0 FAILED |  1 SKIPPED      [SEE BELOW]
--- [ ] graphics     STILL TO BE DONE
+-- [ ] graphics     65 PASSED |  0 FAILED | 31 SKIPPED      [SEE BELOW]
 -- [x] image         3 PASSED |  0 FAILED |  0 SKIPPED
 -- [x] image         3 PASSED |  0 FAILED |  0 SKIPPED
--- [x] math         16 PASSED |  0 FAILED |  0 SKIPPED      [SEE BELOW]
--- [x] physics      21 PASSED |  1 FAILED |  0 SKIPPED      [SEE BELOW]
+-- [x] math         17 PASSED |  0 FAILED |  0 SKIPPED
+-- [x] physics      22 PASSED |  0 FAILED |  0 SKIPPED
 -- [x] sound         2 PASSED |  0 FAILED |  0 SKIPPED
 -- [x] sound         2 PASSED |  0 FAILED |  0 SKIPPED
--- [x] system        7 PASSED |  0 FAILED |  1 SKIPPED
--- [ ] thread        3 PASSED |  0 FAILED |  0 SKIPPED
--- [x] timer         6 PASSED |  0 FAILED |  0 SKIPPED      [SEE BELOW]
+-- [x] system        6 PASSED |  0 FAILED |  2 SKIPPED
+-- [x] thread        3 PASSED |  0 FAILED |  0 SKIPPED
+-- [x] timer         6 PASSED |  0 FAILED |  0 SKIPPED
 -- [x] video         1 PASSED |  0 FAILED |  0 SKIPPED
 -- [x] video         1 PASSED |  0 FAILED |  0 SKIPPED
--- [x] window       32 PASSED |  2 FAILED |  1 SKIPPED      [SEE BELOW]
+-- [x] window       32 PASSED |  2 FAILED |  2 SKIPPED      [SEE BELOW]
+
 -- [ ] objects      STILL TO BE DONE
 -- [ ] objects      STILL TO BE DONE
+--------------------------------------------------------------------------------
+-- [x] totals      226 PASSED |  4 FAILED | 43 SKIPPED
 ```
 ```
 
 
 The following modules are not covered as we can't really emulate input nicely:  
 The following modules are not covered as we can't really emulate input nicely:  
@@ -108,24 +111,17 @@ The following modules are not covered as we can't really emulate input nicely:
 Modules with some small bits needed or needing sense checking:
 Modules with some small bits needed or needing sense checking:
 - **love.data** - packing methods need writing cos i dont really get what they are
 - **love.data** - packing methods need writing cos i dont really get what they are
 - **love.event** - love.event.wait or love.event.pump need writing if possible I dunno how to check
 - **love.event** - love.event.wait or love.event.pump need writing if possible I dunno how to check
-- **love.filesystem** - getSource() / setSource() dont think we can test
 - **love.font** - newBMFontRasterizer() wiki entry is wrong so not sure whats expected
 - **love.font** - newBMFontRasterizer() wiki entry is wrong so not sure whats expected
-- **love.timer** - couple methods I don't know if you could reliably test specific values
+- **love.graphics** - still need to do tests for the drawing and state methods
 - **love.image** - ideally isCompressed should have an example of all compressed files love can take
 - **love.image** - ideally isCompressed should have an example of all compressed files love can take
 - **love.math** - linearToGamma + gammaToLinear using direct formulas don't get same value back
 - **love.math** - linearToGamma + gammaToLinear using direct formulas don't get same value back
-- **love.window** - couple stuff just nil checked as I think it's hardware dependent, needs checking
-
-Modules still to be completed or barely started
-- **love.graphics** - done 1 as an example of how we can test the drawing but not really started
-- **love.objects** - done 1 as an example of how we can test objs with mini scenarios
+- **love.objects** - not started properly yet
 
 
 ---
 ---
 
 
 ## Failures
 ## Failures
 - **love.window.isMaximized()** - returns false after calling love.window.maximize?
 - **love.window.isMaximized()** - returns false after calling love.window.maximize?
 - **love.window.maximize()** - same as above
 - **love.window.maximize()** - same as above
-- **love.physics.newGearJoint()** - something changed in 12
-- **love.objects.File()** - dont think I understand the buffering system
 
 
 ---
 ---
 
 
@@ -136,4 +132,4 @@ Modules still to be completed or barely started
 - [ ] Ability to test loading different combinations of modules
 - [ ] Ability to test loading different combinations of modules
 - [ ] Performance tests
 - [ ] Performance tests
 
 
-There is some unused code in the Test.lua class to add preview vs actual images to the HTML output
+There is some unused code in the Test.lua class to add preview vs actual images to the HTML output

BIN
testing/resources/cubemap.png


BIN
testing/resources/love2.png


BIN
testing/resources/love3.png


+ 47 - 62
testing/tests/audio.lua

@@ -3,9 +3,9 @@
 
 
 -- love.audio.getActiveEffects
 -- love.audio.getActiveEffects
 love.test.audio.getActiveEffects = function(test)
 love.test.audio.getActiveEffects = function(test)
-  -- tests
-  test:assertNotEquals(nil, love.audio.getActiveEffects(), 'check not nil')
-  test:assertEquals(0, #love.audio.getActiveEffects(), 'check no effects running')
+  -- check we get a value
+  test:assertNotNil(love.audio.getActiveEffects())
+  -- check setting an effect active
   love.audio.setEffect('testeffect', {
   love.audio.setEffect('testeffect', {
     type = 'chorus',
     type = 'chorus',
     volume = 10
     volume = 10
@@ -17,23 +17,25 @@ end
 
 
 -- love.audio.getActiveSourceCount
 -- love.audio.getActiveSourceCount
 love.test.audio.getActiveSourceCount = function(test)
 love.test.audio.getActiveSourceCount = function(test)
-  -- tests
-  test:assertNotEquals(nil, love.audio.getActiveSourceCount(), 'check not nil')
-  test:assertEquals(0, love.audio.getActiveSourceCount(), 'check 0 by default')
+  -- check we get a value
+  test:assertNotNil(love.audio.getActiveSourceCount())
+  -- check source isn't active by default
   local testsource = love.audio.newSource('resources/click.ogg', 'static')
   local testsource = love.audio.newSource('resources/click.ogg', 'static')
   test:assertEquals(0, love.audio.getActiveSourceCount(), 'check not active')
   test:assertEquals(0, love.audio.getActiveSourceCount(), 'check not active')
+  -- check playing a source marks it as active
   love.audio.play(testsource)
   love.audio.play(testsource)
   test:assertEquals(1, love.audio.getActiveSourceCount(), 'check now active')
   test:assertEquals(1, love.audio.getActiveSourceCount(), 'check now active')
   love.audio.pause()
   love.audio.pause()
-  testsource:release()
 end
 end
 
 
 
 
 -- love.audio.getDistanceModel
 -- love.audio.getDistanceModel
 love.test.audio.getDistanceModel = function(test)
 love.test.audio.getDistanceModel = function(test)
-  -- tests
-  test:assertNotEquals(nil, love.audio.getDistanceModel(), 'check not nil')
+  -- check we get a value
+  test:assertNotNil(love.audio.getDistanceModel())
+  -- check default value from documentation
   test:assertEquals('inverseclamped', love.audio.getDistanceModel(), 'check default value')
   test:assertEquals('inverseclamped', love.audio.getDistanceModel(), 'check default value')
+  -- check get correct value after setting
   love.audio.setDistanceModel('inverse')
   love.audio.setDistanceModel('inverse')
   test:assertEquals('inverse', love.audio.getDistanceModel(), 'check setting model')
   test:assertEquals('inverse', love.audio.getDistanceModel(), 'check setting model')
 end
 end
@@ -41,7 +43,9 @@ end
 
 
 -- love.audio.getDopplerScale
 -- love.audio.getDopplerScale
 love.test.audio.getDopplerScale = function(test)
 love.test.audio.getDopplerScale = function(test)
+  -- check default value
   test:assertEquals(1, love.audio.getDopplerScale(), 'check default 1')
   test:assertEquals(1, love.audio.getDopplerScale(), 'check default 1')
+  -- check correct value after setting to 0
   love.audio.setDopplerScale(0)
   love.audio.setDopplerScale(0)
   test:assertEquals(0, love.audio.getDopplerScale(), 'check setting to 0')
   test:assertEquals(0, love.audio.getDopplerScale(), 'check setting to 0')
   love.audio.setDopplerScale(1)
   love.audio.setDopplerScale(1)
@@ -50,14 +54,15 @@ end
 
 
 -- love.audio.getEffect
 -- love.audio.getEffect
 love.test.audio.getEffect = function(test)
 love.test.audio.getEffect = function(test)
-  -- setup
+  -- check getting a non-existent effect
+  test:assertEquals(nil, love.audio.getEffect('madeupname'), 'check wrong name')
+  -- check getting a valid effect
   love.audio.setEffect('testeffect', {
   love.audio.setEffect('testeffect', {
     type = 'chorus',
     type = 'chorus',
     volume = 10
     volume = 10
   })
   })
-  -- tests
-  test:assertEquals(nil, love.audio.getEffect('madeupname'), 'check wrong name')
-  test:assertNotEquals(nil, love.audio.getEffect('testeffect'), 'check not nil')
+  test:assertNotNil(love.audio.getEffect('testeffect'))
+  -- check effect values match creation values
   test:assertEquals('chorus', love.audio.getEffect('testeffect').type, 'check effect type')
   test:assertEquals('chorus', love.audio.getEffect('testeffect').type, 'check effect type')
   test:assertEquals(10, love.audio.getEffect('testeffect').volume, 'check effect volume')
   test:assertEquals(10, love.audio.getEffect('testeffect').volume, 'check effect volume')
 end
 end
@@ -66,23 +71,22 @@ end
 -- love.audio.getMaxSceneEffects
 -- love.audio.getMaxSceneEffects
 -- @NOTE feel like this is platform specific number so best we can do is a nil?
 -- @NOTE feel like this is platform specific number so best we can do is a nil?
 love.test.audio.getMaxSceneEffects = function(test)
 love.test.audio.getMaxSceneEffects = function(test)
-  test:assertNotEquals(nil, love.audio.getMaxSceneEffects(), 'check not nil')
+  test:assertNotNil(love.audio.getMaxSceneEffects())
 end
 end
 
 
 
 
 -- love.audio.getMaxSourceEffects
 -- love.audio.getMaxSourceEffects
 -- @NOTE feel like this is platform specific number so best we can do is a nil?
 -- @NOTE feel like this is platform specific number so best we can do is a nil?
 love.test.audio.getMaxSourceEffects = function(test)
 love.test.audio.getMaxSourceEffects = function(test)
-  test:assertNotEquals(nil, love.audio.getMaxSourceEffects(), 'check not nil')
+  test:assertNotNil(love.audio.getMaxSourceEffects())
 end
 end
 
 
 
 
 -- love.audio.getOrientation
 -- love.audio.getOrientation
 -- @NOTE is there an expected default listener pos?
 -- @NOTE is there an expected default listener pos?
 love.test.audio.getOrientation = function(test)
 love.test.audio.getOrientation = function(test)
-  -- setup
+  -- checking getting values matches what was set
   love.audio.setOrientation(1, 2, 3, 4, 5, 6)
   love.audio.setOrientation(1, 2, 3, 4, 5, 6)
-  -- tests
   local fx, fy, fz, ux, uy, uz = love.audio.getOrientation()
   local fx, fy, fz, ux, uy, uz = love.audio.getOrientation()
   test:assertEquals(1, fx, 'check fx orientation')
   test:assertEquals(1, fx, 'check fx orientation')
   test:assertEquals(2, fy, 'check fy orientation')
   test:assertEquals(2, fy, 'check fy orientation')
@@ -96,9 +100,8 @@ end
 -- love.audio.getPosition
 -- love.audio.getPosition
 -- @NOTE is there an expected default listener pos?
 -- @NOTE is there an expected default listener pos?
 love.test.audio.getPosition = function(test)
 love.test.audio.getPosition = function(test)
-  -- setup
+  -- check getting values matches what was set
   love.audio.setPosition(1, 2, 3)
   love.audio.setPosition(1, 2, 3)
-  -- tests
   local x, y, z = love.audio.getPosition()
   local x, y, z = love.audio.getPosition()
   test:assertEquals(1, x, 'check x position')
   test:assertEquals(1, x, 'check x position')
   test:assertEquals(2, y, 'check y position')
   test:assertEquals(2, y, 'check y position')
@@ -107,16 +110,16 @@ end
 
 
 
 
 -- love.audio.getRecordingDevices
 -- love.audio.getRecordingDevices
+-- @NOTE hardware dependent so best can do is not nil check
 love.test.audio.getRecordingDevices = function(test)
 love.test.audio.getRecordingDevices = function(test)
-  test:assertNotEquals(nil, love.audio.getRecordingDevices(), 'check not nil')
+  test:assertNotNil(love.audio.getRecordingDevices())
 end
 end
 
 
 
 
 -- love.audio.getVelocity
 -- love.audio.getVelocity
 love.test.audio.getVelocity = function(test)
 love.test.audio.getVelocity = function(test)
-  -- setup
+  -- check getting values matches what was set
   love.audio.setVelocity(1, 2, 3)
   love.audio.setVelocity(1, 2, 3)
-  -- tests
   local x, y, z = love.audio.getVelocity()
   local x, y, z = love.audio.getVelocity()
   test:assertEquals(1, x, 'check x velocity')
   test:assertEquals(1, x, 'check x velocity')
   test:assertEquals(2, y, 'check y velocity')
   test:assertEquals(2, y, 'check y velocity')
@@ -126,87 +129,74 @@ end
 
 
 -- love.audio.getVolume
 -- love.audio.getVolume
 love.test.audio.getVolume = function(test)
 love.test.audio.getVolume = function(test)
-  -- setup
+  -- check getting values matches what was set
   love.audio.setVolume(0.5)
   love.audio.setVolume(0.5)
-  -- tests
-  test:assertNotEquals(nil, love.audio.getVolume(), 'check not nil')
   test:assertEquals(0.5, love.audio.getVolume(), 'check matches set')
   test:assertEquals(0.5, love.audio.getVolume(), 'check matches set')
 end
 end
 
 
 
 
 -- love.audio.isEffectsSupported
 -- love.audio.isEffectsSupported
 love.test.audio.isEffectsSupported = function(test)
 love.test.audio.isEffectsSupported = function(test)
-  test:assertNotEquals(nil, love.audio.isEffectsSupported(), 'check not nil')
+  test:assertNotNil(love.audio.isEffectsSupported())
 end
 end
 
 
 
 
 -- love.audio.newQueueableSource
 -- love.audio.newQueueableSource
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 love.test.audio.newQueueableSource = function(test)
 love.test.audio.newQueueableSource = function(test)
-  local source = love.audio.newQueueableSource(32, 8, 1, 8)
-  test:assertObject(source)
-  source:release()
+  test:assertObject(love.audio.newQueueableSource(32, 8, 1, 8))
 end
 end
 
 
 
 
 -- love.audio.newSource
 -- love.audio.newSource
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 love.test.audio.newSource = function(test)
 love.test.audio.newSource = function(test)
-  -- setup
-  local source1 = love.audio.newSource('resources/click.ogg', 'static')
-  local source2 = love.audio.newSource('resources/click.ogg', 'stream')
-  -- tests
-  test:assertObject(source1)
-  test:assertObject(source2)
-  -- cleanup
-  source1:release()
-  source2:release()
+  test:assertObject(love.audio.newSource('resources/click.ogg', 'static'))
+  test:assertObject(love.audio.newSource('resources/click.ogg', 'stream'))
 end
 end
 
 
 
 
 -- love.audio.pause
 -- love.audio.pause
 love.test.audio.pause = function(test)
 love.test.audio.pause = function(test)
-  -- tests
+  -- check nothing paused (as should be nothing playing)
   local nopauses = love.audio.pause()
   local nopauses = love.audio.pause()
-  test:assertNotEquals(nil, nopauses, 'check not nil')
   test:assertEquals(0, #nopauses, 'check nothing paused')
   test:assertEquals(0, #nopauses, 'check nothing paused')
+  -- check 1 source paused after playing/pausing 1
   local source = love.audio.newSource('resources/click.ogg', 'static')
   local source = love.audio.newSource('resources/click.ogg', 'static')
   love.audio.play(source)
   love.audio.play(source)
   local onepause = love.audio.pause()
   local onepause = love.audio.pause()
   test:assertEquals(1, #onepause, 'check 1 paused')
   test:assertEquals(1, #onepause, 'check 1 paused')
-  source:release()
 end
 end
 
 
 
 
 -- love.audio.play
 -- love.audio.play
 love.test.audio.play = function(test)
 love.test.audio.play = function(test)
-  -- setup
+  -- check playing source is detected
   local source = love.audio.newSource('resources/click.ogg', 'static')
   local source = love.audio.newSource('resources/click.ogg', 'static')
-  -- tests
   love.audio.play(source)
   love.audio.play(source)
   test:assertEquals(true, source:isPlaying(), 'check something playing')
   test:assertEquals(true, source:isPlaying(), 'check something playing')
   love.audio.pause()
   love.audio.pause()
-  source:release()
 end
 end
 
 
 
 
 -- love.audio.setDistanceModel
 -- love.audio.setDistanceModel
 love.test.audio.setDistanceModel = function(test)
 love.test.audio.setDistanceModel = function(test)
-  -- tests
+  -- check setting each of the distance models is accepted and val returned
   local distancemodel = {
   local distancemodel = {
     'none', 'inverse', 'inverseclamped', 'linear', 'linearclamped',
     'none', 'inverse', 'inverseclamped', 'linear', 'linearclamped',
     'exponent', 'exponentclamped'
     'exponent', 'exponentclamped'
   }
   }
   for d=1,#distancemodel do
   for d=1,#distancemodel do
     love.audio.setDistanceModel(distancemodel[d])
     love.audio.setDistanceModel(distancemodel[d])
-    test:assertEquals(distancemodel[d], love.audio.getDistanceModel(), 'check model set to ' .. distancemodel[d])
+    test:assertEquals(distancemodel[d], love.audio.getDistanceModel(),
+      'check model set to ' .. distancemodel[d])
   end
   end
 end
 end
 
 
 
 
 -- love.audio.setDopplerScale
 -- love.audio.setDopplerScale
 love.test.audio.setDopplerScale = function(test)
 love.test.audio.setDopplerScale = function(test)
-  -- tests
+  -- check setting value is returned properly
   love.audio.setDopplerScale(0)
   love.audio.setDopplerScale(0)
   test:assertEquals(0, love.audio.getDopplerScale(), 'check set to 0')
   test:assertEquals(0, love.audio.getDopplerScale(), 'check set to 0')
   love.audio.setDopplerScale(1)
   love.audio.setDopplerScale(1)
@@ -216,12 +206,13 @@ end
 
 
 -- love.audio.setEffect
 -- love.audio.setEffect
 love.test.audio.setEffect = function(test)
 love.test.audio.setEffect = function(test)
-  -- tests
+  -- check effect is set correctly
   local effect = love.audio.setEffect('testeffect', {
   local effect = love.audio.setEffect('testeffect', {
     type = 'chorus',
     type = 'chorus',
     volume = 10
     volume = 10
   })
   })
   test:assertEquals(true, effect, 'check effect created')
   test:assertEquals(true, effect, 'check effect created')
+  -- check values set match
   local settings = love.audio.getEffect('testeffect')
   local settings = love.audio.getEffect('testeffect')
   test:assertEquals('chorus', settings.type, 'check effect type')
   test:assertEquals('chorus', settings.type, 'check effect type')
   test:assertEquals(10, settings.volume, 'check effect volume')
   test:assertEquals(10, settings.volume, 'check effect volume')
@@ -230,15 +221,14 @@ end
 
 
 -- love.audio.setMixWithSystem
 -- love.audio.setMixWithSystem
 love.test.audio.setMixWithSystem = function(test)
 love.test.audio.setMixWithSystem = function(test)
-  test:assertNotEquals(nil, love.audio.setMixWithSystem(true), 'check not nil')
+  test:assertNotNil(love.audio.setMixWithSystem(true))
 end
 end
 
 
 
 
 -- love.audio.setOrientation
 -- love.audio.setOrientation
 love.test.audio.setOrientation = function(test)
 love.test.audio.setOrientation = function(test)
-  -- setup
+  -- check setting orientation vals are returned
   love.audio.setOrientation(1, 2, 3, 4, 5, 6)
   love.audio.setOrientation(1, 2, 3, 4, 5, 6)
-  -- tests
   local fx, fy, fz, ux, uy, uz = love.audio.getOrientation()
   local fx, fy, fz, ux, uy, uz = love.audio.getOrientation()
   test:assertEquals(1, fx, 'check fx orientation')
   test:assertEquals(1, fx, 'check fx orientation')
   test:assertEquals(2, fy, 'check fy orientation')
   test:assertEquals(2, fy, 'check fy orientation')
@@ -251,9 +241,8 @@ end
 
 
 -- love.audio.setPosition
 -- love.audio.setPosition
 love.test.audio.setPosition = function(test)
 love.test.audio.setPosition = function(test)
-  -- setup
+  -- check setting position vals are returned
   love.audio.setPosition(1, 2, 3)
   love.audio.setPosition(1, 2, 3)
-  -- tests
   local x, y, z = love.audio.getPosition()
   local x, y, z = love.audio.getPosition()
   test:assertEquals(1, x, 'check x position')
   test:assertEquals(1, x, 'check x position')
   test:assertEquals(2, y, 'check y position')
   test:assertEquals(2, y, 'check y position')
@@ -263,9 +252,8 @@ end
 
 
 -- love.audio.setVelocity
 -- love.audio.setVelocity
 love.test.audio.setVelocity = function(test)
 love.test.audio.setVelocity = function(test)
-  -- setup
+  -- check setting velocity vals are returned
   love.audio.setVelocity(1, 2, 3)
   love.audio.setVelocity(1, 2, 3)
-  -- tests
   local x, y, z = love.audio.getVelocity()
   local x, y, z = love.audio.getVelocity()
   test:assertEquals(1, x, 'check x velocity')
   test:assertEquals(1, x, 'check x velocity')
   test:assertEquals(2, y, 'check y velocity')
   test:assertEquals(2, y, 'check y velocity')
@@ -275,22 +263,19 @@ end
 
 
 -- love.audio.setVolume
 -- love.audio.setVolume
 love.test.audio.setVolume = function(test)
 love.test.audio.setVolume = function(test)
-  -- setup
+  -- check setting volume works
   love.audio.setVolume(0.5)
   love.audio.setVolume(0.5)
-  -- tests
-  test:assertNotEquals(nil, love.audio.getVolume(), 'check not nil')
   test:assertEquals(0.5, love.audio.getVolume(), 'check set to 0.5')
   test:assertEquals(0.5, love.audio.getVolume(), 'check set to 0.5')
 end
 end
 
 
 
 
 -- love.audio.stop
 -- love.audio.stop
 love.test.audio.stop = function(test)
 love.test.audio.stop = function(test)
-  -- setup
+  -- check source is playing first
   local source = love.audio.newSource('resources/click.ogg', 'static')
   local source = love.audio.newSource('resources/click.ogg', 'static')
   love.audio.play(source)
   love.audio.play(source)
-  -- tests
   test:assertEquals(true, source:isPlaying(), 'check is playing')
   test:assertEquals(true, source:isPlaying(), 'check is playing')
+  -- check source is then stopped
   love.audio.stop()
   love.audio.stop()
   test:assertEquals(false, source:isPlaying(), 'check stopped playing')
   test:assertEquals(false, source:isPlaying(), 'check stopped playing')
-  source:release()
-end
+end

+ 19 - 29
testing/tests/data.lua

@@ -3,9 +3,8 @@
 
 
 -- love.data.compress
 -- love.data.compress
 love.test.data.compress = function(test)
 love.test.data.compress = function(test)
-  -- here just testing each combo 'works', in decompress's test method
+  -- here just testing each combo 'works' - in decompress's test method
   -- we actually check the compress + decompress give the right value back
   -- we actually check the compress + decompress give the right value back
-  -- setup
   local compressions = {
   local compressions = {
     { love.data.compress('string', 'lz4', 'helloworld', -1), 'string'},
     { love.data.compress('string', 'lz4', 'helloworld', -1), 'string'},
     { love.data.compress('string', 'lz4', 'helloworld', 0), 'string'},
     { love.data.compress('string', 'lz4', 'helloworld', 0), 'string'},
@@ -26,9 +25,8 @@ love.test.data.compress = function(test)
     { love.data.compress('data', 'gzip', 'helloworld', 0), 'userdata'},
     { love.data.compress('data', 'gzip', 'helloworld', 0), 'userdata'},
     { love.data.compress('data', 'gzip', 'helloworld', 9), 'userdata'}
     { love.data.compress('data', 'gzip', 'helloworld', 9), 'userdata'}
   }
   }
-  -- tests
   for c=1,#compressions do
   for c=1,#compressions do
-    test:assertNotEquals(nil, compressions[c][1], 'check not nil')
+    test:assertNotNil(compressions[c][1])
     -- sense check return type and make sure bytedata returns are an object
     -- sense check return type and make sure bytedata returns are an object
     test:assertEquals(compressions[c][2], type(compressions[c][1]), 'check is userdata')
     test:assertEquals(compressions[c][2], type(compressions[c][1]), 'check is userdata')
     if compressions[c][2] == 'userdata' then
     if compressions[c][2] == 'userdata' then
@@ -40,12 +38,12 @@ end
 
 
 -- love.data.decode
 -- love.data.decode
 love.test.data.decode = function(test)
 love.test.data.decode = function(test)
-  -- setup
+  -- setup encoded strings
   local str1 = love.data.encode('string', 'base64', 'helloworld', 0)
   local str1 = love.data.encode('string', 'base64', 'helloworld', 0)
   local str2 = love.data.encode('string', 'hex', 'helloworld')
   local str2 = love.data.encode('string', 'hex', 'helloworld')
   local str3 = love.data.encode('data', 'base64', 'helloworld', 0)
   local str3 = love.data.encode('data', 'base64', 'helloworld', 0)
   local str4 = love.data.encode('data', 'hex', 'helloworld')
   local str4 = love.data.encode('data', 'hex', 'helloworld')
-  -- tests
+  -- check value matches expected when decoded back
   test:assertEquals('helloworld', love.data.decode('string', 'base64', str1), 'check string base64 decode')
   test:assertEquals('helloworld', love.data.decode('string', 'base64', str1), 'check string base64 decode')
   test:assertEquals('helloworld', love.data.decode('string', 'hex', str2), 'check string hex decode')
   test:assertEquals('helloworld', love.data.decode('string', 'hex', str2), 'check string hex decode')
   test:assertEquals(love.data.newByteData('helloworld'):getString(), love.data.decode('data', 'base64', str3):getString(), 'check data base64 decode')
   test:assertEquals(love.data.newByteData('helloworld'):getString(), love.data.decode('data', 'base64', str3):getString(), 'check data base64 decode')
@@ -55,7 +53,7 @@ end
 
 
 -- love.data.decompress
 -- love.data.decompress
 love.test.data.decompress = function(test)
 love.test.data.decompress = function(test)
-  -- setup
+  -- setup compressed data for each combination
   local str1 = love.data.compress('string', 'lz4', 'helloworld', -1)
   local str1 = love.data.compress('string', 'lz4', 'helloworld', -1)
   local str2 = love.data.compress('string', 'lz4', 'helloworld', 0)
   local str2 = love.data.compress('string', 'lz4', 'helloworld', 0)
   local str3 = love.data.compress('string', 'lz4', 'helloworld', 9)
   local str3 = love.data.compress('string', 'lz4', 'helloworld', 9)
@@ -74,7 +72,7 @@ love.test.data.decompress = function(test)
   local str16 = love.data.compress('data', 'gzip', 'helloworld', -1)
   local str16 = love.data.compress('data', 'gzip', 'helloworld', -1)
   local str17 = love.data.compress('data', 'gzip', 'helloworld', 0)
   local str17 = love.data.compress('data', 'gzip', 'helloworld', 0)
   local str18 = love.data.compress('data', 'gzip', 'helloworld', 9)
   local str18 = love.data.compress('data', 'gzip', 'helloworld', 9)
-  -- tests
+  -- check decompressed value matches whats expected
   test:assertEquals('helloworld', love.data.decompress('string', 'lz4', str1), 'check string lz4 decompress')
   test:assertEquals('helloworld', love.data.decompress('string', 'lz4', str1), 'check string lz4 decompress')
   test:assertEquals('helloworld', love.data.decompress('string', 'lz4', str2), 'check string lz4 decompress')
   test:assertEquals('helloworld', love.data.decompress('string', 'lz4', str2), 'check string lz4 decompress')
   test:assertEquals('helloworld', love.data.decompress('string', 'lz4', str3), 'check string lz4 decompress')
   test:assertEquals('helloworld', love.data.decompress('string', 'lz4', str3), 'check string lz4 decompress')
@@ -98,9 +96,8 @@ end
 
 
 -- love.data.encode
 -- love.data.encode
 love.test.data.encode = function(test)
 love.test.data.encode = function(test)
-  -- here just testing each combo 'works', in decode's test method
+  -- here just testing each combo 'works' - in decode's test method
   -- we actually check the encode + decode give the right value back
   -- we actually check the encode + decode give the right value back
-  -- setup
   local encodes = {
   local encodes = {
     { love.data.encode('string', 'base64', 'helloworld', 0), 'string'},
     { love.data.encode('string', 'base64', 'helloworld', 0), 'string'},
     { love.data.encode('string', 'base64', 'helloworld', 2), 'string'},
     { love.data.encode('string', 'base64', 'helloworld', 2), 'string'},
@@ -109,9 +106,8 @@ love.test.data.encode = function(test)
     { love.data.encode('data', 'base64', 'helloworld', 2), 'userdata'},
     { love.data.encode('data', 'base64', 'helloworld', 2), 'userdata'},
     { love.data.encode('data', 'hex', 'helloworld'), 'userdata'}
     { love.data.encode('data', 'hex', 'helloworld'), 'userdata'}
   }
   }
-  -- tests
   for e=1,#encodes do
   for e=1,#encodes do
-    test:assertNotEquals(nil, encodes[e][1], 'check not nil')
+    test:assertNotNil(encodes[e][1])
     -- sense check return type and make sure bytedata returns are an object
     -- sense check return type and make sure bytedata returns are an object
     test:assertEquals(encodes[e][2], type(encodes[e][1]), 'check is usedata')
     test:assertEquals(encodes[e][2], type(encodes[e][1]), 'check is usedata')
     if encodes[e][2] == 'userdata' then
     if encodes[e][2] == 'userdata' then
@@ -123,22 +119,22 @@ end
 
 
 
 
 -- love.data.getPackedSize
 -- love.data.getPackedSize
--- @NOTE I dont really get the packing types of lua so best someone else writes this one
+-- @NOTE I don't really get what lua packing types are so skipping for now - ell
 love.test.data.getPackedSize = function(test)
 love.test.data.getPackedSize = function(test)
-  test:skipTest('dont understand lua packing types')
+  test:skipTest('test method needs writing')
 end
 end
 
 
 
 
 -- love.data.hash
 -- love.data.hash
 love.test.data.hash = function(test)
 love.test.data.hash = function(test)
-  -- setup
+  -- setup all the different hashing types
   local str1 = love.data.hash('md5', 'helloworld')
   local str1 = love.data.hash('md5', 'helloworld')
   local str2 = love.data.hash('sha1', 'helloworld')
   local str2 = love.data.hash('sha1', 'helloworld')
   local str3 = love.data.hash('sha224', 'helloworld')
   local str3 = love.data.hash('sha224', 'helloworld')
   local str4 = love.data.hash('sha256', 'helloworld')
   local str4 = love.data.hash('sha256', 'helloworld')
   local str5 = love.data.hash('sha384', 'helloworld')
   local str5 = love.data.hash('sha384', 'helloworld')
   local str6 = love.data.hash('sha512', 'helloworld')
   local str6 = love.data.hash('sha512', 'helloworld')
-  -- tests
+  -- check encoded hash value matches what's expected for that algo
   test:assertEquals('fc5e038d38a57032085441e7fe7010b0', love.data.encode("string", "hex", str1), 'check md5 encode')
   test:assertEquals('fc5e038d38a57032085441e7fe7010b0', love.data.encode("string", "hex", str1), 'check md5 encode')
   test:assertEquals('6adfb183a4a2c94a2f92dab5ade762a47889a5a1', love.data.encode("string", "hex", str2), 'check sha1 encode')
   test:assertEquals('6adfb183a4a2c94a2f92dab5ade762a47889a5a1', love.data.encode("string", "hex", str2), 'check sha1 encode')
   test:assertEquals('b033d770602994efa135c5248af300d81567ad5b59cec4bccbf15bcc', love.data.encode("string", "hex", str3), 'check sha224 encode')
   test:assertEquals('b033d770602994efa135c5248af300d81567ad5b59cec4bccbf15bcc', love.data.encode("string", "hex", str3), 'check sha224 encode')
@@ -151,32 +147,26 @@ end
 -- love.data.newByteData
 -- love.data.newByteData
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 love.test.data.newByteData = function(test)
 love.test.data.newByteData = function(test)
-  -- setup
-  local bytedata = love.data.newByteData('helloworld')
-  -- tests
-  test:assertObject(bytedata)
+  test:assertObject(love.data.newByteData('helloworld'))
 end
 end
 
 
 
 
 -- love.data.newDataView
 -- love.data.newDataView
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 love.test.data.newDataView = function(test)
 love.test.data.newDataView = function(test)
-  -- setup
-  local dataview = love.data.newDataView(love.data.newByteData('helloworld'), 0, 10)
-  -- tests
-  test:assertObject(dataview)
+  test:assertObject(love.data.newDataView(love.data.newByteData('helloworld'), 0, 10))
 end
 end
 
 
 
 
 -- love.data.pack
 -- love.data.pack
--- @NOTE i dont really get the packing types of lua so best someone else writes this one
+-- @NOTE I don't really get what lua packing types are so skipping for now - ell
 love.test.data.pack = function(test)
 love.test.data.pack = function(test)
-  test:skipTest('dont understand lua packing types')
+  test:skipTest('test method needs writing')
 end
 end
 
 
 
 
 -- love.data.unpack
 -- love.data.unpack
--- @NOTE i dont really get the packing types of lua so best someone else writes this one
+-- @NOTE I don't really get what lua packing types are so skipping for now - ell
 love.test.data.unpack = function(test)
 love.test.data.unpack = function(test)
-  test:skipTest('dont understand lua packing types')
-end
+  test:skipTest('test method needs writing')
+end

+ 11 - 11
testing/tests/event.lua

@@ -3,11 +3,11 @@
 
 
 -- love.event.clear
 -- love.event.clear
 love.test.event.clear = function(test)
 love.test.event.clear = function(test)
-  -- setup
+  -- push some events first
   love.event.push('test', 1, 2, 3)
   love.event.push('test', 1, 2, 3)
   love.event.push('test', 1, 2, 3)
   love.event.push('test', 1, 2, 3)
   love.event.push('test', 1, 2, 3)
   love.event.push('test', 1, 2, 3)
-  -- tests
+  -- check after calling clear there are no events left
   love.event.clear()
   love.event.clear()
   local count = 0
   local count = 0
   for n, a, b, c, d, e, f in love.event.poll() do
   for n, a, b, c, d, e, f in love.event.poll() do
@@ -19,11 +19,11 @@ end
 
 
 -- love.event.poll
 -- love.event.poll
 love.test.event.poll = function(test)
 love.test.event.poll = function(test)
-  -- setup
+  -- push some events first
   love.event.push('test', 1, 2, 3)
   love.event.push('test', 1, 2, 3)
   love.event.push('test', 1, 2, 3)
   love.event.push('test', 1, 2, 3)
   love.event.push('test', 1, 2, 3)
   love.event.push('test', 1, 2, 3)
-  -- tests
+  -- check poll recieves all events
   local count = 0
   local count = 0
   for n, a, b, c, d, e, f in love.event.poll() do
   for n, a, b, c, d, e, f in love.event.poll() do
     count = count + 1
     count = count + 1
@@ -33,15 +33,15 @@ end
 
 
 
 
 -- love.event.pump
 -- love.event.pump
--- @NOTE dont think can really test as internal?
+-- @NOTE dont think can really test as internally used
 love.test.event.pump = function(test)
 love.test.event.pump = function(test)
-  test:skipTest('not sure we can test when its internal?')
+  test:skipTest('not sure can be tested as used internally')
 end
 end
 
 
 
 
 -- love.event.push
 -- love.event.push
 love.test.event.push = function(test)
 love.test.event.push = function(test)
-  -- test
+  -- check pushing some different types
   love.event.push('add', 1, 2, 3)
   love.event.push('add', 1, 2, 3)
   love.event.push('ignore', 1, 2, 3)
   love.event.push('ignore', 1, 2, 3)
   love.event.push('add', 1, 2, 3)
   love.event.push('add', 1, 2, 3)
@@ -58,10 +58,10 @@ end
 
 
 -- love.event.quit
 -- love.event.quit
 love.test.event.quit = function(test)
 love.test.event.quit = function(test)
+  -- setting this overrides the quit hook to prevent actually quitting
   love.test.module.fakequit = true
   love.test.module.fakequit = true
-  -- this should call love.quit, which will prevent the quit
-  -- if this fails then the test would just abort here
   love.event.quit(0)
   love.event.quit(0)
+  -- if it failed we'd have quit here
   test:assertEquals(true, true, 'check quit hook called')
   test:assertEquals(true, true, 'check quit hook called')
 end
 end
 
 
@@ -69,5 +69,5 @@ end
 -- love.event.wait
 -- love.event.wait
 -- @NOTE not sure best way to test this one
 -- @NOTE not sure best way to test this one
 love.test.event.wait = function(test)
 love.test.event.wait = function(test)
-  test:skipTest('not sure on best way to test this')
-end
+  test:skipTest('test method needs writing')
+end

+ 56 - 65
testing/tests/filesystem.lua

@@ -3,15 +3,16 @@
 
 
 -- love.filesystem.append
 -- love.filesystem.append
 love.test.filesystem.append = function(test)
 love.test.filesystem.append = function(test)
-	-- setup
+	-- create a new file to test with
 	love.filesystem.write('filesystem.append.txt', 'foo')
 	love.filesystem.write('filesystem.append.txt', 'foo')
-	-- test
+	-- try appending text and check new file contents/size matches
 	local success, message = love.filesystem.append('filesystem.append.txt', 'bar')
 	local success, message = love.filesystem.append('filesystem.append.txt', 'bar')
   test:assertNotEquals(false, success, 'check success')
   test:assertNotEquals(false, success, 'check success')
   test:assertEquals(nil, message, 'check no error msg')
   test:assertEquals(nil, message, 'check no error msg')
 	local contents, size = love.filesystem.read('filesystem.append.txt')
 	local contents, size = love.filesystem.read('filesystem.append.txt')
 	test:assertEquals(contents, 'foobar', 'check file contents')
 	test:assertEquals(contents, 'foobar', 'check file contents')
 	test:assertEquals(size, 6, 'check file size')
 	test:assertEquals(size, 6, 'check file size')
+  -- check appending a specific no. of bytes
   love.filesystem.append('filesystem.append.txt', 'foobarfoobarfoo', 6)
   love.filesystem.append('filesystem.append.txt', 'foobarfoobarfoo', 6)
   contents, size = love.filesystem.read('filesystem.append.txt')
   contents, size = love.filesystem.read('filesystem.append.txt')
   test:assertEquals(contents, 'foobarfoobar', 'check appended contents')
   test:assertEquals(contents, 'foobarfoobar', 'check appended contents')
@@ -22,14 +23,15 @@ end
 
 
 
 
 -- love.filesystem.areSymlinksEnabled
 -- love.filesystem.areSymlinksEnabled
--- @NOTE  this one, need to see if default val is consistent on platforms?
+-- @NOTE best can do here is just check not nil
 love.test.filesystem.areSymlinksEnabled = function(test)
 love.test.filesystem.areSymlinksEnabled = function(test)
-  test:assertNotEquals(nil, love.filesystem.areSymlinksEnabled())
+  test:assertNotNil(love.filesystem.areSymlinksEnabled())
 end
 end
 
 
 
 
 -- love.filesystem.createDirectory
 -- love.filesystem.createDirectory
 love.test.filesystem.createDirectory = function(test)
 love.test.filesystem.createDirectory = function(test)
+  -- try creating a dir + subdir and check both exist 
   local success = love.filesystem.createDirectory('foo/bar')
   local success = love.filesystem.createDirectory('foo/bar')
   test:assertNotEquals(false, success, 'check success')
   test:assertNotEquals(false, success, 'check success')
   test:assertNotEquals(nil, love.filesystem.getInfo('foo', 'directory'), 'check directory created')
   test:assertNotEquals(nil, love.filesystem.getInfo('foo', 'directory'), 'check directory created')
@@ -43,23 +45,24 @@ end
 -- love.filesystem.getAppdataDirectory
 -- love.filesystem.getAppdataDirectory
 -- @NOTE i think this is too platform dependent to be tested nicely
 -- @NOTE i think this is too platform dependent to be tested nicely
 love.test.filesystem.getAppdataDirectory = function(test)
 love.test.filesystem.getAppdataDirectory = function(test)
-  test:assertNotEquals(nil, love.filesystem.getAppdataDirectory(), 'check not nill')
+  test:assertNotNil(love.filesystem.getAppdataDirectory())
 end
 end
 
 
 
 
 -- love.filesystem.getCRequirePath
 -- love.filesystem.getCRequirePath
 love.test.filesystem.getCRequirePath = function(test)
 love.test.filesystem.getCRequirePath = function(test)
+  -- check default value from documentation
   test:assertEquals('??', love.filesystem.getCRequirePath(), 'check default value')
   test:assertEquals('??', love.filesystem.getCRequirePath(), 'check default value')
 end
 end
 
 
 
 
 -- love.filesystem.getDirectoryItems
 -- love.filesystem.getDirectoryItems
 love.test.filesystem.getDirectoryItems = function(test)
 love.test.filesystem.getDirectoryItems = function(test)
-  -- setup
+  -- create a dir + subdir with 2 files
   love.filesystem.createDirectory('foo/bar')
   love.filesystem.createDirectory('foo/bar')
 	love.filesystem.write('foo/file1.txt', 'file1')
 	love.filesystem.write('foo/file1.txt', 'file1')
   love.filesystem.write('foo/bar/file2.txt', 'file2')
   love.filesystem.write('foo/bar/file2.txt', 'file2')
-  -- tests
+  -- check both the file + subdir exist in the item list
   local files = love.filesystem.getDirectoryItems('foo')
   local files = love.filesystem.getDirectoryItems('foo')
   local hasfile = false
   local hasfile = false
   local hasdir = false
   local hasdir = false
@@ -80,23 +83,23 @@ end
 
 
 -- love.filesystem.getIdentity
 -- love.filesystem.getIdentity
 love.test.filesystem.getIdentity = function(test)
 love.test.filesystem.getIdentity = function(test)
-  -- setup
+  -- check setting identity matches
   local original = love.filesystem.getIdentity()
   local original = love.filesystem.getIdentity()
   love.filesystem.setIdentity('lover')
   love.filesystem.setIdentity('lover')
-  -- test
   test:assertEquals('lover', love.filesystem.getIdentity(), 'check identity matches')
   test:assertEquals('lover', love.filesystem.getIdentity(), 'check identity matches')
-  -- cleanup
+  -- put back to original value
   love.filesystem.setIdentity(original)
   love.filesystem.setIdentity(original)
 end
 end
 
 
 
 
 -- love.filesystem.getRealDirectory
 -- love.filesystem.getRealDirectory
 love.test.filesystem.getRealDirectory = function(test)
 love.test.filesystem.getRealDirectory = function(test)
-  -- setup
+  -- make a test dir + file first
   love.filesystem.createDirectory('foo')
   love.filesystem.createDirectory('foo')
   love.filesystem.write('foo/test.txt', 'test')
   love.filesystem.write('foo/test.txt', 'test')
-  -- test
-  test:assertEquals(love.filesystem.getSaveDirectory(), love.filesystem.getRealDirectory('foo/test.txt'), 'check directory matches')
+  -- check save dir matches the real dir we just wrote to
+  test:assertEquals(love.filesystem.getSaveDirectory(), 
+    love.filesystem.getRealDirectory('foo/test.txt'), 'check directory matches')
   -- cleanup
   -- cleanup
   love.filesystem.remove('foo/test.txt')
   love.filesystem.remove('foo/test.txt')
   love.filesystem.remove('foo')
   love.filesystem.remove('foo')
@@ -105,51 +108,52 @@ end
 
 
 -- love.filesystem.getRequirePath
 -- love.filesystem.getRequirePath
 love.test.filesystem.getRequirePath = function(test)
 love.test.filesystem.getRequirePath = function(test)
-  test:assertEquals('?.lua;?/init.lua', love.filesystem.getRequirePath(), 'check default value')
+  test:assertEquals('?.lua;?/init.lua',
+    love.filesystem.getRequirePath(), 'check default value')
 end
 end
 
 
 
 
 -- love.filesystem.getSource
 -- love.filesystem.getSource
 -- @NOTE i dont think we can test this cos love calls it first
 -- @NOTE i dont think we can test this cos love calls it first
 love.test.filesystem.getSource = function(test)
 love.test.filesystem.getSource = function(test)
-  test:skipTest('not sure we can test when its internal?')
+  test:skipTest('not sure can be tested as used internally')
 end
 end
 
 
 
 
 -- love.filesystem.getSourceBaseDirectory
 -- love.filesystem.getSourceBaseDirectory
 -- @NOTE i think this is too platform dependent to be tested nicely
 -- @NOTE i think this is too platform dependent to be tested nicely
 love.test.filesystem.getSourceBaseDirectory = function(test)
 love.test.filesystem.getSourceBaseDirectory = function(test)
-  test:assertNotEquals(nil, love.filesystem.getSourceBaseDirectory(), 'check not nil')
+  test:assertNotNil(love.filesystem.getSourceBaseDirectory())
 end
 end
 
 
 
 
 -- love.filesystem.getUserDirectory
 -- love.filesystem.getUserDirectory
 -- @NOTE i think this is too platform dependent to be tested nicely
 -- @NOTE i think this is too platform dependent to be tested nicely
 love.test.filesystem.getUserDirectory = function(test)
 love.test.filesystem.getUserDirectory = function(test)
-  test:assertNotEquals(nil, love.filesystem.getUserDirectory(), 'check not nil')
+  test:assertNotNil(love.filesystem.getUserDirectory())
 end
 end
 
 
 
 
 -- love.filesystem.getWorkingDirectory
 -- love.filesystem.getWorkingDirectory
 -- @NOTE i think this is too platform dependent to be tested nicely
 -- @NOTE i think this is too platform dependent to be tested nicely
 love.test.filesystem.getWorkingDirectory = function(test)
 love.test.filesystem.getWorkingDirectory = function(test)
-  test:assertNotEquals(nil, love.filesystem.getWorkingDirectory(), 'check not nil')
+  test:assertNotNil(love.filesystem.getWorkingDirectory())
 end
 end
 
 
 
 
 -- love.filesystem.getSaveDirectory
 -- love.filesystem.getSaveDirectory
 -- @NOTE i think this is too platform dependent to be tested nicely
 -- @NOTE i think this is too platform dependent to be tested nicely
 love.test.filesystem.getSaveDirectory = function(test)
 love.test.filesystem.getSaveDirectory = function(test)
-  test:assertNotEquals(nil, love.filesystem.getSaveDirectory(), 'check not nil')
+  test:assertNotNil(love.filesystem.getSaveDirectory())
 end
 end
 
 
 
 
 -- love.filesystem.getInfo
 -- love.filesystem.getInfo
 love.test.filesystem.getInfo = function(test)
 love.test.filesystem.getInfo = function(test)
-  -- setup
+  -- create a dir and subdir with a file
   love.filesystem.createDirectory('foo/bar')
   love.filesystem.createDirectory('foo/bar')
   love.filesystem.write('foo/bar/file2.txt', 'file2')
   love.filesystem.write('foo/bar/file2.txt', 'file2')
-  -- tests
+  -- check getinfo returns the correct values
   test:assertEquals(nil, love.filesystem.getInfo('foo/bar/file2.txt', 'directory'), 'check not directory')
   test:assertEquals(nil, love.filesystem.getInfo('foo/bar/file2.txt', 'directory'), 'check not directory')
   test:assertNotEquals(nil, love.filesystem.getInfo('foo/bar/file2.txt'), 'check info not nil')
   test:assertNotEquals(nil, love.filesystem.getInfo('foo/bar/file2.txt'), 'check info not nil')
   test:assertEquals(love.filesystem.getInfo('foo/bar/file2.txt').size, 5, 'check info size match')
   test:assertEquals(love.filesystem.getInfo('foo/bar/file2.txt').size, 5, 'check info size match')
@@ -164,18 +168,18 @@ end
 -- love.filesystem.isFused
 -- love.filesystem.isFused
 love.test.filesystem.isFused = function(test)
 love.test.filesystem.isFused = function(test)
   -- kinda assuming you'd run the testsuite in a non-fused game
   -- kinda assuming you'd run the testsuite in a non-fused game
-  test:assertEquals(love.filesystem.isFused(), false, 'check default value')
+  test:assertEquals(love.filesystem.isFused(), false, 'check not fused')
 end
 end
 
 
 
 
 -- love.filesystem.lines
 -- love.filesystem.lines
 love.test.filesystem.lines = function(test)
 love.test.filesystem.lines = function(test)
-  -- setup
+  -- check lines returns the 3 lines expected
   love.filesystem.write('file.txt', 'line1\nline2\nline3')
   love.filesystem.write('file.txt', 'line1\nline2\nline3')
-  -- tests
   local linenum = 1
   local linenum = 1
   for line in love.filesystem.lines('file.txt') do
   for line in love.filesystem.lines('file.txt') do
     test:assertEquals('line' .. tostring(linenum), line, 'check line matches')
     test:assertEquals('line' .. tostring(linenum), line, 'check line matches')
+    -- also check it removes newlines like the docs says it does
     test:assertEquals(nil, string.find(line, '\n'), 'check newline removed')
     test:assertEquals(nil, string.find(line, '\n'), 'check newline removed')
     linenum = linenum + 1
     linenum = linenum + 1
   end
   end
@@ -186,15 +190,17 @@ end
 
 
 -- love.filesystem.load
 -- love.filesystem.load
 love.test.filesystem.load = function(test)
 love.test.filesystem.load = function(test)
-  -- setup
+  -- setup some fake lua files
   love.filesystem.write('test1.lua', 'function test()\nreturn 1\nend\nreturn test()')
   love.filesystem.write('test1.lua', 'function test()\nreturn 1\nend\nreturn test()')
   love.filesystem.write('test2.lua', 'function test()\nreturn 1')
   love.filesystem.write('test2.lua', 'function test()\nreturn 1')
-  -- tests
+  -- check file that doesn't exist
   local chunk, errormsg = love.filesystem.load('faker.lua')
   local chunk, errormsg = love.filesystem.load('faker.lua')
   test:assertEquals(nil, chunk, 'check file doesnt exist')
   test:assertEquals(nil, chunk, 'check file doesnt exist')
+  -- check valid lua file
   chunk, errormsg = love.filesystem.load('test1.lua')
   chunk, errormsg = love.filesystem.load('test1.lua')
   test:assertEquals(nil, errormsg, 'check no error message')
   test:assertEquals(nil, errormsg, 'check no error message')
   test:assertEquals(1, chunk(), 'check lua file runs')
   test:assertEquals(1, chunk(), 'check lua file runs')
+  -- check invalid lua file
   local ok, chunk, err = pcall(love.filesystem.load, 'test2.lua')
   local ok, chunk, err = pcall(love.filesystem.load, 'test2.lua')
   test:assertEquals(false, ok, 'check invalid lua file')
   test:assertEquals(false, ok, 'check invalid lua file')
   -- cleanup
   -- cleanup
@@ -205,10 +211,10 @@ end
 
 
 -- love.filesystem.mount
 -- love.filesystem.mount
 love.test.filesystem.mount = function(test)
 love.test.filesystem.mount = function(test)
-  -- setup 
+  -- write an example zip to savedir to use
   local contents, size = love.filesystem.read('resources/test.zip') -- contains test.txt
   local contents, size = love.filesystem.read('resources/test.zip') -- contains test.txt
   love.filesystem.write('test.zip', contents, size)
   love.filesystem.write('test.zip', contents, size)
-  -- tests
+  -- check mounting file and check contents are mounted
   local success = love.filesystem.mount('test.zip', 'test')
   local success = love.filesystem.mount('test.zip', 'test')
   test:assertEquals(true, success, 'check success')
   test:assertEquals(true, success, 'check success')
   test:assertNotEquals(nil, love.filesystem.getInfo('test'), 'check mount not nil')
   test:assertNotEquals(nil, love.filesystem.getInfo('test'), 'check mount not nil')
@@ -222,45 +228,31 @@ love.test.filesystem.mount = function(test)
 end
 end
 
 
 
 
--- love.filesystem.newFile
+-- love.filesystem.openFile
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
-love.test.filesystem.newFile = function(test)
-  -- setup
-  local file = love.filesystem.newFile('file1')
-  local file_r, err_r = love.filesystem.newFile('file2', 'r')
-  local file_w, err_w = love.filesystem.newFile('file2', 'w')
-  local file_a, err_a = love.filesystem.newFile('file2', 'a')
-  local file_c, err_c = love.filesystem.newFile('file2', 'c')
-  -- tests
-  test:assertNotEquals(nil, file, 'check file made')
-  test:assertNotEquals(nil, file_r, 'check file made')
-  test:assertNotEquals(nil, file_w, 'check file made')
-  test:assertNotEquals(nil, file_a, 'check file made')
-  test:assertNotEquals(nil, file_c, 'check file made')
-  -- cleanup
-  if file ~= nil then file:release() end
-  if file_r ~= nil then file_r:release() end
-  if file_w ~= nil then file_w:release() end
-  if file_a ~= nil then file_a:release() end
-  if file_c ~= nil then file_c:release() end
+love.test.filesystem.openFile = function(test)
+  test:assertNotNil(love.filesystem.openFile('file2', 'r'))
+  test:assertNotNil(love.filesystem.openFile('file2', 'w'))
+  test:assertNotNil(love.filesystem.openFile('file2', 'a'))
+  test:assertNotNil(love.filesystem.openFile('file2', 'c'))
 end
 end
 
 
 
 
 -- love.filesystem.newFileData
 -- love.filesystem.newFileData
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 love.test.filesystem.newFileData = function(test)
 love.test.filesystem.newFileData = function(test)
-  local data = love.filesystem.newFileData('helloworld', 'file1')
-  test:assertNotEquals(nil, data, 'check not nil')
-  data:release()
+  test:assertNotNil(love.filesystem.newFileData('helloworld', 'file1'))
 end
 end
 
 
 
 
 -- love.filesystem.read
 -- love.filesystem.read
 love.test.filesystem.read = function(test)
 love.test.filesystem.read = function(test)
+  -- check reading a full file
   local content, size = love.filesystem.read('resources/test.txt')
   local content, size = love.filesystem.read('resources/test.txt')
   test:assertNotEquals(nil, content, 'check not nil')
   test:assertNotEquals(nil, content, 'check not nil')
   test:assertEquals('helloworld', content, 'check content match')
   test:assertEquals('helloworld', content, 'check content match')
   test:assertEquals(10, size, 'check size match')
   test:assertEquals(10, size, 'check size match')
+  -- check reading partial file
   content, size = love.filesystem.read('resources/test.txt', 5)
   content, size = love.filesystem.read('resources/test.txt', 5)
   test:assertNotEquals(nil, content, 'check not nil')
   test:assertNotEquals(nil, content, 'check not nil')
   test:assertEquals('hello', content, 'check content match')
   test:assertEquals('hello', content, 'check content match')
@@ -270,21 +262,22 @@ end
 
 
 -- love.filesystem.remove
 -- love.filesystem.remove
 love.test.filesystem.remove = function(test)
 love.test.filesystem.remove = function(test)
-  -- setup
+  -- create a dir + subdir with a file
   love.filesystem.createDirectory('foo/bar')
   love.filesystem.createDirectory('foo/bar')
   love.filesystem.write('foo/bar/file2.txt', 'helloworld')
   love.filesystem.write('foo/bar/file2.txt', 'helloworld')
-  -- tests
+  -- check removing files + dirs (should fail to remove dir if file inside)
   test:assertEquals(false, love.filesystem.remove('foo'), 'check fail when file inside')
   test:assertEquals(false, love.filesystem.remove('foo'), 'check fail when file inside')
   test:assertEquals(false, love.filesystem.remove('foo/bar'), 'check fail when file inside')
   test:assertEquals(false, love.filesystem.remove('foo/bar'), 'check fail when file inside')
   test:assertEquals(true, love.filesystem.remove('foo/bar/file2.txt'), 'check file removed')
   test:assertEquals(true, love.filesystem.remove('foo/bar/file2.txt'), 'check file removed')
   test:assertEquals(true, love.filesystem.remove('foo/bar'), 'check subdirectory removed')
   test:assertEquals(true, love.filesystem.remove('foo/bar'), 'check subdirectory removed')
   test:assertEquals(true, love.filesystem.remove('foo'), 'check directory removed')
   test:assertEquals(true, love.filesystem.remove('foo'), 'check directory removed')
-  -- cleanup not needed here
+  -- cleanup not needed here hopefully...
 end
 end
 
 
 
 
 -- love.filesystem.setCRequirePath
 -- love.filesystem.setCRequirePath
 love.test.filesystem.setCRequirePath = function(test)
 love.test.filesystem.setCRequirePath = function(test)
+  -- check setting path val is returned
   love.filesystem.setCRequirePath('/??')
   love.filesystem.setCRequirePath('/??')
   test:assertEquals('/??', love.filesystem.getCRequirePath(), 'check crequirepath value')
   test:assertEquals('/??', love.filesystem.getCRequirePath(), 'check crequirepath value')
   love.filesystem.setCRequirePath('??')
   love.filesystem.setCRequirePath('??')
@@ -293,22 +286,21 @@ end
 
 
 -- love.filesystem.setIdentity
 -- love.filesystem.setIdentity
 love.test.filesystem.setIdentity = function(test)
 love.test.filesystem.setIdentity = function(test)
-  -- setup
+  -- check setting identity val is returned
   local original = love.filesystem.getIdentity()
   local original = love.filesystem.getIdentity()
-  -- test
   love.filesystem.setIdentity('lover')
   love.filesystem.setIdentity('lover')
   test:assertEquals('lover', love.filesystem.getIdentity(), 'check indentity value')
   test:assertEquals('lover', love.filesystem.getIdentity(), 'check indentity value')
-  -- cleanup
+  -- return value to original
   love.filesystem.setIdentity(original)
   love.filesystem.setIdentity(original)
 end
 end
 
 
 
 
 -- love.filesystem.setRequirePath
 -- love.filesystem.setRequirePath
 love.test.filesystem.setRequirePath = function(test)
 love.test.filesystem.setRequirePath = function(test)
-  -- test
+  -- check setting path val is returned
   love.filesystem.setRequirePath('?.lua;?/start.lua')
   love.filesystem.setRequirePath('?.lua;?/start.lua')
   test:assertEquals('?.lua;?/start.lua', love.filesystem.getRequirePath(), 'check require path')
   test:assertEquals('?.lua;?/start.lua', love.filesystem.getRequirePath(), 'check require path')
-  -- cleanup
+  -- reset to default
   love.filesystem.setRequirePath('?.lua;?/init.lua')
   love.filesystem.setRequirePath('?.lua;?/init.lua')
 end
 end
 
 
@@ -316,17 +308,17 @@ end
 -- love.filesystem.setSource
 -- love.filesystem.setSource
 -- @NOTE dont think can test this cos used internally?
 -- @NOTE dont think can test this cos used internally?
 love.test.filesystem.setSource = function(test)
 love.test.filesystem.setSource = function(test)
-  test:skipTest('not sure we can test when its internal?')
+  test:skipTest('not sure can be tested as used internally')
 end
 end
 
 
 
 
 -- love.filesystem.unmount
 -- love.filesystem.unmount
 love.test.filesystem.unmount = function(test)
 love.test.filesystem.unmount = function(test)
-  --setup
+  -- create a zip file mounted to use
   local contents, size = love.filesystem.read('resources/test.zip') -- contains test.txt
   local contents, size = love.filesystem.read('resources/test.zip') -- contains test.txt
   love.filesystem.write('test.zip', contents, size)
   love.filesystem.write('test.zip', contents, size)
   love.filesystem.mount('test.zip', 'test')
   love.filesystem.mount('test.zip', 'test')
-  -- tests
+  -- check mounted, unmount, then check its unmounted
   test:assertNotEquals(nil, love.filesystem.getInfo('test/test.txt'), 'check mount exists')
   test:assertNotEquals(nil, love.filesystem.getInfo('test/test.txt'), 'check mount exists')
   love.filesystem.unmount('test.zip')
   love.filesystem.unmount('test.zip')
   test:assertEquals(nil, love.filesystem.getInfo('test/test.txt'), 'check unmounted')
   test:assertEquals(nil, love.filesystem.getInfo('test/test.txt'), 'check unmounted')
@@ -339,11 +331,10 @@ end
 
 
 -- love.filesystem.write
 -- love.filesystem.write
 love.test.filesystem.write = function(test)
 love.test.filesystem.write = function(test)
-  -- setup
+  -- check writing a bunch of files matches whats read back
   love.filesystem.write('test1.txt', 'helloworld')
   love.filesystem.write('test1.txt', 'helloworld')
   love.filesystem.write('test2.txt', 'helloworld', 10)
   love.filesystem.write('test2.txt', 'helloworld', 10)
   love.filesystem.write('test3.txt', 'helloworld', 5)
   love.filesystem.write('test3.txt', 'helloworld', 5)
-  -- test
   test:assertEquals('helloworld', love.filesystem.read('test1.txt'), 'check read file')
   test:assertEquals('helloworld', love.filesystem.read('test1.txt'), 'check read file')
   test:assertEquals('helloworld', love.filesystem.read('test2.txt'), 'check read all')
   test:assertEquals('helloworld', love.filesystem.read('test2.txt'), 'check read all')
   test:assertEquals('hello', love.filesystem.read('test3.txt'), 'check read partial')
   test:assertEquals('hello', love.filesystem.read('test3.txt'), 'check read partial')
@@ -351,4 +342,4 @@ love.test.filesystem.write = function(test)
   love.filesystem.remove('test1.txt')
   love.filesystem.remove('test1.txt')
   love.filesystem.remove('test2.txt')
   love.filesystem.remove('test2.txt')
   love.filesystem.remove('test3.txt')
   love.filesystem.remove('test3.txt')
-end
+end

+ 4 - 15
testing/tests/font.lua

@@ -16,9 +16,6 @@ love.test.font.newGlyphData = function(test)
   local rasterizer = love.font.newImageRasterizer(img, 'ABC', 0, 1);
   local rasterizer = love.font.newImageRasterizer(img, 'ABC', 0, 1);
   local glyphdata = love.font.newGlyphData(rasterizer, 65)
   local glyphdata = love.font.newGlyphData(rasterizer, 65)
   test:assertObject(glyphdata)
   test:assertObject(glyphdata)
-  img:release()
-  rasterizer:release()
-  glyphdata:release()
 end
 end
 
 
 
 
@@ -28,27 +25,19 @@ love.test.font.newImageRasterizer = function(test)
   local img = love.image.newImageData('resources/love.png')
   local img = love.image.newImageData('resources/love.png')
   local rasterizer = love.font.newImageRasterizer(img, 'ABC', 0, 1);
   local rasterizer = love.font.newImageRasterizer(img, 'ABC', 0, 1);
   test:assertObject(rasterizer)
   test:assertObject(rasterizer)
-  img:release()
-  rasterizer:release()
 end
 end
 
 
 
 
 -- love.font.newRasterizer
 -- love.font.newRasterizer
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 love.test.font.newRasterizer = function(test)
 love.test.font.newRasterizer = function(test)
-  local rasterizer = love.font.newRasterizer('resources/font.ttf');
-  test:assertObject(rasterizer)
-  rasterizer:release()
+  test:assertObject(love.font.newRasterizer('resources/font.ttf'))
 end
 end
 
 
 
 
 -- love.font.newTrueTypeRasterizer
 -- love.font.newTrueTypeRasterizer
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 love.test.font.newTrueTypeRasterizer = function(test)
 love.test.font.newTrueTypeRasterizer = function(test)
-  local defaltraster = love.font.newTrueTypeRasterizer(12, "normal", 1)
-  local customraster = love.font.newTrueTypeRasterizer('resources/font.ttf', 8, "normal", 1)
-  test:assertObject(defaltraster)
-  test:assertObject(customraster)
-  defaltraster:release()
-  customraster:release()
-end
+  test:assertObject(love.font.newTrueTypeRasterizer(12, "normal", 1))
+  test:assertObject(love.font.newTrueTypeRasterizer('resources/font.ttf', 8, "normal", 1))
+end

+ 992 - 30
testing/tests/graphics.lua

@@ -1,9 +1,102 @@
 -- love.graphics
 -- love.graphics
 
 
 
 
--- DRAWING
+--------------------------------------------------------------------------------
+--------------------------------------------------------------------------------
+------------------------------------DRAWING-------------------------------------
+--------------------------------------------------------------------------------
+--------------------------------------------------------------------------------
 
 
 
 
+-- love.graphics.arc
+love.test.graphics.arc = function(test)
+  test:skipTest('test method needs writing')
+end
+
+
+-- love.graphics.circle
+love.test.graphics.circle = function(test)
+  test:skipTest('test method needs writing')
+end
+
+
+-- love.graphics.clear
+love.test.graphics.clear = function(test)
+  test:skipTest('test method needs writing')
+end
+
+
+-- love.graphics.discard
+love.test.graphics.discard = function(test)
+  test:skipTest('test method needs writing')
+end
+
+
+-- love.graphics.draw
+love.test.graphics.draw = function(test)
+  test:skipTest('test method needs writing')
+end
+
+
+-- love.graphics.drawInstanced
+love.test.graphics.drawInstanced = function(test)
+  test:skipTest('test method needs writing')
+end
+
+
+-- love.graphics.drawLayer
+love.test.graphics.drawLayer = function(test)
+  test:skipTest('test method needs writing')
+end
+
+
+-- love.graphics.ellipse
+love.test.graphics.ellipse = function(test)
+  test:skipTest('test method needs writing')
+end
+
+
+-- love.graphics.flushBatch
+love.test.graphics.flushBatch = function(test)
+  test:skipTest('test method needs writing')
+end
+
+
+-- love.graphics.line
+love.test.graphics.line = function(test)
+  test:skipTest('test method needs writing')
+end
+
+
+-- love.graphics.points
+love.test.graphics.points = function(test)
+  test:skipTest('test method needs writing')
+end
+
+
+-- love.graphics.polygon
+love.test.graphics.polygon = function(test)
+  test:skipTest('test method needs writing')
+end
+
+
+-- love.graphics.present
+love.test.graphics.present = function(test)
+  test:skipTest('test method needs writing')
+end
+
+
+-- love.graphics.print
+love.test.graphics.print = function(test)
+  test:skipTest('test method needs writing')
+end
+
+
+-- love.graphics.printf
+love.test.graphics.printf = function(test)
+  test:skipTest('test method needs writing')
+end
+
 
 
 -- love.graphics.rectangle
 -- love.graphics.rectangle
 love.test.graphics.rectangle = function(test)
 love.test.graphics.rectangle = function(test)
@@ -43,116 +136,985 @@ love.test.graphics.rectangle = function(test)
     black = {{1,1},{1,14},{3,1},{9,1},{3,14},{9,14},{11,1},{14,1},{11,14},{14,14}}
     black = {{1,1},{1,14},{3,1},{9,1},{3,14},{9,14},{11,1},{14,1},{11,14},{14,14}}
   }
   }
   test:assertPixels(imgdata2, comparepixels, 'line')
   test:assertPixels(imgdata2, comparepixels, 'line')
-  -- -- write to save data for sanity checking
-  -- imgdata1:encode('png', 'love_test_graphics_rectangle_actual1.png')
-  -- imgdata2:encode('png', 'love_test_graphics_rectangle_actual2.png')
-  imgdata1:release()
-  imgdata2:release()
 end
 end
 
 
--- love.graphics.arc
--- love.graphics.circle
--- love.graphics.clear
--- love.graphics.discard
--- love.graphics.draw
--- love.graphics.drawInstanced
--- love.graphics.drawInstanced
--- love.graphics.drawLayer
--- love.graphics.ellipse
--- love.graphics.flushBatch
--- love.graphics.line
--- love.graphics.points
--- love.graphics.polygon
--- love.graphics.present
--- love.graphics.print
--- love.graphics.printf
--- love.graphics.rectangle
+
+--------------------------------------------------------------------------------
+--------------------------------------------------------------------------------
+--------------------------------OBJECT CREATION---------------------------------
+--------------------------------------------------------------------------------
+--------------------------------------------------------------------------------
+
 
 
 -- love.graphics.captureScreenshot
 -- love.graphics.captureScreenshot
+-- @NOTE could test this but not with current setup as we need to wait for the 
+-- draw frame to finish before we could assert the file was created
+love.test.graphics.captureScreenshot = function(test)
+  test:skipTest('cant test this worked (easily)')
+end
+
+
 -- love.graphics.newArrayImage
 -- love.graphics.newArrayImage
+-- @NOTE this is just basic nil checking, full obj test are in objects.lua
+love.test.graphics.newArrayImage = function(test)
+  test:assertObject(love.graphics.newArrayImage({
+    'resources/love.png', 'resources/love2.png', 'resources/love3.png'
+  }))
+end
+
 -- love.graphics.newCanvas
 -- love.graphics.newCanvas
+-- @NOTE this is just basic nil checking, full obj test are in objects.lua
+love.test.graphics.newCanvas = function(test)
+  test:assertObject(love.graphics.newCanvas(16, 16, {
+    type = '2d',
+    format = 'normal',
+    readable = true,
+    msaa = 0,
+    dpiscale = 1,
+    mipmaps = 'none'
+  }))
+  test:assertObject(love.graphics.newCanvas(1000, 1000))
+end
+
+
 -- love.graphics.newCubeImage
 -- love.graphics.newCubeImage
+-- @NOTE this is just basic nil checking, full obj test are in objects.lua
+love.test.graphics.newCubeImage = function(test)
+  test:assertObject(love.graphics.newCubeImage('resources/cubemap.png', {
+    mipmaps = false,
+    linear = false
+  }))
+end
+
+
 -- love.graphics.newFont
 -- love.graphics.newFont
+-- @NOTE this is just basic nil checking, full obj test are in objects.lua
+love.test.graphics.newFont = function(test)
+  test:assertObject(love.graphics.newFont('resources/font.ttf'))
+  test:assertObject(love.graphics.newFont('resources/font.ttf', 8, "normal", 1))
+end
+
+
 -- love.graphics.newImage
 -- love.graphics.newImage
+-- @NOTE this is just basic nil checking, full obj test are in objects.lua
+love.test.graphics.newImage = function(test)
+  test:assertObject(love.graphics.newImage('resources/love.png', {
+    mipmaps = false,
+    linear = false,
+    dpiscale = 1
+  }))
+end
+
+
 -- love.graphics.newImageFont
 -- love.graphics.newImageFont
+-- @NOTE this is just basic nil checking, full obj test are in objects.lua
+love.test.graphics.newImageFont = function(test)
+  test:assertObject(love.graphics.newImageFont('resources/love.png', 'ABCD', 1))
+end
+
+
 -- love.graphics.newMesh
 -- love.graphics.newMesh
+-- @NOTE this is just basic nil checking, full obj test are in objects.lua
+love.test.graphics.newMesh = function(test)
+  test:assertObject(love.graphics.newMesh({{1, 1, 0, 0, 1, 1, 1, 1}}, 'fan', 'dynamic'))
+end
+
+
 -- love.graphics.newParticleSystem
 -- love.graphics.newParticleSystem
+-- @NOTE this is just basic nil checking, full obj test are in objects.lua
+love.test.graphics.newParticleSystem = function(test)
+  local imgdata = love.graphics.newImage('resources/love.png')
+  test:assertObject(love.graphics.newParticleSystem(imgdata, 1000))
+end
+
+
 -- love.graphics.newQuad
 -- love.graphics.newQuad
+-- @NOTE this is just basic nil checking, full obj test are in objects.lua
+love.test.graphics.newQuad = function(test)
+  local imgdata = love.graphics.newImage('resources/love.png')
+  test:assertObject(love.graphics.newQuad(0, 0, 16, 16, imgdata))
+end
+
+
 -- love.graphics.newShader
 -- love.graphics.newShader
+-- @NOTE this is just basic nil checking, full obj test are in objects.lua
+love.test.graphics.newShader = function(test)
+  local pixelcode = 'vec4 effect(vec4 color, Image tex, vec2 texture_coords, vec2 screen_coords) { vec4 texturecolor = Texel(tex, texture_coords); return texturecolor * color;}'
+  local vertexcode = 'vec4 position(mat4 transform_projection, vec4 vertex_position) { return transform_projection * vertex_position; }'
+  test:assertObject(love.graphics.newShader(pixelcode, vertexcode))
+end
+
+
 -- love.graphics.newSpriteBatch
 -- love.graphics.newSpriteBatch
+-- @NOTE this is just basic nil checking, full obj test are in objects.lua
+love.test.graphics.newSpriteBatch = function(test)
+  local imgdata = love.graphics.newImage('resources/love.png')
+  test:assertObject(love.graphics.newSpriteBatch(imgdata, 1000))
+end
+
+
 -- love.graphics.newText
 -- love.graphics.newText
+-- @NOTE this is just basic nil checking, full obj test are in objects.lua
+love.test.graphics.newTextBatch = function(test)
+  local font = love.graphics.newFont('resources/font.ttf')
+  test:assertObject(love.graphics.newTextBatch(font, 'helloworld'))
+end
+
+
 -- love.graphics.newVideo
 -- love.graphics.newVideo
+-- @NOTE this is just basic nil checking, full obj test are in objects.lua
+love.test.graphics.newVideo = function(test)
+  test:assertObject(love.graphics.newVideo('resources/sample.ogv', {
+    audio = false,
+    dpiscale = 1
+  }))
+end
+
+
 -- love.graphics.newVolumeImage
 -- love.graphics.newVolumeImage
--- love.graphics.setNewFont
+-- @NOTE this is just basic nil checking, full obj test are in objects.lua
+love.test.graphics.newVolumeImage = function(test)
+  test:assertObject(love.graphics.newVolumeImage({
+    'resources/love.png', 'resources/love2.png', 'resources/love3.png'
+  }, {
+    mipmaps = false,
+    linear = false
+  }))
+end
+
+
 -- love.graphics.validateShader
 -- love.graphics.validateShader
+love.test.graphics.validateShader = function(test)
+  local pixelcode = 'vec4 effect(vec4 color, Image tex, vec2 texture_coords, vec2 screen_coords) { vec4 texturecolor = Texel(tex, texture_coords); return texturecolor * color;}'
+  local vertexcode = 'vec4 position(mat4 transform_projection, vec4 vertex_position) { return transform_projection * vertex_position; }'
+  -- check made up code first
+  local status, _ = love.graphics.validateShader(true, 'nothing here', 'or here')
+  test:assertEquals(false, status, 'check invalid shader code')
+  -- check real code 
+  status, _ = love.graphics.validateShader(true, pixelcode, vertexcode)
+  test:assertEquals(true, status, 'check valid shader code')
+end
+
+
+--------------------------------------------------------------------------------
+--------------------------------------------------------------------------------
+---------------------------------GRAPHICS STATE---------------------------------
+--------------------------------------------------------------------------------
+--------------------------------------------------------------------------------
+
 
 
 -- love.graphics.getBackgroundColor
 -- love.graphics.getBackgroundColor
+love.test.graphics.getBackgroundColor = function(test)
+  -- check default bg is black
+  local r, g, b, a = love.graphics.getBackgroundColor()
+  test:assertEquals(0, r, 'check default background r')
+  test:assertEquals(0, g, 'check default background g')
+  test:assertEquals(0, b, 'check default background b')
+  test:assertEquals(1, a, 'check default background a')
+  -- check set value returns correctly
+  love.graphics.setBackgroundColor(1, 1, 1, 0)
+  r, g, b, a = love.graphics.getBackgroundColor()
+  test:assertEquals(1, r, 'check updated background r')
+  test:assertEquals(1, g, 'check updated background g')
+  test:assertEquals(1, b, 'check updated background b')
+  test:assertEquals(0, a, 'check updated background a')
+  love.graphics.setBackgroundColor(0, 0, 0, 1) -- reset
+end
+
+
 -- love.graphics.getBlendMode
 -- love.graphics.getBlendMode
+love.test.graphics.getBlendMode = function(test)
+  -- check default blend mode
+  local mode, alphamode = love.graphics.getBlendMode()
+  test:assertEquals('alpha', mode, 'check default blend mode')
+  test:assertEquals('alphamultiply', alphamode, 'check default alpha blend')
+  -- check set mode returns correctly
+  love.graphics.setBlendMode('add', 'premultiplied')
+  mode, alphamode = love.graphics.getBlendMode()
+  test:assertEquals('add', mode, 'check changed blend mode')
+  test:assertEquals('premultiplied', alphamode, 'check changed alpha blend')
+  love.graphics.setBlendMode('alpha', 'alphamultiply') -- reset
+end
+
+
 -- love.graphics.getCanvas
 -- love.graphics.getCanvas
+love.test.graphics.getCanvas = function(test)
+  -- by default should be nil if drawing to real screen
+  test:assertEquals(nil, love.graphics.getCanvas(), 'check no canvas set')
+  -- should return not nil when we target a canvas
+  local canvas = love.graphics.newCanvas(16, 16)
+  love.graphics.setCanvas(canvas)
+  test:assertObject(love.graphics.getCanvas())
+  love.graphics.setCanvas()
+end
+
+
 -- love.graphics.getColor
 -- love.graphics.getColor
+love.test.graphics.getColor = function(test)
+  -- by default should be white
+  local r, g, b, a = love.graphics.getColor()
+  test:assertEquals(1, r, 'check default color r')
+  test:assertEquals(1, g, 'check default color g')
+  test:assertEquals(1, b, 'check default color b')
+  test:assertEquals(1, a, 'check default color a')
+  -- check set color is returned correctly
+  love.graphics.setColor(0, 0, 0, 0)
+  r, g, b, a = love.graphics.getColor()
+  test:assertEquals(0, r, 'check changed color r')
+  test:assertEquals(0, g, 'check changed color g')
+  test:assertEquals(0, b, 'check changed color b')
+  test:assertEquals(0, a, 'check changed color a')
+  love.graphics.setColor(1, 1, 1, 1) -- reset
+end
+
+
 -- love.graphics.getColorMask
 -- love.graphics.getColorMask
+love.test.graphics.getColorMask = function(test)
+  -- by default should all be active
+  local r, g, b, a = love.graphics.getColorMask()
+  test:assertEquals(true, r, 'check default color mask r')
+  test:assertEquals(true, g, 'check default color mask g')
+  test:assertEquals(true, b, 'check default color mask b')
+  test:assertEquals(true, a, 'check default color mask a')
+  -- check set color mask is returned correctly
+  love.graphics.setColorMask(false, false, true, false)
+  r, g, b, a = love.graphics.getColorMask()
+  test:assertEquals(false, r, 'check changed color mask r')
+  test:assertEquals(false, g, 'check changed color mask g')
+  test:assertEquals(true,  b, 'check changed color mask b')
+  test:assertEquals(false, a, 'check changed color mask a')
+  love.graphics.setColorMask(true, true, true, true) -- reset
+end
+
+
 -- love.graphics.getDefaultFilter
 -- love.graphics.getDefaultFilter
+love.test.graphics.getDefaultFilter = function(test)
+  -- we set this already for testsuite so we know what it should be
+  local min, mag, anisotropy = love.graphics.getDefaultFilter()
+  test:assertEquals('nearest', min, 'check default filter min')
+  test:assertEquals('nearest', mag, 'check default filter mag')
+  test:assertEquals(1, anisotropy, 'check default filter mag')
+end
+
+
 -- love.graphics.getDepthMode
 -- love.graphics.getDepthMode
+love.test.graphics.getDepthMode = function(test)
+  -- by default should be always/write
+  local comparemode, write = love.graphics.getDepthMode()
+  test:assertEquals('always', comparemode, 'check default compare depth')
+  test:assertEquals(false, write, 'check default depth buffer write')
+end
+
+
 -- love.graphics.getFont
 -- love.graphics.getFont
+love.test.graphics.getFont = function(test)
+  test:assertObject(love.graphics.getFont())
+end
+
+
 -- love.graphics.getFrontFaceWinding
 -- love.graphics.getFrontFaceWinding
+love.test.graphics.getFrontFaceWinding = function(test)
+  -- check default winding
+  test:assertEquals('ccw', love.graphics.getFrontFaceWinding())
+  -- check setting value changes it correctly
+  love.graphics.setFrontFaceWinding('cw')
+  test:assertEquals('cw', love.graphics.getFrontFaceWinding())
+  love.graphics.setFrontFaceWinding('ccw') -- reset
+end
+
+
 -- love.graphics.getLineJoin
 -- love.graphics.getLineJoin
+love.test.graphics.getLineJoin = function(test)
+  -- check default line join
+  test:assertEquals('miter', love.graphics.getLineJoin())
+  -- check set value returned correctly
+  love.graphics.setLineJoin('none')
+  test:assertEquals('none', love.graphics.getLineJoin())
+  love.graphics.setLineJoin('miter') -- reset
+end
+
+
 -- love.graphics.getLineStyle
 -- love.graphics.getLineStyle
+love.test.graphics.getLineStyle = function(test)
+  -- we know this should be as testsuite sets it!
+  test:assertEquals('rough', love.graphics.getLineStyle())
+  -- check set value returned correctly
+  love.graphics.setLineStyle('smooth')
+  test:assertEquals('smooth', love.graphics.getLineStyle())
+  love.graphics.setLineStyle('rough') -- reset
+end
+
+
 -- love.graphics.getLineWidth
 -- love.graphics.getLineWidth
+love.test.graphics.getLineWidth = function(test)
+  -- we know this should be as testsuite sets it!
+  test:assertEquals(1, love.graphics.getLineWidth())
+  -- check set value returned correctly
+  love.graphics.setLineWidth(10)
+  test:assertEquals(10, love.graphics.getLineWidth())
+  love.graphics.setLineWidth(1) -- reset
+end
+
+
 -- love.graphics.getMeshCullMode
 -- love.graphics.getMeshCullMode
+love.test.graphics.getMeshCullMode = function(test)
+  -- get default mesh culling
+  test:assertEquals('none', love.graphics.getMeshCullMode())
+  -- check set value returned correctly
+  love.graphics.setMeshCullMode('front')
+  test:assertEquals('front', love.graphics.getMeshCullMode())
+  love.graphics.setMeshCullMode('back') -- reset
+end
+
+
 -- love.graphics.getPointSize
 -- love.graphics.getPointSize
+love.test.graphics.getPointSize = function(test)
+  -- get default point size
+  test:assertEquals(1, love.graphics.getPointSize())
+  -- check set value returned correctly
+  love.graphics.setPointSize(10)
+  test:assertEquals(10, love.graphics.getPointSize())
+  love.graphics.setPointSize(1) -- reset
+end
+
+
 -- love.graphics.getScissor
 -- love.graphics.getScissor
+love.test.graphics.getScissor = function(test)
+  -- should be no scissor atm
+  local x, y, w, h = love.graphics.getScissor()
+  test:assertEquals(nil, x, 'check no scissor')
+  test:assertEquals(nil, y, 'check no scissor')
+  test:assertEquals(nil, w, 'check no scissor')
+  test:assertEquals(nil, h, 'check no scissor')
+  -- check set value returned correctly
+  love.graphics.setScissor(0, 0, 16, 16)
+  x, y, w, h = love.graphics.getScissor()
+  test:assertEquals(0, x, 'check scissor set')
+  test:assertEquals(0, y, 'check scissor set')
+  test:assertEquals(16, w, 'check scissor set')
+  test:assertEquals(16, h, 'check scissor set')
+  love.graphics.setScissor() -- reset
+end
+
+
 -- love.graphics.getShader
 -- love.graphics.getShader
+love.test.graphics.getShader = function(test)
+  -- should be no shader active
+  test:assertEquals(nil, love.graphics.getShader(), 'check no active shader')
+end
+
+
 -- love.graphics.getStackDepth
 -- love.graphics.getStackDepth
--- love.graphics.getStencilTest
+love.test.graphics.getStackDepth = function(test)
+  -- by default should be none
+  test:assertEquals(0, love.graphics.getStackDepth(), 'check no transforms in stack')
+  -- now add 3
+  love.graphics.push()
+  love.graphics.push()
+  love.graphics.push()
+  test:assertEquals(3, love.graphics.getStackDepth(), 'check 3 transforms in stack')
+  -- now remove 2
+  love.graphics.pop()
+  love.graphics.pop()
+  test:assertEquals(1, love.graphics.getStackDepth(), 'check 1 transforms in stack')
+  -- now back to 0
+  love.graphics.pop()
+  test:assertEquals(0, love.graphics.getStackDepth(), 'check no transforms in stack')
+end
+
+
+-- love.graphics.getStencilMode
+love.test.graphics.getStencilMode = function(test)
+  -- check default vals
+  local action, comparemode, value = love.graphics.getStencilMode( )
+  test:assertEquals('keep', action, 'check default stencil action')
+  test:assertEquals('always', comparemode, 'check default stencil compare')
+  test:assertEquals(0, value, 'check default stencil value')
+  -- check set stencil values is returned
+  love.graphics.setStencilMode('replace', 'less', 255)
+  local action, comparemode, value = love.graphics.getStencilMode()
+  test:assertEquals('replace', action, 'check changed stencil action')
+  test:assertEquals('less', comparemode, 'check changed stencil compare')
+  test:assertEquals(255, value, 'check changed stencil value')
+  love.graphics.setStencilMode() -- reset
+end
+
+
 -- love.graphics.intersectScissor
 -- love.graphics.intersectScissor
+love.test.graphics.intersectScissor = function(test)
+  -- make a scissor for the left half, then interset to make the top half
+  -- then we should be able to fill the canvas with red and only top 4x4 is filled
+  local canvas = love.graphics.newCanvas(16, 16)
+  love.graphics.setCanvas(canvas)
+    love.graphics.clear(0, 0, 0, 1)
+    love.graphics.origin()
+    love.graphics.setScissor(0, 0, 8, 16)
+    love.graphics.intersectScissor(0, 0, 4, 4)
+    love.graphics.clear(1, 0, 0, 1)
+    love.graphics.setColor(1, 1, 1, 1)
+    love.graphics.setScissor()
+  love.graphics.setCanvas()
+  local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16})
+  test:assertPixels(imgdata, { 
+    red = {{0,0},{3,3}},
+    black ={{4,0},{0,4},{4,4}}
+  }, 'intersect scissor')
+end
+
+
 -- love.graphics.isActive
 -- love.graphics.isActive
+love.test.graphics.isActive = function(test)
+  test:assertEquals(true, love.graphics.isActive(), 'check graphics is active') -- i mean if you got this far
+end
+
+
 -- love.graphics.isGammaCorrect
 -- love.graphics.isGammaCorrect
--- love.graphics.isSupported
+love.test.graphics.isGammaCorrect = function(test)
+  -- we know the config so know this is false
+  test:assertEquals(false, love.graphics.isGammaCorrect(), 'check gamma correct false')
+end
+
+
 -- love.graphics.isWireframe
 -- love.graphics.isWireframe
+love.test.graphics.isWireframe = function(test)
+  -- check off by default
+  test:assertEquals(false, love.graphics.isWireframe(), 'check no wireframe by default')
+  -- check on when enabled
+  love.graphics.setWireframe(true)
+  test:assertEquals(true, love.graphics.isWireframe(), 'check wireframe is set')
+  love.graphics.setWireframe(false) -- reset
+end
+
+
 -- love.graphics.reset
 -- love.graphics.reset
+love.test.graphics.reset = function(test)
+  -- reset should reset current canvas and any colors/scissor
+  local canvas = love.graphics.newCanvas(16, 16)
+  love.graphics.setBackgroundColor(0, 0, 1, 1)
+  love.graphics.setColor(0, 1, 0, 1)
+  love.graphics.setCanvas(canvas)
+  love.graphics.reset()
+  local r, g, b, a = love.graphics.getBackgroundColor()
+  test:assertEquals(1, r+g+b+a, 'check background reset')
+  r, g, b, a = love.graphics.getColor()
+  test:assertEquals(4, r+g+b+a, 'check color reset')
+  test:assertEquals(nil, love.graphics.getCanvas(), 'check canvas reset')
+end
+
+
 -- love.graphics.setBackgroundColor
 -- love.graphics.setBackgroundColor
+love.test.graphics.setBackgroundColor = function(test)
+  -- check background is set
+  love.graphics.setBackgroundColor(1, 0, 0, 1)
+  local r, g, b, a = love.graphics.getBackgroundColor()
+  test:assertEquals(1, r, 'check set bg r')
+  test:assertEquals(0, g, 'check set bg g')
+  test:assertEquals(0, b, 'check set bg b')
+  test:assertEquals(1, a, 'check set bg a')
+end
+
+
 -- love.graphics.setBlendMode
 -- love.graphics.setBlendMode
+love.test.graphics.setBlendMode = function(test)
+  -- set mode, write to canvas, check output
+  test:skipTest('test method needs writing')
+end
+
+
 -- love.graphics.setCanvas
 -- love.graphics.setCanvas
+love.test.graphics.setCanvas = function(test)
+  -- make 2 canvas, set to each, draw one to the other, check output
+  test:skipTest('test method needs writing')
+end
+
+
 -- love.graphics.setColor
 -- love.graphics.setColor
+love.test.graphics.setColor = function(test)
+  -- set colors, draw rect, check color 
+  test:skipTest('test method needs writing')
+end
+
+
 -- love.graphics.setColorMask
 -- love.graphics.setColorMask
+love.test.graphics.setColorMask = function(test)
+  -- set mask, draw stuff, check output pixels
+  test:skipTest('test method needs writing')
+end
+
+
 -- love.graphics.setDefaultFilter
 -- love.graphics.setDefaultFilter
+love.test.graphics.setDefaultFilter = function(test)
+  -- check setting filter val works
+  love.graphics.setDefaultFilter('linear', 'linear', 1)
+  local min, mag, anisotropy = love.graphics.getDefaultFilter()
+  test:assertEquals('linear', min, 'check default filter min')
+  test:assertEquals('linear', mag, 'check default filter mag')
+  test:assertEquals(1, anisotropy, 'check default filter mag')
+  love.graphics.setDefaultFilter('nearest', 'nearest', 1) -- reset
+end
+
+
 -- love.graphics.setDepthMode
 -- love.graphics.setDepthMode
+love.test.graphics.setDepthMode = function(test)
+  test:skipTest('test method needs writing')
+end
+
+
 -- love.graphics.setFont
 -- love.graphics.setFont
+love.test.graphics.setFont = function(test)
+  test:skipTest('test method needs writing')
+end
+
+
 -- love.graphics.setFrontFaceWinding
 -- love.graphics.setFrontFaceWinding
+love.test.graphics.setFrontFaceWinding = function(test)
+  test:skipTest('test method needs writing')
+end
+
+
 -- love.graphics.setLineJoin
 -- love.graphics.setLineJoin
+love.test.graphics.setLineJoin = function(test)
+  test:skipTest('test method needs writing')
+end
+
+
 -- love.graphics.setLineStyle
 -- love.graphics.setLineStyle
+love.test.graphics.setLineStyle = function(test)
+  test:skipTest('test method needs writing')
+end
+
+
 -- love.graphics.setLineWidth
 -- love.graphics.setLineWidth
+love.test.graphics.setLineWidth = function(test)
+  test:skipTest('test method needs writing')
+end
+
+
 -- love.graphics.setMeshCullMode
 -- love.graphics.setMeshCullMode
--- love.graphics.setPointStyle
+love.test.graphics.setMeshCullMode = function(test)
+  test:skipTest('test method needs writing')
+end
+
+
 -- love.graphics.setScissor
 -- love.graphics.setScissor
+love.test.graphics.setScissor = function(test)
+  test:skipTest('test method needs writing')
+end
+
+
 -- love.graphics.setShader
 -- love.graphics.setShader
+love.test.graphics.setShader = function(test)
+  test:skipTest('test method needs writing')
+end
+
+
 -- love.graphics.setStencilTest
 -- love.graphics.setStencilTest
+love.test.graphics.setStencilMode = function(test)
+  test:skipTest('test method needs writing')
+end
+
+
 -- love.graphics.setWireframe
 -- love.graphics.setWireframe
+love.test.graphics.setWireframe = function(test)
+  test:skipTest('test method needs writing')
+end
+
+
+--------------------------------------------------------------------------------
+--------------------------------------------------------------------------------
+-------------------------------COORDINATE SYSTEM--------------------------------
+--------------------------------------------------------------------------------
+--------------------------------------------------------------------------------
+
 
 
 -- love.graphics.applyTransform
 -- love.graphics.applyTransform
+love.test.graphics.applyTransform = function(test)
+  -- use transform object to translate the drawn rectangle
+  local transform = love.math.newTransform()
+  transform:translate(10, 0)
+  local canvas = love.graphics.newCanvas(16, 16)
+  love.graphics.setCanvas(canvas)
+    love.graphics.clear(0, 0, 0, 1)
+    love.graphics.setColor(1, 0, 0, 1)
+    love.graphics.applyTransform(transform)
+    love.graphics.rectangle('fill', 0, 0, 1, 1)
+    love.graphics.setColor(1, 1, 1, 1)
+  love.graphics.setCanvas()
+  local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16})
+  test:assertPixels(imgdata, { red = {{10, 0}} }, 'apply transform 10')
+end
+
+
 -- love.graphics.inverseTransformPoint
 -- love.graphics.inverseTransformPoint
+love.test.graphics.inverseTransformPoint = function(test)
+  -- start with 0, 0
+  local sx, sy = love.graphics.inverseTransformPoint(0, 0)
+  test:assertEquals(0, sx, 'check starting x is 0')
+  test:assertEquals(0, sy, 'check starting y is 0')
+  -- check translation effects the point 
+  love.graphics.translate(1, 5)
+  sx, sy = love.graphics.inverseTransformPoint(1, 5)
+  test:assertEquals(0, sx, 'check transformed x is 0')
+  test:assertEquals(0, sy, 'check transformed y is 0')
+  love.graphics.origin()
+end
+
+
 -- love.graphics.origin
 -- love.graphics.origin
+love.test.graphics.origin = function(test)
+  -- if we do some translations and scaling
+  -- using .origin() should reset it all and draw the pixel at 0,0
+  local canvas = love.graphics.newCanvas(16, 16)
+  love.graphics.setCanvas(canvas)
+    love.graphics.clear(0, 0, 0, 1)
+    love.graphics.origin()
+    love.graphics.translate(10, 10)
+    love.graphics.scale(1, 1)
+    love.graphics.shear(20, 20)
+    love.graphics.origin()
+    love.graphics.setColor(1, 0, 0, 1)
+    love.graphics.rectangle('fill', 0, 0, 1, 1)
+    love.graphics.setColor(1, 1, 1, 1)
+  love.graphics.setCanvas()
+  local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16})
+  test:assertPixels(imgdata, { red = {{0, 0}} }, 'origin check')
+end
+
+
 -- love.graphics.pop
 -- love.graphics.pop
+love.test.graphics.pop = function(test)
+  -- if we push at the start, and then run a pop
+  -- it should reset it all and draw the pixel at 0,0
+  local canvas = love.graphics.newCanvas(16, 16)
+  love.graphics.setCanvas(canvas)
+    love.graphics.clear(0, 0, 0, 1)
+    love.graphics.push()
+    love.graphics.translate(10, 10)
+    love.graphics.scale(1, 1)
+    love.graphics.shear(20, 20)
+    love.graphics.pop()
+    love.graphics.setColor(1, 0, 0, 1)
+    love.graphics.rectangle('fill', 0, 0, 1, 1)
+    love.graphics.setColor(1, 1, 1, 1)
+  love.graphics.setCanvas()
+  local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16})
+  test:assertPixels(imgdata, { red = {{0, 0}} }, 'pop 1')
+end
+
+
 -- love.graphics.push
 -- love.graphics.push
+love.test.graphics.push = function(test)
+  -- if we push at the start, do some stuff, then another push
+  -- 1 pop should only go back 1 push and draw the pixel at 1, 1
+  local canvas = love.graphics.newCanvas(16, 16)
+  love.graphics.setCanvas(canvas)
+    love.graphics.clear(0, 0, 0, 1)
+    love.graphics.push()
+    love.graphics.scale(1, 1)
+    love.graphics.shear(20, 20)
+    love.graphics.push()
+    love.graphics.translate(1, 1)
+    love.graphics.pop()
+    love.graphics.setColor(1, 0, 0, 1)
+    love.graphics.rectangle('fill', 0, 0, 1, 1)
+    love.graphics.setColor(1, 1, 1, 1)
+  love.graphics.setCanvas()
+  local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16})
+  test:assertPixels(imgdata, { red = {{1, 1}} }, 'push 1')
+end
+
+
 -- love.graphics.replaceTransform
 -- love.graphics.replaceTransform
+love.test.graphics.replaceTransform = function(test)
+  -- if use transform object to translate
+  -- set some normal transforms first which should get overwritten
+  local transform = love.math.newTransform()
+  transform:translate(10, 0)
+  local canvas = love.graphics.newCanvas(16, 16)
+  love.graphics.setCanvas(canvas)
+    love.graphics.clear(0, 0, 0, 1)
+    love.graphics.setColor(1, 0, 0, 1)
+    love.graphics.scale(2, 2)
+    love.graphics.translate(10, 10)
+    love.graphics.replaceTransform(transform)
+    love.graphics.rectangle('fill', 0, 0, 1, 1)
+    love.graphics.setColor(1, 1, 1, 1)
+  love.graphics.setCanvas()
+  local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16})
+  test:assertPixels(imgdata, { red = {{10, 0}} }, 'replace transform 10')
+end
+
+
 -- love.graphics.rotate
 -- love.graphics.rotate
+love.test.graphics.rotate = function(test)
+  -- starting at 0,0, we rotate by 90deg and then draw
+  -- we can then check the drawn rectangle is rotated
+  local canvas = love.graphics.newCanvas(16, 16)
+  love.graphics.setCanvas(canvas)
+    love.graphics.clear(0, 0, 0, 1)
+    love.graphics.setColor(1, 0, 0, 1)
+    love.graphics.translate(4, 0)
+    love.graphics.rotate(90 * (math.pi/180))
+    love.graphics.rectangle('fill', 0, 0, 4, 4)
+    love.graphics.setColor(1, 1, 1, 1)
+  love.graphics.setCanvas()
+  local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16})
+  test:assertPixels(imgdata, { red = {{0,0},{3,0},{3,3},{0,3}} }, 'rotate 90')
+  imgdata:encode('png', 'rotate.png')
+end
+
+
 -- love.graphics.scale
 -- love.graphics.scale
+love.test.graphics.scale = function(test)
+  -- starting at 0,0, we scale by 4x and then draw
+  -- we can then check the drawn rectangle covers the whole canvas
+  local canvas = love.graphics.newCanvas(16, 16)
+  love.graphics.setCanvas(canvas)
+    love.graphics.clear(0, 0, 0, 1)
+    love.graphics.setColor(1, 0, 0, 1)
+    love.graphics.scale(4, 4)
+    love.graphics.rectangle('fill', 0, 0, 4, 4)
+    love.graphics.setColor(1, 1, 1, 1)
+  love.graphics.setCanvas()
+  local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16})
+  test:assertPixels(imgdata, { red = {{1,1},{1,15},{15,1},{15,15}} }, 'scale 4x')
+end
+
+
 -- love.graphics.shear
 -- love.graphics.shear
+love.test.graphics.shear = function(test)
+  -- starting at 0,0, we shear by 2x and then draw
+  -- we can then check the drawn rectangle has moved over
+  local canvas = love.graphics.newCanvas(16, 16)
+  love.graphics.setCanvas(canvas)
+    love.graphics.clear(0, 0, 0, 1)
+    love.graphics.origin()
+    love.graphics.setColor(1, 0, 0, 1)
+    love.graphics.shear(2, 0)
+    love.graphics.rectangle('fill', 0, 0, 4, 4)
+    love.graphics.setColor(1, 1, 1, 1)
+  love.graphics.setCanvas()
+  local imgdata1 = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16})
+  test:assertPixels(imgdata1, { red = {{1,0},{4,0},{7,3},{10,3}} }, 'shear x')
+  -- same again at 0,0, we shear by 2y and then draw
+  -- we can then check the drawn rectangle has moved down
+  love.graphics.setCanvas(canvas)
+    love.graphics.clear(0, 0, 0, 1)
+    love.graphics.origin()
+    love.graphics.setColor(1, 0, 0, 1)
+    love.graphics.shear(0, 2)
+    love.graphics.rectangle('fill', 0, 0, 4, 4)
+    love.graphics.setColor(1, 1, 1, 1)
+  love.graphics.setCanvas()
+  local imgdata2 = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16})
+  test:assertPixels(imgdata2, { red = { {0,1},{0,4},{3,7},{3,10}} }, 'shear y')
+end
+
+
 -- love.graphics.transformPoint
 -- love.graphics.transformPoint
+love.test.graphics.transformPoint = function(test)
+  -- start with 0, 0
+  local sx, sy = love.graphics.transformPoint(0, 0)
+  test:assertEquals(0, sx, 'check starting x is 0')
+  test:assertEquals(0, sy, 'check starting y is 0')
+  -- check translation effects the point 
+  love.graphics.translate(1, 5)
+  sx, sy = love.graphics.transformPoint(0, 0)
+  test:assertEquals(1, sx, 'check transformed x is 0')
+  test:assertEquals(5, sy, 'check transformed y is 10')
+end
+
+
 -- love.graphics.translate
 -- love.graphics.translate
+love.test.graphics.translate = function(test)
+  -- starting at 0,0, we translate 4 times and draw a pixel at each point
+  -- we can then check the 4 points are now red
+  local canvas = love.graphics.newCanvas(16, 16)
+  love.graphics.setCanvas(canvas)
+    love.graphics.clear(0, 0, 0, 1)
+    love.graphics.setColor(1, 0, 0, 1)
+    love.graphics.translate(5, 0)
+    love.graphics.rectangle('fill', 0, 0, 1, 1)
+    love.graphics.translate(0, 5)
+    love.graphics.rectangle('fill', 0, 0, 1, 1)
+    love.graphics.translate(-5, 0)
+    love.graphics.rectangle('fill', 0, 0, 1, 1)
+    love.graphics.translate(0, -5)
+    love.graphics.rectangle('fill', 0, 0, 1, 1)
+    love.graphics.setColor(1, 1, 1, 1)
+  love.graphics.setCanvas()
+  local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16})
+  test:assertPixels(imgdata, { red = {{5,0},{0,5},{5,5},{0,0}} }, 'translate 4x')
+end
+
+
+--------------------------------------------------------------------------------
+--------------------------------------------------------------------------------
+-------------------------------------WINDOW-------------------------------------
+--------------------------------------------------------------------------------
+--------------------------------------------------------------------------------
+
 
 
 -- love.graphics.getDPIScale
 -- love.graphics.getDPIScale
+-- @NOTE hardware dependent so can't check result
+love.test.graphics.getDPIScale = function(test)
+  test:assertNotNil(love.graphics.getDPIScale())
+end
+
+
 -- love.graphics.getDimensions
 -- love.graphics.getDimensions
+love.test.graphics.getDimensions = function(test)
+  -- check graphics dimensions match window dimensions 
+  local gwidth, gheight = love.graphics.getDimensions()
+  local wwidth, wheight, _ = love.window.getMode()
+  test:assertEquals(wwidth, gwidth, 'check graphics dimension w matches window w')
+  test:assertEquals(wheight, gheight, 'check graphics dimension h matches window h')
+end
+
+
 -- love.graphics.getHeight
 -- love.graphics.getHeight
+love.test.graphics.getHeight = function(test)
+  -- check graphics height match window height 
+  local wwidth, wheight, _ = love.window.getMode()
+  test:assertEquals(wheight, love.graphics.getHeight(), 'check graphics h matches window h')
+end
+
+
 -- love.graphics.getPixelDimensions
 -- love.graphics.getPixelDimensions
+love.test.graphics.getPixelDimensions = function(test)
+  -- check graphics dimensions match window dimensions relative to dpi
+  local dpi = love.graphics.getDPIScale()
+  local gwidth, gheight = love.graphics.getPixelDimensions()
+  local wwidth, wheight, _ = love.window.getMode()
+  test:assertEquals(wwidth, gwidth/dpi, 'check graphics pixel dpi w matches window w')
+  test:assertEquals(wheight, gheight/dpi, 'check graphics pixel dpi h matches window h')
+end
+
+
 -- love.graphics.getPixelHeight
 -- love.graphics.getPixelHeight
+love.test.graphics.getPixelHeight = function(test)
+  -- check graphics height match window height relative to dpi
+  local dpi = love.graphics.getDPIScale()
+  local wwidth, wheight, _ = love.window.getMode()
+  test:assertEquals(wheight,love.graphics.getPixelHeight()/dpi, 'check graphics pixel dpi h matches window h')
+end
+
+
 -- love.graphics.getPixelWidth
 -- love.graphics.getPixelWidth
+love.test.graphics.getPixelWidth = function(test)
+  -- check graphics width match window width relative to dpi
+  local dpi = love.graphics.getDPIScale()
+  local wwidth, wheight, _ = love.window.getMode()
+  test:assertEquals(wwidth, love.graphics.getWidth()/dpi, 'check graphics pixel dpi w matches window w')
+end
+
+
 -- love.graphics.getWidth
 -- love.graphics.getWidth
+love.test.graphics.getWidth = function(test)
+  -- check graphics width match window width 
+  local wwidth, wheight, _ = love.window.getMode()
+  test:assertEquals(wwidth, love.graphics.getWidth(), 'check graphics w matches window w')
+end
+
+
+--------------------------------------------------------------------------------
+--------------------------------------------------------------------------------
+-------------------------------SYSTEM INFORMATION-------------------------------
+--------------------------------------------------------------------------------
+--------------------------------------------------------------------------------
+
+
+-- love.graphics.getTextureFormats
+love.test.graphics.getTextureFormats = function(test)
+  local formats = {
+    'hdr', 'r8i', 'r8ui', 'r16i', 'r16ui', 'r32i', 'r32ui', 'rg8i', 'rg8ui',
+    'rg16i', 'rg16ui', 'rg32i', 'rg32ui', 'bgra8', 'r8', 'rgba8i', 'rgba8ui',
+    'rgba16i', 'rg8', 'rgba32i', 'rgba32ui', 'rgba8', 'DXT1', 'r16', 'DXT5',
+    'rg16', 'BC4s', 'rgba16', 'BC5s', 'r16f', 'BC6hs', 'BC7', 'PVR1rgb2',
+    'rg16f', 'PVR1rgba2', 'rgba16f', 'ETC1', 'r32f', 'ETC2rgba', 'rg32f',
+    'EACr', 'rgba32f', 'EACrg', 'rgba4', 'ASTC4x4', 'ASTC5x4', 'rgb5a1',
+    'ASTC6x5', 'rgb565', 'ASTC8x5', 'ASTC8x6', 'rgb10a2', 'ASTC10x5',
+    'rg11b10f', 'ASTC10x8', 'ASTC10x10', 'ASTC12x10', 'ASTC12x12', 'normal',
+    'srgba8', 'la8', 'ASTC10x6', 'ASTC8x8', 'ASTC6x6', 'ASTC5x5', 'EACrgs',
+    'EACrs', 'ETC2rgba1', 'ETC2rgb', 'PVR1rgba4', 'PVR1rgb4', 'BC6h',
+    'BC5', 'BC4', 'DXT3', 'stencil8', 'rgba16ui', 'bgra8srgb'
+  }
+  local supported = love.graphics.getTextureFormats({ canvas = true })
+  test:assertNotNil(supported)
+  for f=1,#formats do
+    test:assertNotEquals(nil, supported[formats[f] ], 'expected a key for format: ' .. formats[f])
+  end
+end
+
 
 
--- love.graphics.getCanvasformats
--- love.graphics.getImageFormats
 -- love.graphics.getRendererInfo
 -- love.graphics.getRendererInfo
+-- @NOTE hardware dependent so best can do is nil checking
+love.test.graphics.getRendererInfo = function(test)
+  local name, version, vendor, device = love.graphics.getRendererInfo()
+  test:assertNotNil(name)
+  test:assertNotNil(version)
+  test:assertNotNil(vendor)
+  test:assertNotNil(device)
+end
+
+
 -- love.graphics.getStats
 -- love.graphics.getStats
+-- @NOTE cant really predict some of these so just nil check for most
+love.test.graphics.getStats = function(test)
+  local stattypes = {
+    'drawcalls', 'canvasswitches', 'texturememory', 'shaderswitches',
+    'drawcallsbatched', 'textures', 'fonts'
+  }
+  local stats = love.graphics.getStats()
+  for s=1,#stattypes do
+    test:assertNotEquals(nil, stats[stattypes[s] ], 'expected a key for stat: ' .. stattypes[s])
+  end
+end
+
+
 -- love.graphics.getSupported
 -- love.graphics.getSupported
+love.test.graphics.getSupported = function(test)
+  -- cant check values as hardware dependent but we can check the keys in the 
+  -- table match what the documentation lists
+  local gfs = {
+    'clampzero', 'lighten', 'glsl3', 'instancing', 'fullnpot', 
+    'pixelshaderhighp', 'shaderderivatives', 'indirectdraw', 'mipmaprange',
+    'copyrendertargettobuffer', 'copytexturetobuffer', 'copybuffer',
+    'indexbuffer32bit', 'multirendertargetformats', 'clampone', 'blendminmax',
+    'glsl4'
+  }
+  local features = love.graphics.getSupported()
+  for g=1,#gfs do
+    test:assertNotEquals(nil, features[gfs[g] ], 'expected a key for graphic feature: ' .. gfs[g])
+  end
+end
+
+
 -- love.graphics.getSystemLimits
 -- love.graphics.getSystemLimits
--- love.graphics.getTextureTypes
+love.test.graphics.getSystemLimits = function(test)
+  -- cant check values as hardware dependent but we can check the keys in the 
+  -- table match what the documentation lists
+  local glimits = {
+    'texelbuffersize', 'shaderstoragebuffersize', 'threadgroupsx', 
+    'threadgroupsy', 'pointsize', 'texturesize', 'texturelayers', 'volumetexturesize',
+    'cubetexturesize', 'anisotropy', 'texturemsaa', 'rendertargets', 'threadgroupsz'
+  }
+  local limits = love.graphics.getSystemLimits()
+  for g=1,#glimits do
+    test:assertNotEquals(nil, limits[glimits[g] ], 'expected a key for system limit: ' .. glimits[g])
+  end
+end
+
+
+-- love.graphics.getTextureTypes
+love.test.graphics.getTextureTypes = function(test)
+  -- cant check values as hardware dependent but we can check the keys in the 
+  -- table match what the documentation lists
+  local ttypes = {
+    '2d', 'array', 'cube', 'volume'
+  }
+  local types = love.graphics.getTextureTypes()
+  for t=1,#ttypes do
+    test:assertNotEquals(nil, types[ttypes[t] ], 'expected a key for texture type: ' .. ttypes[t])
+  end
+end

+ 7 - 12
testing/tests/image.lua

@@ -4,28 +4,23 @@
 -- love.image.isCompressed
 -- love.image.isCompressed
 -- @NOTE really we need to test each of the files listed here:
 -- @NOTE really we need to test each of the files listed here:
 -- https://love2d.org/wiki/CompressedImageFormat
 -- https://love2d.org/wiki/CompressedImageFormat
+-- also need to be platform dependent (e.g. dxt not suppored on phones)
 love.test.image.isCompressed = function(test)
 love.test.image.isCompressed = function(test)
-  local compressed = love.image.isCompressed('resources/love.dxt1')
-  test:assertEquals(true, compressed, 'check dxt1 valid compressed image')
+  test:assertEquals(true, love.image.isCompressed('resources/love.dxt1'), 
+    'check dxt1 valid compressed image')
 end
 end
 
 
 
 
 -- love.image.newCompressedData
 -- love.image.newCompressedData
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 love.test.image.newCompressedData = function(test)
 love.test.image.newCompressedData = function(test)
-  local imgdata = love.image.newCompressedData('resources/love.dxt1')
-  test:assertObject(imgdata)
-  imgdata:release()
+  test:assertObject(love.image.newCompressedData('resources/love.dxt1'))
 end
 end
 
 
 
 
 -- love.image.newImageData
 -- love.image.newImageData
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 love.test.image.newImageData = function(test)
 love.test.image.newImageData = function(test)
-  local imgdata = love.image.newImageData('resources/love.png')
-  local rawdata = love.image.newImageData(16, 16, 'rgba8', nil)
-  test:assertObject(imgdata)
-  test:assertObject(rawdata)
-  imgdata:release()
-  rawdata:release()
-end
+  test:assertObject(love.image.newImageData('resources/love.png'))
+  test:assertObject(love.image.newImageData(16, 16, 'rgba8', nil))
+end

+ 50 - 25
testing/tests/math.lua

@@ -3,16 +3,19 @@
 
 
 -- love.math.colorFromBytes
 -- love.math.colorFromBytes
 love.test.math.colorFromBytes = function(test)
 love.test.math.colorFromBytes = function(test)
+  -- check random value
   local r, g, b, a = love.math.colorFromBytes(51, 51, 51, 51)
   local r, g, b, a = love.math.colorFromBytes(51, 51, 51, 51)
   test:assertEquals(r, 0.2, 'check r from bytes')
   test:assertEquals(r, 0.2, 'check r from bytes')
   test:assertEquals(g, 0.2, 'check g from bytes')
   test:assertEquals(g, 0.2, 'check g from bytes')
   test:assertEquals(b, 0.2, 'check b from bytes')
   test:assertEquals(b, 0.2, 'check b from bytes')
   test:assertEquals(a, 0.2, 'check a from bytes')
   test:assertEquals(a, 0.2, 'check a from bytes')
+  -- check "max" value
   r, g, b, a = love.math.colorFromBytes(255, 255, 255, 255)
   r, g, b, a = love.math.colorFromBytes(255, 255, 255, 255)
   test:assertEquals(r, 1, 'check r from bytes')
   test:assertEquals(r, 1, 'check r from bytes')
   test:assertEquals(g, 1, 'check g from bytes')
   test:assertEquals(g, 1, 'check g from bytes')
   test:assertEquals(b, 1, 'check b from bytes')
   test:assertEquals(b, 1, 'check b from bytes')
   test:assertEquals(a, 1, 'check a from bytes')
   test:assertEquals(a, 1, 'check a from bytes')
+  -- check "min" value
   r, g, b, a = love.math.colorFromBytes(0, 0, 0, 0)
   r, g, b, a = love.math.colorFromBytes(0, 0, 0, 0)
   test:assertEquals(r, 0, 'check r from bytes')
   test:assertEquals(r, 0, 'check r from bytes')
   test:assertEquals(g, 0, 'check g from bytes')
   test:assertEquals(g, 0, 'check g from bytes')
@@ -23,16 +26,19 @@ end
 
 
 -- love.math.colorToBytes
 -- love.math.colorToBytes
 love.test.math.colorToBytes = function(test)
 love.test.math.colorToBytes = function(test)
+  -- check random value
   local r, g, b, a = love.math.colorToBytes(0.2, 0.2, 0.2, 0.2)
   local r, g, b, a = love.math.colorToBytes(0.2, 0.2, 0.2, 0.2)
   test:assertEquals(r, 51, 'check bytes from r')
   test:assertEquals(r, 51, 'check bytes from r')
   test:assertEquals(g, 51, 'check bytes from g')
   test:assertEquals(g, 51, 'check bytes from g')
   test:assertEquals(b, 51, 'check bytes from b')
   test:assertEquals(b, 51, 'check bytes from b')
   test:assertEquals(a, 51, 'check bytes from a')
   test:assertEquals(a, 51, 'check bytes from a')
+  -- check "max" value
   r, g, b, a = love.math.colorToBytes(1, 1, 1, 1)
   r, g, b, a = love.math.colorToBytes(1, 1, 1, 1)
   test:assertEquals(r, 255, 'check bytes from r')
   test:assertEquals(r, 255, 'check bytes from r')
   test:assertEquals(g, 255, 'check bytes from g')
   test:assertEquals(g, 255, 'check bytes from g')
   test:assertEquals(b, 255, 'check bytes from b')
   test:assertEquals(b, 255, 'check bytes from b')
   test:assertEquals(a, 255, 'check bytes from a')
   test:assertEquals(a, 255, 'check bytes from a')
+  -- check "min" value
   r, g, b, a = love.math.colorToBytes(0, 0, 0, 0)
   r, g, b, a = love.math.colorToBytes(0, 0, 0, 0)
   test:assertEquals(r, 0, 'check bytes from r')
   test:assertEquals(r, 0, 'check bytes from r')
   test:assertEquals(g, 0, 'check bytes from g')
   test:assertEquals(g, 0, 'check bytes from g')
@@ -65,8 +71,7 @@ end
 
 
 -- love.math.getRandomState
 -- love.math.getRandomState
 love.test.math.getRandomState = function(test)
 love.test.math.getRandomState = function(test)
-  local state = love.math.getRandomState()
-  test:assertNotEquals(nil, state, 'check not nil')
+  test:assertNotNil(love.math.getRandomState())
 end
 end
 
 
 
 
@@ -95,49 +100,69 @@ end
 -- love.math.newBezierCurve
 -- love.math.newBezierCurve
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 love.test.math.newBezierCurve = function(test)
 love.test.math.newBezierCurve = function(test)
-  local curve = love.math.newBezierCurve({0, 0, 0, 1, 1, 1, 2, 1})
-  test:assertObject(curve)
-  curve:release()
+  test:assertObject(love.math.newBezierCurve({0, 0, 0, 1, 1, 1, 2, 1}))
 end
 end
 
 
 
 
 -- love.math.newRandomGenerator
 -- love.math.newRandomGenerator
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 love.test.math.newRandomGenerator = function(test)
 love.test.math.newRandomGenerator = function(test)
-  local rangen = love.math.newRandomGenerator()
-  test:assertObject(rangen)
-  rangen:release()
+  test:assertObject(love.math.newRandomGenerator())
 end
 end
 
 
 
 
 -- love.math.newTransform
 -- love.math.newTransform
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 love.test.math.newTransform = function(test)
 love.test.math.newTransform = function(test)
-  local transform = love.math.newTransform()
-  test:assertObject(transform)
-  transform:release()
+  test:assertObject(love.math.newTransform())
 end
 end
 
 
 
 
--- love.math.noise
-love.test.math.noise = function(test)
-  local noise1 = love.math.noise(100)
-  local noise2 = love.math.noise(1, 10)
-  local noise3 = love.math.noise(1043, 31.123, 999)
-  local noise4 = love.math.noise(99.222, 10067, 8, 1843)
+-- love.math.perlinNoise
+love.test.math.perlinNoise = function(test)
+  -- check some noise values
+  -- output should be consistent if given the same input
+  local noise1 = love.math.perlinNoise(100)
+  local noise2 = love.math.perlinNoise(1, 10)
+  local noise3 = love.math.perlinNoise(1043, 31.123, 999)
+  local noise4 = love.math.perlinNoise(99.222, 10067, 8, 1843)
+  -- rounded to avoid floating point issues 
   test:assertEquals(50000, math.floor(noise1*100000), 'check noise 1 dimension')
   test:assertEquals(50000, math.floor(noise1*100000), 'check noise 1 dimension')
-  test:assertEquals(47863, math.floor(noise2*100000), 'check noise 2 dimensions')
+  test:assertEquals(50000, math.floor(noise2*100000), 'check noise 2 dimensions')
   test:assertEquals(56297, math.floor(noise3*100000), 'check noise 3 dimensions')
   test:assertEquals(56297, math.floor(noise3*100000), 'check noise 3 dimensions')
   test:assertEquals(52579, math.floor(noise4*100000), 'check noise 4 dimensions')
   test:assertEquals(52579, math.floor(noise4*100000), 'check noise 4 dimensions')
 end
 end
 
 
 
 
+-- love.math.simplexNoise
+love.test.math.simplexNoise = function(test)
+  -- check some noise values
+  -- output should be consistent if given the same input
+  local noise1 = love.math.simplexNoise(100)
+  local noise2 = love.math.simplexNoise(1, 10)
+  local noise3 = love.math.simplexNoise(1043, 31.123, 999)
+  local noise4 = love.math.simplexNoise(99.222, 10067, 8, 1843)
+  -- rounded to avoid floating point issues 
+  test:assertEquals(50000, math.floor(noise1*100000), 'check noise 1 dimension')
+  test:assertEquals(47863, math.floor(noise2*100000), 'check noise 2 dimensions')
+  test:assertEquals(26440, math.floor(noise3*100000), 'check noise 3 dimensions')
+  test:assertEquals(53360, math.floor(noise4*100000), 'check noise 4 dimensions')
+end
+
+
 -- love.math.random
 -- love.math.random
 love.test.math.random = function(test)
 love.test.math.random = function(test)
-  local random = love.math.random(10)
-  local randomminmax = love.math.random(5, 100)
-  test:assertRange(random, 1, 10, 'check within 1 - 10')
-  test:assertRange(randomminmax, 5, 100, 'check within 5 - 100')
+  -- check some random ranges
+  test:assertRange(love.math.random(10), 1, 10, 'check within 1 - 10')
+  test:assertRange(love.math.random(10), 1, 10, 'check within 1 - 10')
+  test:assertRange(love.math.random(10), 1, 10, 'check within 1 - 10')
+  test:assertRange(love.math.random(10), 1, 10, 'check within 1 - 10')
+  test:assertRange(love.math.random(10), 1, 10, 'check within 1 - 10')
+  test:assertRange(love.math.random(5, 100), 5, 100, 'check within 5 - 100')
+  test:assertRange(love.math.random(5, 100), 5, 100, 'check within 5 - 100')
+  test:assertRange(love.math.random(5, 100), 5, 100, 'check within 5 - 100')
+  test:assertRange(love.math.random(5, 100), 5, 100, 'check within 5 - 100')
+  test:assertRange(love.math.random(5, 100), 5, 100, 'check within 5 - 100')
 end
 end
 
 
 
 
@@ -145,8 +170,7 @@ end
 -- @NOTE i dont _really_ get the range expected based on stddev + mean
 -- @NOTE i dont _really_ get the range expected based on stddev + mean
 -- so feel free to change to be more accurate
 -- so feel free to change to be more accurate
 love.test.math.randomNormal = function(test)
 love.test.math.randomNormal = function(test)
-  local random = love.math.randomNormal(1, 0)
-  test:assertRange(random, -3, 3, 'check within -3 - 3')
+  test:assertRange(love.math.randomNormal(1, 0), -3, 3, 'check within -3 - 3')
 end
 end
 
 
 
 
@@ -162,6 +186,7 @@ end
 
 
 -- love.math.setRandomState
 -- love.math.setRandomState
 love.test.math.setRandomState = function(test)
 love.test.math.setRandomState = function(test)
+  -- check setting state matches value returned
   local rs1 = love.math.getRandomState()
   local rs1 = love.math.getRandomState()
   love.math.setRandomState(rs1)
   love.math.setRandomState(rs1)
   local rs2 = love.math.getRandomState()
   local rs2 = love.math.getRandomState()
@@ -175,4 +200,4 @@ love.test.math.triangulate = function(test)
   local triangles2 = love.math.triangulate({1, 2, 2, 4, 3, 4, 2, 1, 3, 1}) -- weird shape
   local triangles2 = love.math.triangulate({1, 2, 2, 4, 3, 4, 2, 1, 3, 1}) -- weird shape
   test:assertEquals(3, #triangles1, 'check polygon triangles')
   test:assertEquals(3, #triangles1, 'check polygon triangles')
   test:assertEquals(3, #triangles2, 'check polygon triangles')
   test:assertEquals(3, #triangles2, 'check polygon triangles')
-end
+end

+ 13 - 13
testing/tests/objects.lua

@@ -45,16 +45,18 @@ love.test.objects.File = function(test)
   -- @NOTE think I'm just not understanding how this is supposed to work?
   -- @NOTE think I'm just not understanding how this is supposed to work?
   -- I thought if buffering is enabled then nothing should get written until 
   -- I thought if buffering is enabled then nothing should get written until 
   -- buffer overflows?
   -- buffer overflows?
-  file1:open('a')
-  ok, err = file1:setBuffer('full', 10000)
-  test:assertEquals(true, ok)
-  test:assertEquals('full', file1:getBuffer())
-  file1:write('morecontent')
-  file1:close()
-  file1:open('r')
-  contents, size = file1:read()
-  test:assertEquals('helloworld', contents, 'check buffered content wasnt written')
-  file1:close()
+  -- file1:open('a')
+  -- ok, err = file1:setBuffer('full', 10000)
+  -- test:assertEquals(true, ok)
+  -- test:assertEquals('full', file1:getBuffer())
+  -- file1:write('morecontent')
+  -- file1:close()
+  -- file1:open('r')
+  -- contents, size = file1:read()
+  -- test:assertEquals('helloworld', contents, 'check buffered content wasnt written')
+  -- file1:close()
+
+  -- @NOTE :close() commits buffer content so need to check before not after
 
 
   -- test buffering and flushing
   -- test buffering and flushing
   file1:open('w')
   file1:open('w')
@@ -83,8 +85,6 @@ love.test.objects.File = function(test)
   test:assertEquals(counter, 15)
   test:assertEquals(counter, 15)
   file1:close()
   file1:close()
 
 
-  file1:release()
-
 end
 end
 
 
 
 
@@ -172,4 +172,4 @@ end
 -- Shader
 -- Shader
 -- SpriteBatch
 -- SpriteBatch
 -- Text
 -- Text
--- Video
+-- Video

+ 13 - 90
testing/tests/physics.lua

@@ -3,27 +3,21 @@
 
 
 -- love.physics.getDistance
 -- love.physics.getDistance
 love.test.physics.getDistance = function(test)
 love.test.physics.getDistance = function(test)
-  -- setup
+  -- setup two fixtues to check
   local shape1 = love.physics.newEdgeShape(0, 0, 5, 5)
   local shape1 = love.physics.newEdgeShape(0, 0, 5, 5)
   local shape2 = love.physics.newEdgeShape(10, 10, 15, 15)
   local shape2 = love.physics.newEdgeShape(10, 10, 15, 15)
   local world = love.physics.newWorld(0, 0, false)
   local world = love.physics.newWorld(0, 0, false)
   local body = love.physics.newBody(world, 10, 10, 'static')
   local body = love.physics.newBody(world, 10, 10, 'static')
   local fixture1 = love.physics.newFixture(body, shape1, 1)
   local fixture1 = love.physics.newFixture(body, shape1, 1)
   local fixture2 = love.physics.newFixture(body, shape2, 1)
   local fixture2 = love.physics.newFixture(body, shape2, 1)
-  -- test
+  -- check distance between them
   test:assertEquals(647106, math.floor(love.physics.getDistance(fixture1, fixture2)*100000), 'check distance matches')
   test:assertEquals(647106, math.floor(love.physics.getDistance(fixture1, fixture2)*100000), 'check distance matches')
-  -- cleanup
-  fixture1:release()
-  fixture2:release()
-  body:release()
-  world:release()
-  shape1:release()
-  shape2:release()
 end
 end
 
 
 
 
 -- love.physics.getMeter
 -- love.physics.getMeter
 love.test.physics.getMeter = function(test)
 love.test.physics.getMeter = function(test)
+  -- check value set is returned
   love.physics.setMeter(30)
   love.physics.setMeter(30)
   test:assertEquals(30, love.physics.getMeter(), 'check meter matches')
   test:assertEquals(30, love.physics.getMeter(), 'check meter matches')
 end
 end
@@ -32,50 +26,34 @@ end
 -- love.physics.newBody
 -- love.physics.newBody
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 love.test.physics.newBody = function(test)
 love.test.physics.newBody = function(test)
-  -- setup
   local world = love.physics.newWorld(1, 1, true)
   local world = love.physics.newWorld(1, 1, true)
   local body = love.physics.newBody(world, 10, 10, 'static')
   local body = love.physics.newBody(world, 10, 10, 'static')
-  -- test
   test:assertObject(body)
   test:assertObject(body)
-  -- cleanup
-  body:release()
-  world:release()
 end
 end
 
 
 
 
 -- love.physics.newChainShape
 -- love.physics.newChainShape
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 love.test.physics.newChainShape = function(test)
 love.test.physics.newChainShape = function(test)
-  local obj = love.physics.newChainShape(true, 0, 0, 1, 0, 1, 1, 0, 1)
-  test:assertObject(obj)
-  obj:release()
+  test:assertObject(love.physics.newChainShape(true, 0, 0, 1, 0, 1, 1, 0, 1))
 end
 end
 
 
 
 
 -- love.physics.newCircleShape
 -- love.physics.newCircleShape
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 love.test.physics.newCircleShape = function(test)
 love.test.physics.newCircleShape = function(test)
-  local obj = love.physics.newCircleShape(10)
-  test:assertObject(obj)
-  obj:release()
+  test:assertObject(love.physics.newCircleShape(10))
 end
 end
 
 
 
 
 -- love.physics.newDistanceJoint
 -- love.physics.newDistanceJoint
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 love.test.physics.newDistanceJoint = function(test)
 love.test.physics.newDistanceJoint = function(test)
-  -- setup
   local world = love.physics.newWorld(1, 1, true)
   local world = love.physics.newWorld(1, 1, true)
   local body1 = love.physics.newBody(world, 10, 10, 'static')
   local body1 = love.physics.newBody(world, 10, 10, 'static')
   local body2 = love.physics.newBody(world, 20, 20, 'static')
   local body2 = love.physics.newBody(world, 20, 20, 'static')
-  -- test
   local obj = love.physics.newDistanceJoint(body1, body2, 10, 10, 20, 20, true)
   local obj = love.physics.newDistanceJoint(body1, body2, 10, 10, 20, 20, true)
   test:assertObject(obj)
   test:assertObject(obj)
-  -- cleanup
-  obj:release()
-  body1:release()
-  body2:release()
-  world:release()
 end
 end
 
 
 
 
@@ -84,25 +62,17 @@ end
 love.test.physics.newEdgeShape = function(test)
 love.test.physics.newEdgeShape = function(test)
   local obj = love.physics.newEdgeShape(0, 0, 10, 10)
   local obj = love.physics.newEdgeShape(0, 0, 10, 10)
   test:assertObject(obj)
   test:assertObject(obj)
-  obj:release()
 end
 end
 
 
 
 
 -- love.physics.newFixture
 -- love.physics.newFixture
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 love.test.physics.newFixture = function(test)
 love.test.physics.newFixture = function(test)
-  -- setup
   local world = love.physics.newWorld(1, 1, true)
   local world = love.physics.newWorld(1, 1, true)
   local body = love.physics.newBody(world, 10, 10, 'static')
   local body = love.physics.newBody(world, 10, 10, 'static')
   local shape = love.physics.newCircleShape(10)
   local shape = love.physics.newCircleShape(10)
-  -- test
   local obj = love.physics.newFixture(body, shape, 1)
   local obj = love.physics.newFixture(body, shape, 1)
   test:assertObject(obj)
   test:assertObject(obj)
-  -- cleanup
-  obj:release()
-  shape:release()
-  body:release()
-  world:release()
 end
 end
 
 
 
 
@@ -114,10 +84,6 @@ love.test.physics.newFrictionJoint = function(test)
   local body2 = love.physics.newBody(world, 20, 20, 'static')
   local body2 = love.physics.newBody(world, 20, 20, 'static')
   local obj = love.physics.newFrictionJoint(body1, body2, 15, 15, true)
   local obj = love.physics.newFrictionJoint(body1, body2, 15, 15, true)
   test:assertObject(obj)
   test:assertObject(obj)
-  obj:release()
-  body1:release()
-  body2:release()
-  world:release()
 end
 end
 
 
 
 
@@ -125,22 +91,14 @@ end
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 love.test.physics.newGearJoint = function(test)
 love.test.physics.newGearJoint = function(test)
   local world = love.physics.newWorld(1, 1, true)
   local world = love.physics.newWorld(1, 1, true)
-  local body1 = love.physics.newBody(world, 10, 10, 'static')
-  local body2 = love.physics.newBody(world, 20, 20, 'static')
-  local body3 = love.physics.newBody(world, 30, 30, 'static')
-  local body4 = love.physics.newBody(world, 40, 40, 'static')
+  local body1 = love.physics.newBody(world, 10, 10, 'dynamic')
+  local body2 = love.physics.newBody(world, 20, 20, 'dynamic')
+  local body3 = love.physics.newBody(world, 30, 30, 'dynamic')
+  local body4 = love.physics.newBody(world, 40, 40, 'dynamic')
   local joint1 = love.physics.newPrismaticJoint(body1, body2, 10, 10, 20, 20, true)
   local joint1 = love.physics.newPrismaticJoint(body1, body2, 10, 10, 20, 20, true)
   local joint2 = love.physics.newPrismaticJoint(body3, body4, 30, 30, 40, 40, true)
   local joint2 = love.physics.newPrismaticJoint(body3, body4, 30, 30, 40, 40, true)
   local obj = love.physics.newGearJoint(joint1, joint2, 1, true)
   local obj = love.physics.newGearJoint(joint1, joint2, 1, true)
   test:assertObject(obj)
   test:assertObject(obj)
-  obj:release()
-  joint1:release()
-  joint2:release()
-  body1:release()
-  body2:release()
-  body3:release()
-  body4:release()
-  world:release()
 end
 end
 
 
 
 
@@ -152,10 +110,6 @@ love.test.physics.newMotorJoint = function(test)
   local body2 = love.physics.newBody(world, 20, 20, 'static')
   local body2 = love.physics.newBody(world, 20, 20, 'static')
   local obj = love.physics.newMotorJoint(body1, body2, 1)
   local obj = love.physics.newMotorJoint(body1, body2, 1)
   test:assertObject(obj)
   test:assertObject(obj)
-  obj:release()
-  body1:release()
-  body2:release()
-  world:release()
 end
 end
 
 
 
 
@@ -166,9 +120,6 @@ love.test.physics.newMouseJoint = function(test)
   local body = love.physics.newBody(world, 10, 10, 'static')
   local body = love.physics.newBody(world, 10, 10, 'static')
   local obj = love.physics.newMouseJoint(body, 10, 10)
   local obj = love.physics.newMouseJoint(body, 10, 10)
   test:assertObject(obj)
   test:assertObject(obj)
-  obj:release()
-  body:release()
-  world:release()
 end
 end
 
 
 
 
@@ -177,7 +128,6 @@ end
 love.test.physics.newPolygonShape = function(test)
 love.test.physics.newPolygonShape = function(test)
   local obj = love.physics.newPolygonShape({0, 0, 2, 3, 2, 1, 3, 1, 5, 1})
   local obj = love.physics.newPolygonShape({0, 0, 2, 3, 2, 1, 3, 1, 5, 1})
   test:assertObject(obj)
   test:assertObject(obj)
-  obj:release()
 end
 end
 
 
 
 
@@ -189,10 +139,6 @@ love.test.physics.newPrismaticJoint = function(test)
   local body2 = love.physics.newBody(world, 20, 20, 'static')
   local body2 = love.physics.newBody(world, 20, 20, 'static')
   local obj = love.physics.newPrismaticJoint(body1, body2, 10, 10, 20, 20, true)
   local obj = love.physics.newPrismaticJoint(body1, body2, 10, 10, 20, 20, true)
   test:assertObject(obj)
   test:assertObject(obj)
-  obj:release()
-  body1:release()
-  body2:release()
-  world:release()
 end
 end
 
 
 
 
@@ -204,10 +150,6 @@ love.test.physics.newPulleyJoint = function(test)
   local body2 = love.physics.newBody(world, 20, 20, 'static')
   local body2 = love.physics.newBody(world, 20, 20, 'static')
   local obj = love.physics.newPulleyJoint(body1, body2, 10, 10, 20, 20, 15, 15, 25, 25, 1, true)
   local obj = love.physics.newPulleyJoint(body1, body2, 10, 10, 20, 20, 15, 15, 25, 25, 1, true)
   test:assertObject(obj)
   test:assertObject(obj)
-  obj:release()
-  body1:release()
-  body2:release()
-  world:release()
 end
 end
 
 
 
 
@@ -229,10 +171,6 @@ love.test.physics.newRevoluteJoint = function(test)
   local body2 = love.physics.newBody(world, 20, 20, 'static')
   local body2 = love.physics.newBody(world, 20, 20, 'static')
   local obj = love.physics.newRevoluteJoint(body1, body2, 10, 10, true)
   local obj = love.physics.newRevoluteJoint(body1, body2, 10, 10, true)
   test:assertObject(obj)
   test:assertObject(obj)
-  obj:release()
-  body1:release()
-  body2:release()
-  world:release()
 end
 end
 
 
 
 
@@ -244,10 +182,6 @@ love.test.physics.newRopeJoint = function(test)
   local body2 = love.physics.newBody(world, 20, 20, 'static')
   local body2 = love.physics.newBody(world, 20, 20, 'static')
   local obj = love.physics.newRopeJoint(body1, body2, 10, 10, 20, 20, 50, true)
   local obj = love.physics.newRopeJoint(body1, body2, 10, 10, 20, 20, 50, true)
   test:assertObject(obj)
   test:assertObject(obj)
-  obj:release()
-  body1:release()
-  body2:release()
-  world:release()
 end
 end
 
 
 
 
@@ -259,10 +193,6 @@ love.test.physics.newWeldJoint = function(test)
   local body2 = love.physics.newBody(world, 20, 20, 'static')
   local body2 = love.physics.newBody(world, 20, 20, 'static')
   local obj = love.physics.newWeldJoint(body1, body2, 10, 10, true)
   local obj = love.physics.newWeldJoint(body1, body2, 10, 10, true)
   test:assertObject(obj)
   test:assertObject(obj)
-  obj:release()
-  body1:release()
-  body2:release()
-  world:release()
 end
 end
 
 
 
 
@@ -273,13 +203,7 @@ love.test.physics.newWheelJoint = function(test)
   local body1 = love.physics.newBody(world, 10, 10, 'static')
   local body1 = love.physics.newBody(world, 10, 10, 'static')
   local body2 = love.physics.newBody(world, 20, 20, 'static')
   local body2 = love.physics.newBody(world, 20, 20, 'static')
   local obj = love.physics.newWheelJoint(body1, body2, 10, 10, 5, 5, true)
   local obj = love.physics.newWheelJoint(body1, body2, 10, 10, 5, 5, true)
-  test:assertNotEquals(nil, obj)
-  test:assertEquals('userdata', type(obj))
-  test:assertNotEquals(nil, obj:type())
-  obj:release()
-  body1:release()
-  body2:release()
-  world:release()
+  test:assertObject(obj)
 end
 end
 
 
 
 
@@ -288,19 +212,18 @@ end
 love.test.physics.newWorld = function(test)
 love.test.physics.newWorld = function(test)
   local world = love.physics.newWorld(1, 1, true)
   local world = love.physics.newWorld(1, 1, true)
   test:assertObject(world)
   test:assertObject(world)
-  world:release()
 end
 end
 
 
 
 
 -- love.physics.setMeter
 -- love.physics.setMeter
 love.test.physics.setMeter = function(test)
 love.test.physics.setMeter = function(test)
+  -- set initial meter
   local world = love.physics.newWorld(1, 1, true)
   local world = love.physics.newWorld(1, 1, true)
   love.physics.setMeter(30)
   love.physics.setMeter(30)
   local body = love.physics.newBody(world, 300, 300, "dynamic")
   local body = love.physics.newBody(world, 300, 300, "dynamic")
+  -- check changing meter changes pos value relatively
   love.physics.setMeter(10)
   love.physics.setMeter(10)
   local x, y = body:getPosition()
   local x, y = body:getPosition()
   test:assertEquals(100, x, 'check pos x')
   test:assertEquals(100, x, 'check pos x')
   test:assertEquals(100, y, 'check pos y')
   test:assertEquals(100, y, 'check pos y')
-  body:release()
-  world:release()
-end
+end

+ 4 - 7
testing/tests/sound.lua

@@ -4,16 +4,13 @@
 -- love.sound.newDecoder
 -- love.sound.newDecoder
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 love.test.sound.newDecoder = function(test)
 love.test.sound.newDecoder = function(test)
-  local decoder = love.sound.newDecoder('resources/click.ogg')
-  test:assertObject(decoder)
+  test:assertObject(love.sound.newDecoder('resources/click.ogg'))
 end
 end
 
 
 
 
 -- love.sound.newSoundData
 -- love.sound.newSoundData
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 love.test.sound.newSoundData = function(test)
 love.test.sound.newSoundData = function(test)
-  local sounddata = love.sound.newSoundData('resources/click.ogg')
-  test:assertObject(sounddata)
-  local soundbeep = love.sound.newSoundData(math.floor((1/32)*44100), 44100, 16, 1)
-  test:assertObject(soundbeep)
-end
+  test:assertObject(love.sound.newSoundData('resources/click.ogg'))
+  test:assertObject(love.sound.newSoundData(math.floor((1/32)*44100), 44100, 16, 1))
+end

+ 20 - 12
testing/tests/system.lua

@@ -4,25 +4,31 @@
 -- love.system.getClipboardText
 -- love.system.getClipboardText
 love.test.system.getClipboardText = function(test)
 love.test.system.getClipboardText = function(test)
   -- ignore if not using window
   -- ignore if not using window
-  if love.test.windowmode == false then return test:skipTest('clipboard only available in window mode') end
-  -- setup
+  if love.test.windowmode == false then 
+    return test:skipTest('clipboard only available in window mode') 
+  end
+  -- check clipboard value is set
   love.system.setClipboardText('helloworld')
   love.system.setClipboardText('helloworld')
-  -- test
   test:assertEquals('helloworld', love.system.getClipboardText(), 'check clipboard match')
   test:assertEquals('helloworld', love.system.getClipboardText(), 'check clipboard match')
 end
 end
 
 
 
 
 -- love.system.getOS
 -- love.system.getOS
 love.test.system.getOS = function(test)
 love.test.system.getOS = function(test)
+  -- check os is in documented values
   local os = love.system.getOS()
   local os = love.system.getOS()
-  test:assertMatch({'OS X', 'Windows', 'Linux', 'Android', 'iOS'}, os, 'check value matches')
+  local options = {'OS X', 'Windows', 'Linux', 'Android', 'iOS'}
+  test:assertMatch(options, os, 'check value matches')
 end
 end
 
 
 
 
 -- love.system.getPowerInfo
 -- love.system.getPowerInfo
 love.test.system.getPowerInfo = function(test)
 love.test.system.getPowerInfo = function(test)
+  -- check battery state is one of the documented states
   local state, percent, seconds = love.system.getPowerInfo()
   local state, percent, seconds = love.system.getPowerInfo()
-  test:assertMatch({'unknown', 'battery', 'nobattery', 'charging', 'charged'}, state, 'check value matches')
+  local states = {'unknown', 'battery', 'nobattery', 'charging', 'charged'}
+  test:assertMatch(states, state, 'check value matches')
+  -- if percent/seconds check within expected range
   if percent ~= nil then
   if percent ~= nil then
     test:assertRange(percent, 0, 100, 'check value within range')
     test:assertRange(percent, 0, 100, 'check value within range')
   end
   end
@@ -34,19 +40,19 @@ end
 
 
 -- love.system.getProcessorCount
 -- love.system.getProcessorCount
 love.test.system.getProcessorCount = function(test)
 love.test.system.getProcessorCount = function(test)
-  test:assertGreaterEqual(0, love.system.getProcessorCount(), 'check not nil') -- youd hope right
+  test:assertNotNil(love.system.getProcessorCount()) -- youd hope right
 end
 end
 
 
 
 
 -- love.system.hasBackgroundMusic
 -- love.system.hasBackgroundMusic
 love.test.system.hasBackgroundMusic = function(test)
 love.test.system.hasBackgroundMusic = function(test)
-  test:assertNotEquals(nil, love.system.hasBackgroundMusic(), 'check not nil')
+  test:assertNotNil(love.system.hasBackgroundMusic())
 end
 end
 
 
 
 
 -- love.system.openURL
 -- love.system.openURL
 love.test.system.openURL = function(test)
 love.test.system.openURL = function(test)
-  test:skipTest('gets annoying to test everytime')
+  test:skipTest('cant test this worked')
   --test:assertNotEquals(nil, love.system.openURL('https://love2d.org'), 'check open URL')
   --test:assertNotEquals(nil, love.system.openURL('https://love2d.org'), 'check open URL')
 end
 end
 
 
@@ -54,8 +60,10 @@ end
 -- love.system.getClipboardText
 -- love.system.getClipboardText
 love.test.system.setClipboardText = function(test)
 love.test.system.setClipboardText = function(test)
   -- ignore if not using window
   -- ignore if not using window
-  if love.test.windowmode == false then return test:skipTest('clipboard only available in window mode') end
-  -- test
+  if love.test.windowmode == false then 
+    return test:skipTest('clipboard only available in window mode') 
+  end
+  -- check value returned is what was set
   love.system.setClipboardText('helloworld')
   love.system.setClipboardText('helloworld')
   test:assertEquals('helloworld', love.system.getClipboardText(), 'check set text')
   test:assertEquals('helloworld', love.system.getClipboardText(), 'check set text')
 end
 end
@@ -64,5 +72,5 @@ end
 -- love.system.vibrate
 -- love.system.vibrate
 -- @NOTE cant really test this
 -- @NOTE cant really test this
 love.test.system.vibrate = function(test)
 love.test.system.vibrate = function(test)
-  test:skipTest('cant really test this')
-end
+  test:skipTest('cant test this worked')
+end

+ 4 - 10
testing/tests/thread.lua

@@ -4,25 +4,19 @@
 -- love.thread.getChannel
 -- love.thread.getChannel
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 love.test.thread.getChannel = function(test)
 love.test.thread.getChannel = function(test)
-  local channel = love.thread.getChannel('test')
-  test:assertObject(channel)
-  channel:release()
+  test:assertObject(love.thread.getChannel('test'))
 end
 end
 
 
 
 
 -- love.thread.newChannel
 -- love.thread.newChannel
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 love.test.thread.newChannel = function(test)
 love.test.thread.newChannel = function(test)
-  local channel = love.thread.newChannel()
-  test:assertObject(channel)
-  channel:release()
+  test:assertObject(love.thread.newChannel())
 end
 end
 
 
 
 
 -- love.thread.newThread
 -- love.thread.newThread
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 love.test.thread.newThread = function(test)
 love.test.thread.newThread = function(test)
-  local thread = love.thread.newThread('classes/TestSuite.lua')
-  test:assertObject(thread)
-  thread:release()
-end
+  test:assertObject(love.thread.newThread('classes/TestSuite.lua'))
+end

+ 5 - 5
testing/tests/timer.lua

@@ -4,20 +4,20 @@
 -- love.timer.getAverageDelta
 -- love.timer.getAverageDelta
 -- @NOTE not sure if you could reliably get a specific delta?
 -- @NOTE not sure if you could reliably get a specific delta?
 love.test.timer.getAverageDelta = function(test)
 love.test.timer.getAverageDelta = function(test)
-  test:assertNotEquals(nil, love.timer.getAverageDelta(), 'check not nil')
+  test:assertNotNil(love.timer.getAverageDelta())
 end
 end
 
 
 -- love.timer.getDelta
 -- love.timer.getDelta
 -- @NOTE not sure if you could reliably get a specific delta?
 -- @NOTE not sure if you could reliably get a specific delta?
 love.test.timer.getDelta = function(test)
 love.test.timer.getDelta = function(test)
-  test:assertNotEquals(nil, love.timer.getDelta(), 'check not nil')
+  test:assertNotNil(love.timer.getDelta())
 end
 end
 
 
 
 
 -- love.timer.getFPS
 -- love.timer.getFPS
 -- @NOTE not sure if you could reliably get a specific FPS?
 -- @NOTE not sure if you could reliably get a specific FPS?
 love.test.timer.getFPS = function(test)
 love.test.timer.getFPS = function(test)
-  test:assertNotEquals(nil, love.timer.getFPS(), 'check not nil')
+  test:assertNotNil(love.timer.getFPS())
 end
 end
 
 
 
 
@@ -41,5 +41,5 @@ end
 -- love.timer.step
 -- love.timer.step
 -- @NOTE not sure if you could reliably get a specific step val?
 -- @NOTE not sure if you could reliably get a specific step val?
 love.test.timer.step = function(test)
 love.test.timer.step = function(test)
-  test:assertNotEquals(nil, love.timer.step(), 'check not nil')
-end
+  test:assertNotNil(love.timer.step())
+end

+ 2 - 4
testing/tests/video.lua

@@ -4,7 +4,5 @@
 -- love.video.newVideoStream
 -- love.video.newVideoStream
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 -- @NOTE this is just basic nil checking, full obj test are in objects.lua
 love.test.video.newVideoStream = function(test)
 love.test.video.newVideoStream = function(test)
-  local videostream = love.video.newVideoStream('resources/sample.ogv')
-  test:assertObject(videostream)
-  videostream:release()
-end
+  test:assertObject(love.video.newVideoStream('resources/sample.ogv'))
+end

+ 71 - 40
testing/tests/window.lua

@@ -2,19 +2,21 @@
 
 
 
 
 -- love.window.close
 -- love.window.close
--- @NOTE closing window should cause graphics to no longer be active
 love.test.window.close = function(test)
 love.test.window.close = function(test)
+  -- closing window should cause graphics to not be active
   love.window.close()
   love.window.close()
   local active = false
   local active = false
-  if love.graphics ~= nil then active = love.graphics.isActive() end
+  if love.graphics ~= nil then 
+    active = love.graphics.isActive() 
+  end
   test:assertEquals(false, active, 'check window active')
   test:assertEquals(false, active, 'check window active')
   love.window.setMode(256, 256) -- reset 
   love.window.setMode(256, 256) -- reset 
 end
 end
 
 
 
 
 -- love.window.fromPixels
 -- love.window.fromPixels
--- @NOTE dependent on the DPI value returned I think
 love.test.window.fromPixels = function(test)
 love.test.window.fromPixels = function(test)
+  -- check dpi/pixel ratio as expected
   local dpi = love.window.getDPIScale()
   local dpi = love.window.getDPIScale()
   local pixels = love.window.fromPixels(100)
   local pixels = love.window.fromPixels(100)
   test:assertEquals(100/dpi, pixels, 'check dpi ratio')
   test:assertEquals(100/dpi, pixels, 'check dpi ratio')
@@ -22,9 +24,9 @@ end
 
 
 
 
 -- love.window.getDPIScale
 -- love.window.getDPIScale
--- @NOTE i dont think there's a clever way to check this 
+-- @NOTE dependent on hardware so best can do is not nil
 love.test.window.getDPIScale = function(test)
 love.test.window.getDPIScale = function(test)
-  test:assertNotEquals(nil, test, 'check not nil')
+  test:assertNotNil(test)
 end
 end
 
 
 
 
@@ -32,59 +34,58 @@ end
 -- @NOTE dependent on hardware so best can do is not nil
 -- @NOTE dependent on hardware so best can do is not nil
 love.test.window.getDesktopDimensions = function(test)
 love.test.window.getDesktopDimensions = function(test)
   local w, h = love.window.getDesktopDimensions()
   local w, h = love.window.getDesktopDimensions()
-  test:assertNotEquals(nil, w, 'check not nil')
-  test:assertNotEquals(nil, h, 'check not nil')
+  test:assertNotNil(w)
+  test:assertNotNil(h)
 end
 end
 
 
 
 
 -- love.window.getDisplayCount
 -- love.window.getDisplayCount
 -- @NOTE cant wait for the test suite to be run headless and fail here
 -- @NOTE cant wait for the test suite to be run headless and fail here
 love.test.window.getDisplayCount = function(test)
 love.test.window.getDisplayCount = function(test)
-  local count = love.window.getDisplayCount()
-  test:assertGreaterEqual(1, count, 'check 1 display')
+  test:assertGreaterEqual(1, love.window.getDisplayCount(), 'check 1 display')
 end
 end
 
 
 
 
 -- love.window.getDisplayName
 -- love.window.getDisplayName
 -- @NOTE dependent on hardware so best can do is not nil
 -- @NOTE dependent on hardware so best can do is not nil
 love.test.window.getDisplayName = function(test)
 love.test.window.getDisplayName = function(test)
-  local name = love.window.getDisplayName(1)
-  test:assertNotEquals(nil, name, 'check not nil')
+  test:assertNotNil(love.window.getDisplayName(1))
 end
 end
 
 
 
 
 -- love.window.getDisplayOrientation
 -- love.window.getDisplayOrientation
 -- @NOTE dependent on hardware so best can do is not nil
 -- @NOTE dependent on hardware so best can do is not nil
 love.test.window.getDisplayOrientation = function(test)
 love.test.window.getDisplayOrientation = function(test)
-  local orientation = love.window.getDisplayOrientation(1)
-  test:assertNotEquals(nil, orientation, 'check not nil')
+  test:assertNotNil(love.window.getDisplayOrientation(1))
 end
 end
 
 
 
 
 -- love.window.getFullscreen
 -- love.window.getFullscreen
 love.test.window.getFullscreen = function(test)
 love.test.window.getFullscreen = function(test)
+  -- check not fullscreen to start
   test:assertEquals(false, love.window.getFullscreen(), 'check not fullscreen')
   test:assertEquals(false, love.window.getFullscreen(), 'check not fullscreen')
   love.window.setFullscreen(true)
   love.window.setFullscreen(true)
+  -- check now fullscreen
   test:assertEquals(true, love.window.getFullscreen(), 'check now fullscreen')
   test:assertEquals(true, love.window.getFullscreen(), 'check now fullscreen')
-  love.window.setFullscreen(false)
+  love.window.setFullscreen(false) -- reset
 end
 end
 
 
 
 
 -- love.window.getFullscreenModes
 -- love.window.getFullscreenModes
 -- @NOTE dependent on hardware so best can do is not nil
 -- @NOTE dependent on hardware so best can do is not nil
 love.test.window.getFullscreenModes = function(test)
 love.test.window.getFullscreenModes = function(test)
-  local modes = love.window.getFullscreenModes(1)
-  test:assertNotEquals(nil, modes, 'check not nil')
+  test:assertNotNil(love.window.getFullscreenModes(1))
 end
 end
 
 
 
 
 -- love.window.getIcon
 -- love.window.getIcon
 love.test.window.getIcon = function(test)
 love.test.window.getIcon = function(test)
-  test:assertEquals(nil, love.window.getIcon(), 'check nil by default') -- nil if not set
+  -- check icon nil by default if not set
+  test:assertEquals(nil, love.window.getIcon(), 'check nil by default')
   local icon = love.image.newImageData('resources/love.png')
   local icon = love.image.newImageData('resources/love.png')
+  -- check getting icon not nil after setting
   love.window.setIcon(icon)
   love.window.setIcon(icon)
-  test:assertNotEquals(nil, love.window.getIcon(), 'check not nil')
-  icon:release()
+  test:assertNotNil(love.window.getIcon())
 end
 end
 
 
 
 
@@ -112,15 +113,16 @@ end
 -- @NOTE dependent on hardware so best can do is not nil
 -- @NOTE dependent on hardware so best can do is not nil
 love.test.window.getSafeArea = function(test)
 love.test.window.getSafeArea = function(test)
   local x, y, w, h = love.window.getSafeArea()
   local x, y, w, h = love.window.getSafeArea()
-  test:assertNotEquals(nil, x, 'check not nil')
-  test:assertNotEquals(nil, y, 'check not nil')
-  test:assertNotEquals(nil, w, 'check not nil')
-  test:assertNotEquals(nil, h, 'check not nil')
+  test:assertNotNil(x)
+  test:assertNotNil(y)
+  test:assertNotNil(w)
+  test:assertNotNil(h)
 end
 end
 
 
 
 
 -- love.window.getTitle
 -- love.window.getTitle
 love.test.window.getTitle = function(test)
 love.test.window.getTitle = function(test)
+  -- check title returned is what was set
   love.window.setTitle('love.testing')
   love.window.setTitle('love.testing')
   test:assertEquals('love.testing', love.window.getTitle(), 'check title match')
   test:assertEquals('love.testing', love.window.getTitle(), 'check title match')
   love.window.setTitle('love.test')
   love.window.setTitle('love.test')
@@ -129,33 +131,37 @@ end
 
 
 -- love.window.getVSync
 -- love.window.getVSync
 love.test.window.getVSync = function(test)
 love.test.window.getVSync = function(test)
-  test:assertNotEquals(nil, love.window.getVSync(), 'check not nil')
-  love.window.setVSync(false)
+  test:assertNotNil(love.window.getVSync())
+  -- check turning off
+  love.window.setVSync(0)
   test:assertEquals(0, love.window.getVSync(), 'check vsync off')
   test:assertEquals(0, love.window.getVSync(), 'check vsync off')
-  love.window.setVSync(true)
+  -- check turning on
+  love.window.setVSync(1)
   test:assertEquals(1, love.window.getVSync(), 'check vsync on')
   test:assertEquals(1, love.window.getVSync(), 'check vsync on')
 end
 end
 
 
 
 
 -- love.window.hasFocus
 -- love.window.hasFocus
--- @NOTE cant really test as cant force focus?
+-- @NOTE cant really test as cant force focus
 love.test.window.hasFocus = function(test)
 love.test.window.hasFocus = function(test)
-  test:assertNotEquals(nil, love.window.hasFocus(), 'check not nil')
+  test:assertNotNil(love.window.hasFocus())
 end
 end
 
 
 
 
 -- love.window.hasMouseFocus
 -- love.window.hasMouseFocus
--- @NOTE cant really test as cant force focus?
+-- @NOTE cant really test as cant force focus
 love.test.window.hasMouseFocus = function(test)
 love.test.window.hasMouseFocus = function(test)
-  test:assertNotEquals(nil, love.window.hasMouseFocus(), 'check not nil')
+  test:assertNotNil(love.window.hasMouseFocus())
 end
 end
 
 
 
 
 -- love.window.isDisplaySleepEnabled
 -- love.window.isDisplaySleepEnabled
 love.test.window.isDisplaySleepEnabled = function(test)
 love.test.window.isDisplaySleepEnabled = function(test)
-  test:assertNotEquals(nil, love.window.isDisplaySleepEnabled(), 'check not nil')
+  test:assertNotNil(love.window.isDisplaySleepEnabled())
+  -- check disabled
   love.window.setDisplaySleepEnabled(false)
   love.window.setDisplaySleepEnabled(false)
   test:assertEquals(false, love.window.isDisplaySleepEnabled(), 'check sleep disabled')
   test:assertEquals(false, love.window.isDisplaySleepEnabled(), 'check sleep disabled')
+  -- check enabled
   love.window.setDisplaySleepEnabled(true)
   love.window.setDisplaySleepEnabled(true)
   test:assertEquals(true, love.window.isDisplaySleepEnabled(), 'check sleep enabled')
   test:assertEquals(true, love.window.isDisplaySleepEnabled(), 'check sleep enabled')
 end
 end
@@ -163,8 +169,10 @@ end
 
 
 -- love.window.isMaximized
 -- love.window.isMaximized
 love.test.window.isMaximized = function(test)
 love.test.window.isMaximized = function(test)
+  -- check minimized to start
   love.window.minimize()
   love.window.minimize()
   test:assertEquals(false, love.window.isMaximized(), 'check window maximized')
   test:assertEquals(false, love.window.isMaximized(), 'check window maximized')
+  -- try to mazimize
   love.window.maximize()
   love.window.maximize()
   test:assertEquals(true, love.window.isMaximized(), 'check window not maximized')
   test:assertEquals(true, love.window.isMaximized(), 'check window not maximized')
   love.window.restore()
   love.window.restore()
@@ -173,7 +181,9 @@ end
 
 
 -- love.window.isMinimized
 -- love.window.isMinimized
 love.test.window.isMinimized = function(test)
 love.test.window.isMinimized = function(test)
+  -- check not minimized to start
   test:assertEquals(false, love.window.isMinimized(), 'check window not minimized')
   test:assertEquals(false, love.window.isMinimized(), 'check window not minimized')
+  -- try to minimize
   love.window.minimize()
   love.window.minimize()
   test:assertEquals(true, love.window.isMinimized(), 'check window minimized')
   test:assertEquals(true, love.window.isMinimized(), 'check window minimized')
   love.window.restore()
   love.window.restore()
@@ -182,7 +192,9 @@ end
 
 
 -- love.window.isOpen
 -- love.window.isOpen
 love.test.window.isOpen = function(test)
 love.test.window.isOpen = function(test)
+  -- check open initially
   test:assertEquals(true, love.window.isOpen(), 'check window open')
   test:assertEquals(true, love.window.isOpen(), 'check window open')
+  -- try closing
   love.window.close()
   love.window.close()
   test:assertEquals(false, love.window.isOpen(), 'check window closed')
   test:assertEquals(false, love.window.isOpen(), 'check window closed')
   love.window.setMode(256, 256) -- reset 
   love.window.setMode(256, 256) -- reset 
@@ -191,7 +203,9 @@ end
 
 
 -- love.window.isVisible
 -- love.window.isVisible
 love.test.window.isVisible = function(test)
 love.test.window.isVisible = function(test)
+  -- check visible initially
   test:assertEquals(true, love.window.isVisible(), 'check window visible')
   test:assertEquals(true, love.window.isVisible(), 'check window visible')
+  -- check closing makes window not visible
   love.window.close()
   love.window.close()
   test:assertEquals(false, love.window.isVisible(), 'check window not visible')
   test:assertEquals(false, love.window.isVisible(), 'check window not visible')
   love.window.setMode(256, 256) -- reset 
   love.window.setMode(256, 256) -- reset 
@@ -200,6 +214,7 @@ end
 
 
 -- love.window.maximize
 -- love.window.maximize
 love.test.window.maximize = function(test)
 love.test.window.maximize = function(test)
+  -- check maximizing is set
   love.window.maximize()
   love.window.maximize()
   test:assertEquals(true, love.window.isMaximized(), 'check window maximized')
   test:assertEquals(true, love.window.isMaximized(), 'check window maximized')
   love.window.restore()
   love.window.restore()
@@ -208,6 +223,7 @@ end
 
 
 -- love.window.minimize
 -- love.window.minimize
 love.test.window.minimize = function(test)
 love.test.window.minimize = function(test)
+  -- check minimizing is set
   love.window.minimize()
   love.window.minimize()
   test:assertEquals(true, love.window.isMinimized(), 'check window minimized')
   test:assertEquals(true, love.window.isMinimized(), 'check window minimized')
   love.window.restore()
   love.window.restore()
@@ -215,15 +231,17 @@ end
 
 
 
 
 -- love.window.requestAttention
 -- love.window.requestAttention
-love.window.requestAttention = function(test)
-  test:skipTest('cant really test this')
+love.test.window.requestAttention = function(test)
+  test:skipTest('cant test this worked')
 end
 end
 
 
 
 
 -- love.window.restore
 -- love.window.restore
 love.test.window.restore = function(test)
 love.test.window.restore = function(test)
+  -- check minimized to start
   love.window.minimize()
   love.window.minimize()
   test:assertEquals(true, love.window.isMinimized(), 'check window minimized')
   test:assertEquals(true, love.window.isMinimized(), 'check window minimized')
+  -- check restoring the state of the window
   love.window.restore()
   love.window.restore()
   test:assertEquals(false, love.window.isMinimized(), 'check window restored')
   test:assertEquals(false, love.window.isMinimized(), 'check window restored')
 end
 end
@@ -231,8 +249,10 @@ end
 
 
 -- love.window.setDisplaySleepEnabled
 -- love.window.setDisplaySleepEnabled
 love.test.window.setDisplaySleepEnabled = function(test)
 love.test.window.setDisplaySleepEnabled = function(test)
+  -- check disabling sleep
   love.window.setDisplaySleepEnabled(false)
   love.window.setDisplaySleepEnabled(false)
   test:assertEquals(false, love.window.isDisplaySleepEnabled(), 'check sleep disabled')
   test:assertEquals(false, love.window.isDisplaySleepEnabled(), 'check sleep disabled')
+  -- check setting it back to enabled
   love.window.setDisplaySleepEnabled(true)
   love.window.setDisplaySleepEnabled(true)
   test:assertEquals(true, love.window.isDisplaySleepEnabled(), 'check sleep enabled')
   test:assertEquals(true, love.window.isDisplaySleepEnabled(), 'check sleep enabled')
 end
 end
@@ -240,8 +260,10 @@ end
 
 
 -- love.window.setFullscreen
 -- love.window.setFullscreen
 love.test.window.setFullscreen = function(test)
 love.test.window.setFullscreen = function(test)
+  -- check fullscreen is set
   love.window.setFullscreen(true)
   love.window.setFullscreen(true)
   test:assertEquals(true, love.window.getFullscreen(), 'check fullscreen')
   test:assertEquals(true, love.window.getFullscreen(), 'check fullscreen')
+  -- check setting back to normal
   love.window.setFullscreen(false)
   love.window.setFullscreen(false)
   test:assertEquals(false, love.window.getFullscreen(), 'check not fullscreen')
   test:assertEquals(false, love.window.getFullscreen(), 'check not fullscreen')
 end
 end
@@ -250,20 +272,22 @@ end
 -- love.window.setIcon
 -- love.window.setIcon
 -- @NOTE could check the image data itself?
 -- @NOTE could check the image data itself?
 love.test.window.setIcon = function(test)
 love.test.window.setIcon = function(test)
+  -- check setting an icon returns the val
   local icon = love.image.newImageData('resources/love.png')
   local icon = love.image.newImageData('resources/love.png')
   love.window.setIcon(icon)
   love.window.setIcon(icon)
   test:assertNotEquals(nil, love.window.getIcon(), 'check icon not nil')
   test:assertNotEquals(nil, love.window.getIcon(), 'check icon not nil')
-  icon:release()
 end
 end
 
 
 
 
 -- love.window.setMode
 -- love.window.setMode
 -- @NOTE same as getMode could be checking more flag properties
 -- @NOTE same as getMode could be checking more flag properties
 love.test.window.setMode = function(test)
 love.test.window.setMode = function(test)
+  -- set window mode
   love.window.setMode(512, 512, {
   love.window.setMode(512, 512, {
     fullscreen = false,
     fullscreen = false,
     resizable = false
     resizable = false
   })
   })
+  -- check what we set is returned
   local width, height, flags = love.window.getMode()
   local width, height, flags = love.window.getMode()
   test:assertEquals(512, width, 'check window w match')
   test:assertEquals(512, width, 'check window w match')
   test:assertEquals(512, height, 'check window h match')
   test:assertEquals(512, height, 'check window h match')
@@ -277,6 +301,7 @@ end
 
 
 -- love.window.setPosition
 -- love.window.setPosition
 love.test.window.setPosition = function(test)
 love.test.window.setPosition = function(test)
+  -- check position is returned
   love.window.setPosition(100, 100, 1)
   love.window.setPosition(100, 100, 1)
   local x, y, _ = love.window.getPosition()
   local x, y, _ = love.window.getPosition()
   test:assertEquals(100, x, 'check position x')
   test:assertEquals(100, x, 'check position x')
@@ -286,6 +311,7 @@ end
 
 
 -- love.window.setTitle
 -- love.window.setTitle
 love.test.window.setTitle = function(test)
 love.test.window.setTitle = function(test)
+  -- check setting title val is returned
   love.window.setTitle('love.testing')
   love.window.setTitle('love.testing')
   test:assertEquals('love.testing', love.window.getTitle(), 'check title matches')
   test:assertEquals('love.testing', love.window.getTitle(), 'check title matches')
   love.window.setTitle('love.test')
   love.window.setTitle('love.test')
@@ -294,23 +320,25 @@ end
 
 
 -- love.window.setVSync
 -- love.window.setVSync
 love.test.window.setVSync = function(test)
 love.test.window.setVSync = function(test)
-  love.window.setVSync(false)
+  -- check setting vsync value off
+  love.window.setVSync(0)
   test:assertEquals(0, love.window.getVSync(), 'check vsync off')
   test:assertEquals(0, love.window.getVSync(), 'check vsync off')
-  love.window.setVSync(true)
+  -- check setting vsync value on
+  love.window.setVSync(1)
   test:assertEquals(1, love.window.getVSync(), 'check vsync on')
   test:assertEquals(1, love.window.getVSync(), 'check vsync on')
 end
 end
 
 
 
 
 -- love.window.showMessageBox
 -- love.window.showMessageBox
 -- @NOTE if running headless would need to skip anyway cos can't press it
 -- @NOTE if running headless would need to skip anyway cos can't press it
--- skipping here cos it's annoying
 love.test.window.showMessageBox = function(test)
 love.test.window.showMessageBox = function(test)
-  test:skipTest('skipping cos annoying to test with')
+  test:skipTest('cant test this worked')
 end
 end
 
 
 
 
 -- love.window.toPixels
 -- love.window.toPixels
 love.test.window.toPixels = function(test)
 love.test.window.toPixels = function(test)
+  -- check dpi/pixel ratio is as expected
   local dpi = love.window.getDPIScale()
   local dpi = love.window.getDPIScale()
   local pixels = love.window.toPixels(50)
   local pixels = love.window.toPixels(50)
   test:assertEquals(50*dpi, pixels, 'check dpi ratio')
   test:assertEquals(50*dpi, pixels, 'check dpi ratio')
@@ -319,18 +347,21 @@ end
 
 
 -- love.window.updateMode
 -- love.window.updateMode
 love.test.window.updateMode = function(test)
 love.test.window.updateMode = function(test)
+  -- set initial mode
   love.window.setMode(512, 512, {
   love.window.setMode(512, 512, {
     fullscreen = false,
     fullscreen = false,
     resizable = false
     resizable = false
   })
   })
+  -- update mode with some props but not others
   love.window.updateMode(256, 256, nil)
   love.window.updateMode(256, 256, nil)
+  -- check only changed values changed
   local width, height, flags = love.window.getMode()
   local width, height, flags = love.window.getMode()
   test:assertEquals(256, width, 'check window w match')
   test:assertEquals(256, width, 'check window w match')
   test:assertEquals(256, height, 'check window h match')
   test:assertEquals(256, height, 'check window h match')
   test:assertEquals(false, flags["fullscreen"], 'check window not fullscreen')
   test:assertEquals(false, flags["fullscreen"], 'check window not fullscreen')
   test:assertEquals(false, flags["resizable"], 'check window not resizeable')
   test:assertEquals(false, flags["resizable"], 'check window not resizeable')
-  love.window.setMode(256, 256, {
+  love.window.setMode(256, 256, { -- reset
     fullscreen = false,
     fullscreen = false,
     resizable = true
     resizable = true
   })
   })
-end
+end

+ 26 - 0
testing/todo.md

@@ -0,0 +1,26 @@
+`/Applications/love_12.app/Contents/MacOS/love ./testing`
+
+# v0.2
+
+## Changed
+- 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
+
+## Todo
+- graphics state methods
+- graphics drawing methods
+- need a platform: format table somewhere for compressed formats (i.e. DXT not supported)

Some files were not shown because too many files changed in this diff