Skip to content

Commit

Permalink
change setBlendMode + setColor
Browse files Browse the repository at this point in the history
this is to not use points() which fails on mac runner - we still test points() in it's own method
  • Loading branch information
ellraiser committed Nov 16, 2023
1 parent 2c49837 commit 7c32715
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
10 changes: 7 additions & 3 deletions classes/TestSuite.lua
Original file line number Diff line number Diff line change
Expand Up @@ -136,19 +136,23 @@ TestSuite = {
-- @return {nil}
printResult = function(self)
local finaltime = UtilTimeFormat(self.time)

local name, version, vendor, device = love.graphics.getRendererInfo()

local md = '<!-- PASSED ' .. tostring(self.totals[1]) ..
' || FAILED ' .. tostring(self.totals[2]) ..
' || SKIPPED ' .. tostring(self.totals[3]) ..
' || TIME ' .. finaltime .. ' -->\n\n' ..
' || TIME ' .. finaltime .. ' -->\n\n### Info\n' ..
'**' .. tostring(self.totals[1] + self.totals[2] + self.totals[3]) .. '** tests were completed in **' ..
finaltime .. 's** with **' ..
tostring(self.totals[1]) .. '** passed, **' ..
tostring(self.totals[2]) .. '** failed, and **' ..
tostring(self.totals[3]) .. '** skipped\n\n### Report\n' ..
tostring(self.totals[3]) .. '** skipped\n\n' ..
'Renderer: ' .. name .. ' | ' .. version .. ' | ' .. vendor .. ' | ' .. device .. '\n\n' ..
'### Report\n' ..
'| Module | Pass | Fail | Skip | Time |\n' ..
'| --------------------- | ------ | ------ | ------- | ------ |\n' ..
self.mdrows .. '\n\n### Failures\n' .. self.mdfailures
self.mdrows .. '\n### Failures\n' .. self.mdfailures

local xml = '<testsuites name="love.test" tests="' .. tostring(self.totals[1]) ..
'" failures="' .. tostring(self.totals[2]) ..
Expand Down
Binary file modified resources/.DS_Store
Binary file not shown.
Binary file added resources/font.bmp
Binary file not shown.
19 changes: 10 additions & 9 deletions tests/graphics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1508,16 +1508,16 @@ love.test.graphics.setBlendMode = function(test)
love.graphics.clear(0.5, 0.5, 0.5, 1)
love.graphics.setBlendMode('add', 'alphamultiply')
love.graphics.setColor(1, 0, 0, 1)
love.graphics.points({1,1})
love.graphics.rectangle('fill', 0, 0, 1, 1)
love.graphics.setBlendMode('subtract', 'alphamultiply')
love.graphics.setColor(1, 1, 1, 0.5)
love.graphics.points({16,1})
love.graphics.rectangle('fill', 15, 0, 1, 1)
love.graphics.setBlendMode('multiply', 'premultiplied')
love.graphics.setColor(0, 1, 0, 1)
love.graphics.points({16,16})
love.graphics.rectangle('fill', 15, 15, 1, 1)
love.graphics.setBlendMode('replace', 'premultiplied')
love.graphics.setColor(0, 0, 1, 0.5)
love.graphics.points({1,16})
love.graphics.rectangle('fill', 0, 15, 1, 1)
love.graphics.setColor(1, 1, 1, 1)
love.graphics.setCanvas()
local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16})
Expand Down Expand Up @@ -1568,13 +1568,14 @@ love.test.graphics.setColor = function(test)
test:assertEquals(0, g, 'check g set')
test:assertEquals(0, b, 'check b set')
test:assertEquals(1, a, 'check a set')
love.graphics.points({{1,1},{6,1},{11,1},{16,1}})

love.graphics.rectangle('fill', 0, 0, 16, 1)
love.graphics.setColor(1, 1, 0, 1)
love.graphics.points({{1,2},{6,2},{11,2},{16,2}})
love.graphics.rectangle('fill', 0, 1, 16, 1)
love.graphics.setColor(0, 1, 0, 0.5)
love.graphics.points({{1,3},{6,3},{11,3},{16,3}})
love.graphics.rectangle('fill', 0, 2, 16, 1)
love.graphics.setColor(0, 0, 1, 1)
love.graphics.points({{1,4},{6,4},{11,4},{16,4}})
love.graphics.rectangle('fill', 0, 3, 16, 1)
love.graphics.setColor(1, 1, 1, 1)
love.graphics.setCanvas()
local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16})
Expand Down Expand Up @@ -1878,8 +1879,8 @@ love.test.graphics.setWireframe = function(test)
love.graphics.setColor(1, 1, 0, 1)
love.graphics.rectangle('fill', 2, 2, 13, 13)
love.graphics.setColor(1, 1, 1, 1)
love.graphics.setWireframe(false)
love.graphics.setCanvas()
love.graphics.setWireframe(false)
local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16})
test:assertPixels(imgdata, {
yellow = {{1,14},{14,1},{14,14},{2,2},{13,13}},
Expand Down

0 comments on commit 7c32715

Please sign in to comment.