Browse Source

finish graphics module + HTML image comparison

- added mostly all graphics draw tests
- added a basic set of "expected" images (generated from successful tests)
- HTML output now shows the expected vs actual generated images for each of the graphics tests applicable
ell 1 year ago
parent
commit
f477b8085f
49 changed files with 366 additions and 32 deletions
  1. 27 6
      .github/workflows/main.yml
  2. 1 0
      .gitignore
  3. 32 6
      testing/classes/TestMethod.lua
  4. 1 1
      testing/classes/TestModule.lua
  5. 0 2
      testing/classes/TestSuite.lua
  6. 3 0
      testing/main.lua
  7. 2 0
      testing/output/actual/notes.txt
  8. BIN
      testing/output/expected/love.test.graphics.applyTransform-1.png
  9. BIN
      testing/output/expected/love.test.graphics.arc-1.png
  10. BIN
      testing/output/expected/love.test.graphics.arc-2.png
  11. BIN
      testing/output/expected/love.test.graphics.arc-3.png
  12. BIN
      testing/output/expected/love.test.graphics.circle-1.png
  13. BIN
      testing/output/expected/love.test.graphics.clear-1.png
  14. BIN
      testing/output/expected/love.test.graphics.draw-1.png
  15. BIN
      testing/output/expected/love.test.graphics.drawLayer-1.png
  16. BIN
      testing/output/expected/love.test.graphics.ellipse-1.png
  17. BIN
      testing/output/expected/love.test.graphics.intersectScissor-1.png
  18. BIN
      testing/output/expected/love.test.graphics.line-1.png
  19. BIN
      testing/output/expected/love.test.graphics.origin-1.png
  20. BIN
      testing/output/expected/love.test.graphics.points-1.png
  21. BIN
      testing/output/expected/love.test.graphics.polygon-1.png
  22. BIN
      testing/output/expected/love.test.graphics.pop-1.png
  23. BIN
      testing/output/expected/love.test.graphics.print-1.png
  24. BIN
      testing/output/expected/love.test.graphics.printf-1.png
  25. BIN
      testing/output/expected/love.test.graphics.push-1.png
  26. BIN
      testing/output/expected/love.test.graphics.rectangle-1.png
  27. BIN
      testing/output/expected/love.test.graphics.rectangle-2.png
  28. BIN
      testing/output/expected/love.test.graphics.replaceTransform-1.png
  29. BIN
      testing/output/expected/love.test.graphics.rotate-1.png
  30. BIN
      testing/output/expected/love.test.graphics.setBlendMode-1.png
  31. BIN
      testing/output/expected/love.test.graphics.setCanvas-1.png
  32. BIN
      testing/output/expected/love.test.graphics.setColor-1.png
  33. BIN
      testing/output/expected/love.test.graphics.setColorMask-1.png
  34. BIN
      testing/output/expected/love.test.graphics.setFont-1.png
  35. BIN
      testing/output/expected/love.test.graphics.setLineJoin-1.png
  36. BIN
      testing/output/expected/love.test.graphics.setLineStyle-1.png
  37. BIN
      testing/output/expected/love.test.graphics.setLineWidth-1.png
  38. BIN
      testing/output/expected/love.test.graphics.setScissor-1.png
  39. BIN
      testing/output/expected/love.test.graphics.setShader-1.png
  40. BIN
      testing/output/expected/love.test.graphics.setStencilTest-1.png
  41. BIN
      testing/output/expected/love.test.graphics.setWireframe-1.png
  42. BIN
      testing/output/expected/love.test.graphics.shear-1.png
  43. BIN
      testing/output/expected/love.test.graphics.shear-2.png
  44. BIN
      testing/output/expected/love.test.graphics.translate-1.png
  45. 2 0
      testing/output/expected/notes.txt
  46. 0 0
      testing/output/notes.txt
  47. BIN
      testing/resources/loveinv.png
  48. 295 15
      testing/tests/graphics.lua
  49. 3 2
      testing/todo.md

+ 27 - 6
.github/workflows/main.yml

@@ -4,6 +4,7 @@ on: [push, pull_request]
 jobs:
 jobs:
   linux-os:
   linux-os:
     runs-on: ubuntu-20.04
     runs-on: ubuntu-20.04
+    timeout-minutes: 60
     steps:
     steps:
     - name: Update APT
     - name: Update APT
       run: sudo apt-get update
       run: sudo apt-get update
@@ -50,9 +51,12 @@ jobs:
         name: love-x86_64-AppImage-debug
         name: love-x86_64-AppImage-debug
         path: love-${{ github.sha }}.AppImage-debug.tar.gz
         path: love-${{ github.sha }}.AppImage-debug.tar.gz
     - name: Make Runnable
     - name: Make Runnable
-      run: chmod a+x love-${{ github.sha }}.AppImage
+      run: |
+        chmod a+x love-${{ github.sha }}.AppImage
+        echo "ready to run"
+        ls
     - name: Run All Tests
     - name: Run All Tests
-      run: xvfb-run ./love-${{ github.sha }}.AppImage testing
+      run: xvfb-run ./love-${{ github.sha }}.AppImage ./testing/main.lua
     - name: Love Test Report
     - name: Love Test Report
       uses: ellraiser/love-test-report@main
       uses: ellraiser/love-test-report@main
       with:
       with:
@@ -61,6 +65,7 @@ jobs:
         path: testing/output/lovetest_runAllTests.md
         path: testing/output/lovetest_runAllTests.md
   windows-os:
   windows-os:
     runs-on: windows-latest
     runs-on: windows-latest
+    timeout-minutes: 60
     strategy:
     strategy:
       matrix:
       matrix:
         platform: [Win32, x64, ARM64]
         platform: [Win32, x64, ARM64]
@@ -214,9 +219,21 @@ jobs:
       uses: actions/upload-artifact@v3
       uses: actions/upload-artifact@v3
       with:
       with:
         name: love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-dbg
         name: love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-dbg
-        path: pdb/Release/*.pdb
+        path: pdb/Release/*.pdb  
+    - name: Install Scream
+      shell: powershell
+      run: |
+        Start-Service audio*
+        Invoke-WebRequest https://github.com/duncanthrax/scream/releases/download/3.6/Scream3.6.zip -OutFile C:\Scream3.6.zip
+        Extract-7Zip -Path C:\Scream3.6.zip -DestinationPath C:\Scream
+        $cert = (Get-AuthenticodeSignature C:\Scream\Install\driver\Scream.sys).SignerCertificate
+        $store = [System.Security.Cryptography.X509Certificates.X509Store]::new("TrustedPublisher", "LocalMachine")
+        $store.Open("ReadWrite")
+        $store.Add($cert)
+        $store.Close()
+        cd C:\Scream\Install\driver
+        C:\Scream\Install\helpers\devcon install Scream.inf *Scream 
     - name: Install Mesa 
     - name: Install Mesa 
-      if: steps.vars.outputs.arch != 'ARM64'
       run: |
       run: |
         curl -L --output mesa.7z --url https://github.com/pal1000/mesa-dist-win/releases/download/23.2.1/mesa3d-23.2.1-release-msvc.7z
         curl -L --output mesa.7z --url https://github.com/pal1000/mesa-dist-win/releases/download/23.2.1/mesa3d-23.2.1-release-msvc.7z
         7z x mesa.7z -o*
         7z x mesa.7z -o*
@@ -226,7 +243,9 @@ jobs:
       run: cmake --build build --config Release --target install
       run: cmake --build build --config Release --target install
     - name: Run All Tests
     - name: Run All Tests
       if: steps.vars.outputs.arch != 'ARM64'
       if: steps.vars.outputs.arch != 'ARM64'
-      run: powershell.exe install/lovec.exe testing
+      run: |
+        dir
+        powershell.exe ./install/lovec.exe ./testing/main.lua
     - name: Love Test Report
     - name: Love Test Report
       if: steps.vars.outputs.arch != 'ARM64'
       if: steps.vars.outputs.arch != 'ARM64'
       uses: ellraiser/love-test-report@main
       uses: ellraiser/love-test-report@main
@@ -236,6 +255,7 @@ jobs:
         path: testing/output/lovetest_runAllTests.md
         path: testing/output/lovetest_runAllTests.md
   macOS:
   macOS:
     runs-on: macos-latest
     runs-on: macos-latest
+    timeout-minutes: 60
     steps:
     steps:
     - name: Checkout
     - name: Checkout
       uses: actions/checkout@v3
       uses: actions/checkout@v3
@@ -263,7 +283,7 @@ jobs:
         name: love-macos
         name: love-macos
         path: love-macos.zip
         path: love-macos.zip
     - name: Run All Tests
     - name: Run All Tests
-      run: love-macos/love.app/Contents/MacOS/love testing
+      run: love-macos/love.app/Contents/MacOS/love testing/main.lua
     - name: Love Test Report
     - name: Love Test Report
       uses: ellraiser/love-test-report@main
       uses: ellraiser/love-test-report@main
       with:
       with:
@@ -272,6 +292,7 @@ jobs:
         path: testing/output/lovetest_runAllTests.md
         path: testing/output/lovetest_runAllTests.md
   iOS-Simulator:
   iOS-Simulator:
     runs-on: macos-latest
     runs-on: macos-latest
+    timeout-minutes: 60
     steps:
     steps:
     - name: Checkout
     - name: Checkout
       uses: actions/checkout@v3
       uses: actions/checkout@v3

+ 1 - 0
.gitignore

@@ -72,3 +72,4 @@ stamp-h1
 /testing/output/*.xml
 /testing/output/*.xml
 /testing/output/*.html
 /testing/output/*.html
 /testing/output/*.md
 /testing/output/*.md
+/testing/output/actual/*.png

+ 32 - 6
testing/classes/TestMethod.lua

@@ -33,9 +33,13 @@ TestMethod = {
         blue = {0, 0, 1, 1},
         blue = {0, 0, 1, 1},
         bluefade = {0, 0, 1, 0.5},
         bluefade = {0, 0, 1, 0.5},
         yellow = {1, 1, 0, 1},
         yellow = {1, 1, 0, 1},
+        pink = {1, 0, 1, 1},
         black = {0, 0, 0, 1},
         black = {0, 0, 0, 1},
-        white = {1, 1, 1, 1}
+        white = {1, 1, 1, 1},
+        lovepink = {214/255, 86/255, 151/255, 1},
+        loveblue = {83/255, 168/255, 220/255, 1}
       },
       },
+      imgs = 1,
       delay = 0,
       delay = 0,
       delayed = false
       delayed = false
     }
     }
@@ -82,6 +86,10 @@ TestMethod = {
         tg = math.floor((tg*10)+0.5)/10
         tg = math.floor((tg*10)+0.5)/10
         tb = math.floor((tb*10)+0.5)/10
         tb = math.floor((tb*10)+0.5)/10
         ta = math.floor((ta*10)+0.5)/10
         ta = math.floor((ta*10)+0.5)/10
+        col[1] = math.floor((col[1]*10)+0.5)/10
+        col[2] = math.floor((col[2]*10)+0.5)/10
+        col[3] = math.floor((col[3]*10)+0.5)/10
+        col[4] = math.floor((col[4]*10)+0.5)/10
         -- @TODO add some sort pixel tolerance to the coords
         -- @TODO add some sort pixel tolerance to the coords
         self:assertEquals(col[1], tr, 'check pixel r for ' .. i .. ' at ' .. compare_id .. '(' .. label .. ')')
         self:assertEquals(col[1], tr, 'check pixel r for ' .. i .. ' at ' .. compare_id .. '(' .. label .. ')')
         self:assertEquals(col[2], tg, 'check pixel g for ' .. i .. ' at ' .. compare_id .. '(' .. label .. ')')
         self:assertEquals(col[2], tg, 'check pixel g for ' .. i .. ' at ' .. compare_id .. '(' .. label .. ')')
@@ -227,6 +235,14 @@ TestMethod = {
   end,
   end,
 
 
 
 
+  exportImg = function(self, imgdata)
+    local path = 'tempoutput/actual/love.test.graphics.' .. 
+      self.method .. '-' .. tostring(self.imgs) .. '.png'
+    imgdata:encode('png', path)
+    self.imgs = self.imgs + 1
+  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
   -- @param {string} reason - reason why method is being skipped
   -- @param {string} reason - reason why method is being skipped
@@ -356,11 +372,21 @@ TestMethod = {
 
 
     -- 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
     local preview = ''
     local preview = ''
-    -- if self.testmodule.module == 'graphics' then
-    --   local filename = 'love_test_graphics_rectangle'
-    --   preview = '<div class="preview">' .. '<img src="' .. filename .. '_expected.png"/><p>Expected</p></div>' ..
-    --     '<div class="preview"><img src="' .. filename .. '_actual.png"/><p>Actual</p></div>'
-    -- end
+    if self.testmodule.module == 'graphics' then
+      local filename = 'love.test.graphics.' .. self.method
+      if love.filesystem.openFile('tempoutput/actual/' .. filename .. '-1.png', 'r') then
+        preview = '<div class="preview">' .. '<img src="expected/' .. filename .. '-1.png"/><p>Expected</p></div>' ..
+          '<div class="preview">' .. '<img src="actual/' .. filename .. '-1.png"/><p>Actual</p></div>'
+      end
+      if love.filesystem.openFile('tempoutput/actual/' .. filename .. '-2.png', 'r') then
+        preview = preview .. '<div class="preview">' .. '<img src="expected/' .. filename .. '-2.png"/><p>Expected</p></div>' ..
+          '<div class="preview">' .. '<img src="actual/' .. filename .. '-2.png"/><p>Actual</p></div>'
+      end
+      if love.filesystem.openFile('tempoutput/actual/' .. filename .. '-3.png', 'r') then
+        preview = preview .. '<div class="preview">' .. '<img src="expected/' .. filename .. '-3.png"/><p>Expected</p></div>' ..
+          '<div class="preview">' .. '<img src="actual/' .. filename .. '-3.png"/><p>Actual</p></div>'
+      end
+    end
 
 
     -- append HTML for the test class result 
     -- append HTML for the test class result 
     local status = '🔴'
     local status = '🔴'

+ 1 - 1
testing/classes/TestModule.lua

@@ -88,7 +88,7 @@ TestModule = {
     if self.failed == 0 then status = '🟢' end
     if self.failed == 0 then status = '🟢' end
     -- add md row to main output
     -- add md row to main output
     love.test.mdrows = love.test.mdrows .. '| ' .. status .. 
     love.test.mdrows = love.test.mdrows .. '| ' .. status .. 
-      ' love.' .. self.module .. 
+      ' ' .. self.module .. 
       ' | ' .. tostring(self.passed) .. 
       ' | ' .. tostring(self.passed) .. 
       ' | ' .. tostring(self.failed) .. 
       ' | ' .. tostring(self.failed) .. 
       ' | ' .. tostring(self.skipped) .. 
       ' | ' .. tostring(self.skipped) .. 

+ 0 - 2
testing/classes/TestSuite.lua

@@ -187,8 +187,6 @@ TestSuite = {
       '<li>🟡&nbsp;' .. tostring(self.totals[3]) .. ' Skipped</li>' ..
       '<li>🟡&nbsp;' .. tostring(self.totals[3]) .. ' Skipped</li>' ..
       '<li>' .. finaltime .. 's</li></ul><br/><br/>'
       '<li>' .. finaltime .. 's</li></ul><br/><br/>'
 
 
-    -- @TODO use mountFullPath to write output to src?
-    love.filesystem.mountFullPath(love.filesystem.getSource() .. "/output", "tempoutput", "readwrite")
     love.filesystem.write('tempoutput/' .. self.output .. '.xml', xml .. self.xml .. '</testsuites>')
     love.filesystem.write('tempoutput/' .. self.output .. '.xml', xml .. self.xml .. '</testsuites>')
     love.filesystem.write('tempoutput/' .. self.output .. '.html', html .. self.html .. '</div></body></html>')
     love.filesystem.write('tempoutput/' .. self.output .. '.html', html .. self.html .. '</div></body></html>')
     love.filesystem.write('tempoutput/' .. self.output .. '.md', md)
     love.filesystem.write('tempoutput/' .. self.output .. '.md', md)

+ 3 - 0
testing/main.lua

@@ -53,6 +53,9 @@ love.load = function(args)
     end
     end
   end
   end
 
 
+  -- mount for output later
+  love.filesystem.mountFullPath(love.filesystem.getSource() .. "/output", "tempoutput", "readwrite")
+
   -- get all args with any comma lists split out as seperate
   -- get all args with any comma lists split out as seperate
   local arglist = {}
   local arglist = {}
   for a=1,#args do
   for a=1,#args do

+ 2 - 0
testing/output/actual/notes.txt

@@ -0,0 +1,2 @@
+# Actual Graphics Output
+The images generated by the tests

BIN
testing/output/expected/love.test.graphics.applyTransform-1.png


BIN
testing/output/expected/love.test.graphics.arc-1.png


BIN
testing/output/expected/love.test.graphics.arc-2.png


BIN
testing/output/expected/love.test.graphics.arc-3.png


BIN
testing/output/expected/love.test.graphics.circle-1.png


BIN
testing/output/expected/love.test.graphics.clear-1.png


BIN
testing/output/expected/love.test.graphics.draw-1.png


BIN
testing/output/expected/love.test.graphics.drawLayer-1.png


BIN
testing/output/expected/love.test.graphics.ellipse-1.png


BIN
testing/output/expected/love.test.graphics.intersectScissor-1.png


BIN
testing/output/expected/love.test.graphics.line-1.png


BIN
testing/output/expected/love.test.graphics.origin-1.png


BIN
testing/output/expected/love.test.graphics.points-1.png


BIN
testing/output/expected/love.test.graphics.polygon-1.png


BIN
testing/output/expected/love.test.graphics.pop-1.png


BIN
testing/output/expected/love.test.graphics.print-1.png


BIN
testing/output/expected/love.test.graphics.printf-1.png


BIN
testing/output/expected/love.test.graphics.push-1.png


BIN
testing/output/expected/love.test.graphics.rectangle-1.png


BIN
testing/output/expected/love.test.graphics.rectangle-2.png


BIN
testing/output/expected/love.test.graphics.replaceTransform-1.png


BIN
testing/output/expected/love.test.graphics.rotate-1.png


BIN
testing/output/expected/love.test.graphics.setBlendMode-1.png


BIN
testing/output/expected/love.test.graphics.setCanvas-1.png


BIN
testing/output/expected/love.test.graphics.setColor-1.png


BIN
testing/output/expected/love.test.graphics.setColorMask-1.png


BIN
testing/output/expected/love.test.graphics.setFont-1.png


BIN
testing/output/expected/love.test.graphics.setLineJoin-1.png


BIN
testing/output/expected/love.test.graphics.setLineStyle-1.png


BIN
testing/output/expected/love.test.graphics.setLineWidth-1.png


BIN
testing/output/expected/love.test.graphics.setScissor-1.png


BIN
testing/output/expected/love.test.graphics.setShader-1.png


BIN
testing/output/expected/love.test.graphics.setStencilTest-1.png


BIN
testing/output/expected/love.test.graphics.setWireframe-1.png


BIN
testing/output/expected/love.test.graphics.shear-1.png


BIN
testing/output/expected/love.test.graphics.shear-2.png


BIN
testing/output/expected/love.test.graphics.translate-1.png


+ 2 - 0
testing/output/expected/notes.txt

@@ -0,0 +1,2 @@
+# Expected Graphics Output
+The images expected by the tests

+ 0 - 0
testing/output/readme.md → testing/output/notes.txt


BIN
testing/resources/loveinv.png


+ 295 - 15
testing/tests/graphics.lua

@@ -10,31 +10,159 @@
 
 
 -- love.graphics.arc
 -- love.graphics.arc
 love.test.graphics.arc = function(test)
 love.test.graphics.arc = function(test)
-  test:skipTest('test class needs writing')
+  -- draw some arcs using pi format
+  local canvas = love.graphics.newCanvas(32, 32)
+  love.graphics.setCanvas(canvas)
+    love.graphics.clear(0, 0, 0, 1)
+    love.graphics.setColor(1, 1, 1, 1)
+    love.graphics.arc('line', "pie", 16, 16, 16, 0 * (math.pi/180), 360 * (math.pi/180), 10)
+    love.graphics.arc('fill', "pie", 16, 16, 16, 270 * (math.pi/180), 45 * (math.pi/180), 10)
+    love.graphics.setColor(1, 0, 0, 1)
+    love.graphics.arc('line', "pie", 16, 16, 16, 0 * (math.pi/180), 90 * (math.pi/180), 10)
+    love.graphics.setColor(1, 1, 0, 1)
+    love.graphics.arc('line', "pie", 16, 16, 16, 180 * (math.pi/180), 135 * (math.pi/180), 10)
+    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, {
+    white = {{11,0},{20,0},{0,13},{0,14},{31,13},{31,14},{15,14}},
+    black = {{16,14},{16,16},{30,14},{30,16}},
+    yellow = {{15,15},{15,16},{16,15},{0,15},{4,27},{5,26},{14,17}},
+    red = {{15,17},{15,31},{17,15},{31,15},{28,26},{27,27}}
+  }, 'arc pi')
+  -- draw some arcs with open format
+  love.graphics.setCanvas(canvas)
+    love.graphics.clear(0, 0, 0, 1)
+    love.graphics.setColor(1, 1, 1, 1)
+    love.graphics.arc('line', "open", 16, 16, 16, 0 * (math.pi/180), 315 * (math.pi/180), 10)
+    love.graphics.setColor(1, 0, 0, 1)
+    love.graphics.arc('fill', "open", 16, 16, 16, 0 * (math.pi/180), 180 * (math.pi/180), 10)
+    love.graphics.setColor(1, 1, 0, 1)
+    love.graphics.arc('fill', "open", 16, 16, 16, 180 * (math.pi/180), 90 * (math.pi/180), 10)
+    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, {
+    white = {{11,0},{20,0},{26,4},{5,4},{0,15},{19,31},{31,19}},
+    black = {{27,5},{27,4},{26,5},{1,15},{31,15}},
+    yellow = {{0,17},{0,19},{12,31},{14,31},{6,23},{7,24}},
+    red = {{0,16},{31,16},{31,18},{30,21},{18,31},{15,16},{16,16}}
+  }, 'arc open')
+  -- draw some arcs with closed format
+  love.graphics.setCanvas(canvas)
+    love.graphics.clear(0, 0, 0, 1)
+    love.graphics.setColor(1, 1, 1, 1)
+    love.graphics.arc('line', "closed", 16, 16, 16, 0 * (math.pi/180), 315 * (math.pi/180), 10)
+    love.graphics.setColor(1, 0, 0, 1)
+    love.graphics.arc('fill', "closed", 16, 16, 16, 0 * (math.pi/180), 180 * (math.pi/180), 10)
+    love.graphics.setColor(1, 1, 0, 1)
+    love.graphics.arc('line', "closed", 16, 16, 16, 180 * (math.pi/180), 90 * (math.pi/180), 10)
+    love.graphics.setColor(1, 1, 1, 1)
+  love.graphics.setCanvas()
+  local imgdata3 = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16})
+  test:assertPixels(imgdata3, {
+    white = {{11,0},{20,0},{26,4},{5,4},{0,15},{19,31},{31,19}},
+    yellow = {{0,17},{0,19},{12,31},{14,31}},
+    red = {{31,16},{31,18},{30,21},{18,31},{15,16},{16,16}}
+  }, 'arc open')
+  test:exportImg(imgdata1)
+  test:exportImg(imgdata2)
+  test:exportImg(imgdata3)
 end
 end
 
 
 
 
 -- love.graphics.circle
 -- love.graphics.circle
 love.test.graphics.circle = function(test)
 love.test.graphics.circle = function(test)
-  test:skipTest('test class needs writing')
+  -- draw some circles
+  local canvas = love.graphics.newCanvas(32, 32)
+  love.graphics.setCanvas(canvas)
+    love.graphics.clear(0, 0, 0, 1)
+    love.graphics.setColor(1, 1, 1, 1)
+    love.graphics.circle('fill', 16, 16, 16)
+    love.graphics.setColor(1, 0, 0, 1)
+    love.graphics.circle('line', 16, 16, 16)
+    love.graphics.setColor(1, 1, 0, 1)
+    love.graphics.circle('fill', 16, 16, 8)
+    love.graphics.setColor(0, 1, 0, 1)
+    love.graphics.circle('fill', 16, 16, 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, {
+    white = {{13,8},{18,8},{23,13},{23,18}},
+    green = {
+      {15,12},{16,12},{13,13},{18,13},{12,15},{12,16},{13,18},{18,18},
+      {15,19},{16,19},{19,15},{19,16}
+    },
+    black = {{10,0},{21,0},{0,10},{0,21},{31,10},{31,21},{10,31},{21,31}},
+    yellow = {
+      {11,10},{10,11},{8,14},{8,17},{10,20},{11,21},{14,23},{17,23},{20,21},
+      {21,20},{23,17},{23,14},{20,10},{21,11},{17,8},{14,8}
+    },
+    red = {{11,0},{20,0},{11,31},{20,31},{0,11},{0,20},{31,20},{31,11}}
+  }, 'circle')
+  test:exportImg(imgdata)
 end
 end
 
 
 
 
+
 -- love.graphics.clear
 -- love.graphics.clear
 love.test.graphics.clear = function(test)
 love.test.graphics.clear = function(test)
-  test:skipTest('test class needs writing')
+  local canvas = love.graphics.newCanvas(16, 16)
+  love.graphics.setCanvas(canvas)
+    love.graphics.clear(0, 0, 0, 1)
+    love.graphics.clear(1, 1, 0, 1)
+  love.graphics.setCanvas()
+  local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16})
+  test:assertPixels(imgdata, {
+    yellow = {{0,0},{15,0},{0,15},{15,15},{8,8}}
+  }, 'clear')
+  test:exportImg(imgdata)
 end
 end
 
 
 
 
 -- love.graphics.discard
 -- love.graphics.discard
 love.test.graphics.discard = function(test)
 love.test.graphics.discard = function(test)
-  test:skipTest('test class needs writing')
+  test:skipTest('cant test this worked')
+  -- wrote all this before seeing "on some desktops this may do nothing"
+  -- leaving in case we need it in future
+  --local canvas = love.graphics.newCanvas(32, 32)
+  --love.graphics.setCanvas(canvas)
+  --  love.graphics.clear(0, 0, 0, 1)
+  --  love.graphics.draw(Logo.texture, Logo.img, 0, 0)
+  --  love.graphics.discard(true, true)
+  --love.graphics.setCanvas()
 end
 end
 
 
 
 
 -- love.graphics.draw
 -- love.graphics.draw
 love.test.graphics.draw = function(test)
 love.test.graphics.draw = function(test)
-  test:skipTest('test class needs writing')
+  local canvas1 = love.graphics.newCanvas(32, 32)
+  local canvas2 = love.graphics.newCanvas(32, 32)
+  local transform = love.math.newTransform( )
+  transform:translate(16, 0)
+  transform:scale(0.5, 0.5)
+  love.graphics.setCanvas(canvas1)
+    love.graphics.clear(0, 0, 0, 1)
+    -- img, offset
+    love.graphics.draw(Logo.texture, Logo.img, 0, 0, 0, 1, 1, 16, 16)
+  love.graphics.setCanvas()
+  love.graphics.setCanvas(canvas2)
+    love.graphics.clear(1, 0, 0, 1)
+    -- canvas, scale, shear, transform obj
+    love.graphics.draw(canvas1, 0, 0, 0, 0.5, 0.5, 0, 0, 2, 2)
+    love.graphics.draw(canvas1, 0, 16, 0, 0.5, 0.5)
+    love.graphics.draw(canvas1, 16, 16, 0, 0.5, 0.5)
+    love.graphics.draw(canvas1, transform)
+  love.graphics.setCanvas()
+  local imgdata = love.graphics.readbackTexture(canvas2, {16, 0, 0, 0, 16, 16})
+  test:assertPixels(imgdata, {
+    lovepink = {{23,3},{23,19},{7,19},{0,0},{16,0},{0,16},{16,16}},
+    loveblue = {{0,31},{15,17},{15,31},{16,31},{31,17},{31,31},{16,15},{31,15}},
+    white = {{15, 15},{6,19},{8,19},{22,19},{24,19},{22,3},{24,3}},
+    red = {{0,1},{1,0},{15,0},{15,7},{0,15},{7,15}}
+  }, 'drawing')
+  test:exportImg(imgdata)
 end
 end
 
 
 
 
@@ -46,37 +174,115 @@ end
 
 
 -- love.graphics.drawLayer
 -- love.graphics.drawLayer
 love.test.graphics.drawLayer = function(test)
 love.test.graphics.drawLayer = function(test)
-  test:skipTest('test class needs writing')
+  local image = love.graphics.newArrayImage({
+    'resources/love.png', 'resources/loveinv.png',
+    'resources/love.png', 'resources/loveinv.png'
+  })
+  local canvas = love.graphics.newCanvas(64, 64)
+  love.graphics.setCanvas(canvas)
+    love.graphics.clear(0, 0, 0, 1)
+    love.graphics.drawLayer(image, 1, 0, 0, 0, 1, 1)
+    love.graphics.drawLayer(image, 2, 32, 0, 0, 0.5, 0.5)
+    love.graphics.drawLayer(image, 4, 0, 32, 0, 0.5, 0.5)
+    love.graphics.drawLayer(image, 3, 32, 32, 0, 2, 2, 16, 16)
+  love.graphics.setCanvas()
+  local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16})
+  test:assertPixels(imgdata, {
+    lovepink = {{30,2},{33,2},{2,30},{2,33},{4,60},{4,63},{60,4},{63,4},{31,23},{32,23}},
+    loveblue = {{14,33},{17,33},{46,1},{49,1},{1,46},{1,49},{33,14},{33,17}},
+    black = {{0,0},{63,0},{0,63},{39,6},{40,6},{6,39},{6,40},{6,55},{55,6}},
+    white = {{46,11},{48,11},{14,43},{16,43},{30,23},{33,23},{34,54},{53,40},{63,63}}
+  }, 'draw layer')
+  test:exportImg(imgdata)
 end
 end
 
 
 
 
 -- love.graphics.ellipse
 -- love.graphics.ellipse
 love.test.graphics.ellipse = function(test)
 love.test.graphics.ellipse = function(test)
-  test:skipTest('test class needs writing')
+  local canvas = love.graphics.newCanvas(32, 32)
+  love.graphics.setCanvas(canvas)
+    love.graphics.clear(0, 0, 0, 1)
+    love.graphics.setColor(1, 0, 0, 1)
+    love.graphics.ellipse('fill', 16, 16, 16, 8)
+    love.graphics.setColor(1, 1, 0, 1)
+    love.graphics.ellipse('fill', 24, 24, 10, 24)
+    love.graphics.setColor(1, 0, 1, 1)
+    love.graphics.ellipse('fill', 16, 0, 8, 16)
+    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,14},{0,17},{7,9},{7,22},{14,15},{14,16}},
+    pink = {{15,15},{16,15},{8,0},{8,4},{23,0},{23,4},{13,14},{18,14}},
+    yellow = {{24,0},{25,0},{14,17},{14,30},{15,31},{31,8}}
+  }, 'ellipses')
+  test:exportImg(imgdata)
 end
 end
 
 
 
 
 -- love.graphics.flushBatch
 -- love.graphics.flushBatch
 love.test.graphics.flushBatch = function(test)
 love.test.graphics.flushBatch = function(test)
-  test:skipTest('test class needs writing')
+  test:skipTest('not sure can be tested as used internally')
 end
 end
 
 
 
 
 -- love.graphics.line
 -- love.graphics.line
 love.test.graphics.line = function(test)
 love.test.graphics.line = function(test)
-  test:skipTest('test class needs writing')
+  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.line(1,1,16,1,16,16,1,16,1,1)
+    love.graphics.setColor(1, 1, 0, 1)
+    love.graphics.line({0,0,8,8,16,0,8,8,16,16,8,8,0,16})
+    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, {
+    yellow = {{0,0},{15,0},{0,15},{15,15},{7,7},{8,7},{8,7},{8,8}},
+    red = {{1,0},{14,0},{0,1},{0,14},{15,1},{15,14},{1,15},{14,15}}
+  }, 'lines')
+  test:exportImg(imgdata)
 end
 end
 
 
 
 
 -- love.graphics.points
 -- love.graphics.points
 love.test.graphics.points = function(test)
 love.test.graphics.points = function(test)
-  test:skipTest('test class needs writing')
+  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.points(1,1,16,1,16,16,1,16,1,1)
+    love.graphics.setColor(1, 1, 0, 1)
+    love.graphics.points({2,2,8,8,15,2,8,9,15,15,9,9,2,15,9,8})
+    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, {
+    yellow = {{1,1},{14,1},{1,14},{14,14},{7,7},{8,7},{8,7},{8,8}},
+    red = {{0,0},{15,0},{15,15},{0,15}}
+  }, 'points')
+  test:exportImg(imgdata)
 end
 end
 
 
 
 
 -- love.graphics.polygon
 -- love.graphics.polygon
 love.test.graphics.polygon = function(test)
 love.test.graphics.polygon = function(test)
-  test:skipTest('test class needs writing')
+  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.polygon("fill", 1, 1, 4, 5, 8, 10, 16, 2, 7, 3, 5, 16, 16, 16, 1, 8)
+    love.graphics.setColor(1, 1, 0, 1)
+    love.graphics.polygon("line", {2, 2, 4, 5, 3, 7, 8, 15, 12, 4, 5, 10})
+    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, {
+    yellow = {{1,0},{1,1},{5,9},{7,14},{8,14},{12,3}},
+    red = {{2,1},{1,2},{1,7},{5,15},{14,15},{8,8},{14,2},{7,1}}
+  }, 'polygon')
+  test:exportImg(imgdata)
 end
 end
 
 
 
 
@@ -88,13 +294,61 @@ end
 
 
 -- love.graphics.print
 -- love.graphics.print
 love.test.graphics.print = function(test)
 love.test.graphics.print = function(test)
-  test:skipTest('test class needs writing')
+  love.graphics.setFont(Font)
+  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.print('love', 0, 3, 0, 1, 1, 0, 0)
+    love.graphics.setColor(0, 1, 0, 1)
+    love.graphics.print('ooo', 0, 3, 0, 2, 2, 0, 0)
+    love.graphics.setColor(0, 0, 1, 1)
+    love.graphics.print('hello', 0, 3, 90*(math.pi/180), 1, 1, 0, 8)
+    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},{1,0},{1,1},{2,6},{4,4},{7,6},{10,2},{11,5},{14,3},{14,4}},
+    green = {
+      {2,1},{2,2},{0,3},{1,3},{1,8},{2,9},{7,10},{8,8},{9,4},{13,3},{14,2},
+      {13,8},{14,9}
+    },
+    blue = {
+      {4,15},{10,15},{4,12},{6,12},{8,12},{5,9},{7,9},{4,3},{10,3},{8,6},{7,7},
+      {4,7},{7,13},{8,12}
+    }
+  }, 'print')
+  test:exportImg(imgdata)
 end
 end
 
 
 
 
 -- love.graphics.printf
 -- love.graphics.printf
 love.test.graphics.printf = function(test)
 love.test.graphics.printf = function(test)
-  test:skipTest('test class needs writing')
+  love.graphics.setFont(Font)
+  local canvas = love.graphics.newCanvas(32, 32)
+  love.graphics.setCanvas(canvas)
+    love.graphics.clear(0, 0, 0, 1)
+    love.graphics.setColor(1, 0, 0, 1)
+    love.graphics.printf('love', 0, 0, 8, "left")
+    love.graphics.setColor(0, 1, 0, 1)
+    love.graphics.printf('love', 0, 5, 16, "right")
+    love.graphics.setColor(0, 0, 1, 1)
+    love.graphics.printf('love', 0, 7, 32, "center")
+    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,0},{1,1},{0,3},{2,3},{2,7},{0,9},{3,11},{4,10},{0,15},{4,15},{2,19},
+      {0,24},{1,23},{3,23},{4,24},{0,26},{1,27},{2,27},{3,27}
+    },
+    green = {
+      {1,2},{0,8},{1,8},{2,8},{4,7},{5,8},{7,8},{8,7},{10,4},{14,4},{11,7},
+      {12,8},{10,13},{11,12},{13,12},{14,13},{10,15},{11,16}
+    },
+    blue = {{6,4},{6,10},{9,7},{10,6},{16,9},{18,9},{21,8},{25,8}}
+  }, 'printf')
+  test:exportImg(imgdata)
 end
 end
 
 
 
 
@@ -138,6 +392,8 @@ love.test.graphics.rectangle = function(test)
       {9,14},{11,1},{14,1},{11,14},{14,14}
       {9,14},{11,1},{14,1},{11,14},{14,14}
     }
     }
   }, 'line')
   }, 'line')
+  test:exportImg(imgdata1)
+  test:exportImg(imgdata2)
 end
 end
 
 
 
 
@@ -557,7 +813,8 @@ love.test.graphics.intersectScissor = function(test)
     love.graphics.origin()
     love.graphics.origin()
     love.graphics.setScissor(0, 0, 8, 16)
     love.graphics.setScissor(0, 0, 8, 16)
     love.graphics.intersectScissor(0, 0, 4, 4)
     love.graphics.intersectScissor(0, 0, 4, 4)
-    love.graphics.clear(1, 0, 0, 1)
+    love.graphics.setColor(1, 0, 0, 1)
+    love.graphics.rectangle('fill', 0, 0, 16, 16)
     love.graphics.setColor(1, 1, 1, 1)
     love.graphics.setColor(1, 1, 1, 1)
     love.graphics.setScissor()
     love.graphics.setScissor()
   love.graphics.setCanvas()
   love.graphics.setCanvas()
@@ -566,6 +823,7 @@ love.test.graphics.intersectScissor = function(test)
     red = {{0,0},{3,3}},
     red = {{0,0},{3,3}},
     black ={{4,0},{0,4},{4,4}}
     black ={{4,0},{0,4},{4,4}}
   }, 'intersect scissor')
   }, 'intersect scissor')
+  test:exportImg(imgdata)
 end
 end
 
 
 
 
@@ -651,6 +909,7 @@ love.test.graphics.setBlendMode = function(test)
     bluefade = {{0,15}}
     bluefade = {{0,15}}
   }, 'blend mode')
   }, 'blend mode')
   love.graphics.setBlendMode('alpha', 'alphamultiply') -- reset 
   love.graphics.setBlendMode('alpha', 'alphamultiply') -- reset 
+  test:exportImg(imgdata)
 end
 end
 
 
 
 
@@ -673,6 +932,7 @@ love.test.graphics.setCanvas = function(test)
   test:assertPixels(imgdata, {
   test:assertPixels(imgdata, {
     red = {{0,0},{15,0},{15,15},{0,15}}
     red = {{0,0},{15,0},{15,15},{0,15}}
   }, 'set canvas')
   }, 'set canvas')
+  test:exportImg(imgdata)
 end
 end
 
 
 
 
@@ -704,6 +964,7 @@ love.test.graphics.setColor = function(test)
     greenhalf = {{0,2},{5,2},{10,2},{15,2}},
     greenhalf = {{0,2},{5,2},{10,2},{15,2}},
     blue = {{0,3},{5,3},{10,3},{15,3}}
     blue = {{0,3},{5,3},{10,3},{15,3}}
   }, 'set color')
   }, 'set color')
+  test:exportImg(imgdata)
 end
 end
 
 
 
 
@@ -729,6 +990,7 @@ love.test.graphics.setColorMask = function(test)
   test:assertPixels(imgdata, {
   test:assertPixels(imgdata, {
     yellow = {{0,0},{0,15},{15,15},{15,0}}
     yellow = {{0,0},{0,15},{15,15},{15,0}}
   }, 'set color mask')
   }, 'set color mask')
+  test:exportImg(imgdata)
 end
 end
 
 
 
 
@@ -780,6 +1042,7 @@ love.test.graphics.setFont = function(test)
       {14,2},{12,6}
       {14,2},{12,6}
     }
     }
   }, 'set font for print')
   }, 'set font for print')
+  test:exportImg(imgdata)
 end
 end
 
 
 
 
@@ -827,6 +1090,7 @@ love.test.graphics.setLineJoin = function(test)
     yellow = {{8,7}},
     yellow = {{8,7}},
     blue = {{8,8}}
     blue = {{8,8}}
   }, 'set line join')
   }, 'set line join')
+  test:exportImg(imgdata)
 end
 end
 
 
 
 
@@ -852,6 +1116,7 @@ love.test.graphics.setLineStyle = function(test)
     red = {{0,0},{7,0},{15,0}},
     red = {{0,0},{7,0},{15,0}},
     red07 = {{0,4},{7,4},{15,4}}
     red07 = {{0,4},{7,4},{15,4}}
   }, 'set line style')
   }, 'set line style')
+  test:exportImg(imgdata)
 end
 end
 
 
 
 
@@ -884,6 +1149,7 @@ love.test.graphics.setLineWidth = function(test)
     yellow = {{0,3},{0,5},{6,6},{8,6}},
     yellow = {{0,3},{0,5},{6,6},{8,6}},
     blue = {{0,7},{0,10},{6,15},{9,15}}
     blue = {{0,7},{0,10},{6,15},{9,15}}
   }, 'set line width')
   }, 'set line width')
+  test:exportImg(imgdata)
 end
 end
 
 
 
 
@@ -910,7 +1176,8 @@ love.test.graphics.setScissor = function(test)
     love.graphics.clear(0, 0, 0, 1)
     love.graphics.clear(0, 0, 0, 1)
     love.graphics.origin()
     love.graphics.origin()
     love.graphics.setScissor(0, 0, 8, 16)
     love.graphics.setScissor(0, 0, 8, 16)
-    love.graphics.clear(1, 0, 0, 1)
+    love.graphics.setColor(1, 0, 0, 1)
+    love.graphics.rectangle('fill', 0, 0, 16, 16)
     love.graphics.setColor(1, 1, 1, 1)
     love.graphics.setColor(1, 1, 1, 1)
     love.graphics.setScissor()
     love.graphics.setScissor()
   love.graphics.setCanvas()
   love.graphics.setCanvas()
@@ -919,6 +1186,7 @@ love.test.graphics.setScissor = function(test)
     red = {{0,0},{7,0},{0,15},{7,15}},
     red = {{0,0},{7,0},{0,15},{7,15}},
     black ={{8,0},{8,15},{15,0},{15,15}}
     black ={{8,0},{8,15},{15,0},{15,15}}
   }, 'set scissor')
   }, 'set scissor')
+  test:exportImg(imgdata)
 end
 end
 
 
 
 
@@ -942,6 +1210,7 @@ love.test.graphics.setShader = function(test)
   test:assertPixels(imgdata, { 
   test:assertPixels(imgdata, { 
     yellow = {{0,0},{15,0},{0,15},{15,15}},
     yellow = {{0,0},{15,0},{0,15},{15,15}},
   }, 'check shader set to yellow')
   }, 'check shader set to yellow')
+  test:exportImg(imgdata)
 end
 end
 
 
 
 
@@ -963,6 +1232,7 @@ love.test.graphics.setStencilTest = function(test)
   test:assertPixels(imgdata, { 
   test:assertPixels(imgdata, { 
     red = {{6,2},{9,2},{2,6},{2,9},{13,6},{9,6},{6,13},{9,13}}
     red = {{6,2},{9,2},{2,6},{2,9},{13,6},{9,6},{6,13},{9,13}}
   }, 'check stencil test')
   }, 'check stencil test')
+  test:exportImg(imgdata)
 end
 end
 
 
 
 
@@ -983,6 +1253,7 @@ love.test.graphics.setWireframe = function(test)
     yellow = {{1,14},{14,1},{14,14},{2,2},{13,13}},
     yellow = {{1,14},{14,1},{14,14},{2,2},{13,13}},
     black = {{2,13},{13,2}}
     black = {{2,13},{13,2}}
   }, 'set wireframe')
   }, 'set wireframe')
+  test:exportImg(imgdata)
 end
 end
 
 
 
 
@@ -1008,6 +1279,7 @@ love.test.graphics.applyTransform = function(test)
   love.graphics.setCanvas()
   love.graphics.setCanvas()
   local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16})
   local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16})
   test:assertPixels(imgdata, { red = {{10, 0}} }, 'apply transform 10')
   test:assertPixels(imgdata, { red = {{10, 0}} }, 'apply transform 10')
+  test:exportImg(imgdata)
 end
 end
 
 
 
 
@@ -1044,6 +1316,7 @@ love.test.graphics.origin = function(test)
   love.graphics.setCanvas()
   love.graphics.setCanvas()
   local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16})
   local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16})
   test:assertPixels(imgdata, { red = {{0, 0}} }, 'origin check')
   test:assertPixels(imgdata, { red = {{0, 0}} }, 'origin check')
+  test:exportImg(imgdata)
 end
 end
 
 
 
 
@@ -1065,6 +1338,7 @@ love.test.graphics.pop = function(test)
   love.graphics.setCanvas()
   love.graphics.setCanvas()
   local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16})
   local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16})
   test:assertPixels(imgdata, { red = {{0, 0}} }, 'pop 1')
   test:assertPixels(imgdata, { red = {{0, 0}} }, 'pop 1')
+  test:exportImg(imgdata)
 end
 end
 
 
 
 
@@ -1087,6 +1361,7 @@ love.test.graphics.push = function(test)
   love.graphics.setCanvas()
   love.graphics.setCanvas()
   local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16})
   local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16})
   test:assertPixels(imgdata, { red = {{1, 1}} }, 'push 1')
   test:assertPixels(imgdata, { red = {{1, 1}} }, 'push 1')
+  test:exportImg(imgdata)
 end
 end
 
 
 
 
@@ -1108,6 +1383,7 @@ love.test.graphics.replaceTransform = function(test)
   love.graphics.setCanvas()
   love.graphics.setCanvas()
   local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16})
   local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16})
   test:assertPixels(imgdata, { red = {{10, 0}} }, 'replace transform 10')
   test:assertPixels(imgdata, { red = {{10, 0}} }, 'replace transform 10')
+  test:exportImg(imgdata)
 end
 end
 
 
 
 
@@ -1126,6 +1402,7 @@ love.test.graphics.rotate = function(test)
   love.graphics.setCanvas()
   love.graphics.setCanvas()
   local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16})
   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')
   test:assertPixels(imgdata, { red = {{0,0},{3,0},{3,3},{0,3}} }, 'rotate 90')
+  test:exportImg(imgdata)
 end
 end
 
 
 
 
@@ -1173,6 +1450,8 @@ love.test.graphics.shear = function(test)
   love.graphics.setCanvas()
   love.graphics.setCanvas()
   local imgdata2 = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16})
   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')
   test:assertPixels(imgdata2, { red = { {0,1},{0,4},{3,7},{3,10}} }, 'shear y')
+  test:exportImg(imgdata1)
+  test:exportImg(imgdata2)
 end
 end
 
 
 
 
@@ -1210,6 +1489,7 @@ love.test.graphics.translate = function(test)
   love.graphics.setCanvas()
   love.graphics.setCanvas()
   local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16})
   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')
   test:assertPixels(imgdata, { red = {{5,0},{0,5},{5,5},{0,0}} }, 'translate 4x')
+  test:exportImg(imgdata)
 end
 end
 
 
 
 

+ 3 - 2
testing/todo.md

@@ -1,16 +1,17 @@
 `/Applications/love_12.app/Contents/MacOS/love ./testing`
 `/Applications/love_12.app/Contents/MacOS/love ./testing`
 
 
 ## TESTSUITE
 ## TESTSUITE
-- [ ] setStencilMode to replace setStencilTest
-- [ ] start graphics drawing methods
 - [ ] move object methods to respective modules
 - [ ] move object methods to respective modules
 - [ ] start object methods
 - [ ] start object methods
+- [ ] setStencilMode to replace setStencilTest
 
 
 ## GRAPHICS
 ## GRAPHICS
 Methods that need a actual graphic pixel checks if possible:
 Methods that need a actual graphic pixel checks if possible:
 - [ ] setDepthMode
 - [ ] setDepthMode
 - [ ] setFrontFaceWinding
 - [ ] setFrontFaceWinding
 - [ ] setMeshCullMode
 - [ ] setMeshCullMode
+- [ ] present
+- [ ] drawInstanced
 
 
 ## FUTURE
 ## FUTURE
 - [ ] need a platform: format table somewhere for compressed formats (i.e. DXT not supported)
 - [ ] need a platform: format table somewhere for compressed formats (i.e. DXT not supported)