diff --git a/.gitignore b/.gitignore
index 3f5288d45..503612a68 100644
--- a/.gitignore
+++ b/.gitignore
@@ -69,7 +69,4 @@ stamp-h1
/src/tags
.vs/
.vscode/
-/testing/output/*.xml
-/testing/output/*.html
-/testing/output/*.md
-/testing/output/actual/*.png
+/testing/output/
diff --git a/testing/classes/TestMethod.lua b/testing/classes/TestMethod.lua
index 1f336d06b..6716abc1a 100644
--- a/testing/classes/TestMethod.lua
+++ b/testing/classes/TestMethod.lua
@@ -270,10 +270,15 @@ TestMethod = {
-- @param {table} imgdata - imgdata to save as a png
-- @return {nil}
compareImg = function(self, imgdata)
- local expected_path = 'tempoutput/expected/love.test.graphics.' ..
- self.method .. '-' .. tostring(self.imgs) .. '.png'
- local ok, chunk, _ = pcall(love.image.newImageData, expected_path)
+ local filename = 'love.test.graphics.' .. self.method .. '-' .. tostring(self.imgs) .. '.png'
+ local expected_path = 'resources/expected_output/' .. filename
+ local ok, chunk = pcall(love.filesystem.read, 'data', expected_path)
+ if ok == false then return self:assertEquals(true, false, chunk) end
+ local image_contents = chunk
+ ok, chunk = pcall(love.image.newImageData, chunk)
if ok == false then return self:assertEquals(true, false, chunk) end
+ -- Copy the expected file output to tempoutput/expected to keep HTML output working.
+ love.filesystem.write('tempoutput/expected/' .. filename, image_contents)
local expected = chunk
local iw = imgdata:getWidth()-2
local ih = imgdata:getHeight()-2
diff --git a/testing/classes/TestSuite.lua b/testing/classes/TestSuite.lua
index 8a2e76dee..4b262aa5a 100644
--- a/testing/classes/TestSuite.lua
+++ b/testing/classes/TestSuite.lua
@@ -164,7 +164,7 @@ TestSuite = {
local status = '🔴'
if self.totals[2] == 0 then status = '🟢' end
- local html = '
' .. status .. ' love.test
'
+ local html = '' .. status .. ' love.test
'
html = html ..
'- 🟢 ' .. tostring(self.totals[1]) .. ' Tests
' ..
'- 🔴 ' .. tostring(self.totals[2]) .. ' Failures
' ..
@@ -178,7 +178,7 @@ TestSuite = {
self.module:log('grey', '\nFINISHED - ' .. finaltime .. 's\n')
local failedcol = '\27[31m'
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\27[0m')
end
diff --git a/testing/conf.lua b/testing/conf.lua
index a954b3119..38ba5784c 100644
--- a/testing/conf.lua
+++ b/testing/conf.lua
@@ -1,5 +1,6 @@
function love.conf(t)
print("love.conf")
+ t.identity = 'love-test'
t.console = true
t.window.name = 'love.test'
t.window.width = 360
@@ -7,6 +8,7 @@ function love.conf(t)
t.window.resizable = true
t.window.depth = true
t.window.stencil = true
+ t.window.usedpiscale = false -- needed for Android
t.renderers = {"opengl"}
end
diff --git a/testing/main.lua b/testing/main.lua
index 3a4344426..18f70c3c9 100644
--- a/testing/main.lua
+++ b/testing/main.lua
@@ -57,9 +57,11 @@ love.load = function(args)
end
-- mount for output later
- if love.filesystem.mountFullPath then
+ if love.filesystem.mountFullPath and love.system.getOS() ~= "Android" then
love.filesystem.mountFullPath(love.filesystem.getSource() .. "/output", "tempoutput", "readwrite")
end
+ love.filesystem.createDirectory("tempoutput/actual")
+ love.filesystem.createDirectory("tempoutput/expected")
-- get all args with any comma lists split out as seperate
local arglist = {}
diff --git a/testing/output/expected/love.test.graphics.Canvas-1.png b/testing/resources/expected_output/love.test.graphics.Canvas-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.Canvas-1.png
rename to testing/resources/expected_output/love.test.graphics.Canvas-1.png
diff --git a/testing/output/expected/love.test.graphics.Canvas-2.png b/testing/resources/expected_output/love.test.graphics.Canvas-2.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.Canvas-2.png
rename to testing/resources/expected_output/love.test.graphics.Canvas-2.png
diff --git a/testing/output/expected/love.test.graphics.Font-1.png b/testing/resources/expected_output/love.test.graphics.Font-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.Font-1.png
rename to testing/resources/expected_output/love.test.graphics.Font-1.png
diff --git a/testing/output/expected/love.test.graphics.Font-2.png b/testing/resources/expected_output/love.test.graphics.Font-2.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.Font-2.png
rename to testing/resources/expected_output/love.test.graphics.Font-2.png
diff --git a/testing/output/expected/love.test.graphics.Image-1.png b/testing/resources/expected_output/love.test.graphics.Image-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.Image-1.png
rename to testing/resources/expected_output/love.test.graphics.Image-1.png
diff --git a/testing/output/expected/love.test.graphics.ParticleSystem-1.png b/testing/resources/expected_output/love.test.graphics.ParticleSystem-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.ParticleSystem-1.png
rename to testing/resources/expected_output/love.test.graphics.ParticleSystem-1.png
diff --git a/testing/output/expected/love.test.graphics.Quad-1.png b/testing/resources/expected_output/love.test.graphics.Quad-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.Quad-1.png
rename to testing/resources/expected_output/love.test.graphics.Quad-1.png
diff --git a/testing/output/expected/love.test.graphics.Shader-1.png b/testing/resources/expected_output/love.test.graphics.Shader-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.Shader-1.png
rename to testing/resources/expected_output/love.test.graphics.Shader-1.png
diff --git a/testing/output/expected/love.test.graphics.SpriteBatch-1.png b/testing/resources/expected_output/love.test.graphics.SpriteBatch-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.SpriteBatch-1.png
rename to testing/resources/expected_output/love.test.graphics.SpriteBatch-1.png
diff --git a/testing/output/expected/love.test.graphics.SpriteBatch-2.png b/testing/resources/expected_output/love.test.graphics.SpriteBatch-2.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.SpriteBatch-2.png
rename to testing/resources/expected_output/love.test.graphics.SpriteBatch-2.png
diff --git a/testing/output/expected/love.test.graphics.SpriteBatch-3.png b/testing/resources/expected_output/love.test.graphics.SpriteBatch-3.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.SpriteBatch-3.png
rename to testing/resources/expected_output/love.test.graphics.SpriteBatch-3.png
diff --git a/testing/output/expected/love.test.graphics.SpriteBatch-4.png b/testing/resources/expected_output/love.test.graphics.SpriteBatch-4.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.SpriteBatch-4.png
rename to testing/resources/expected_output/love.test.graphics.SpriteBatch-4.png
diff --git a/testing/output/expected/love.test.graphics.SpriteBatch-5.png b/testing/resources/expected_output/love.test.graphics.SpriteBatch-5.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.SpriteBatch-5.png
rename to testing/resources/expected_output/love.test.graphics.SpriteBatch-5.png
diff --git a/testing/output/expected/love.test.graphics.Text-1.png b/testing/resources/expected_output/love.test.graphics.Text-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.Text-1.png
rename to testing/resources/expected_output/love.test.graphics.Text-1.png
diff --git a/testing/output/expected/love.test.graphics.Video-1.png b/testing/resources/expected_output/love.test.graphics.Video-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.Video-1.png
rename to testing/resources/expected_output/love.test.graphics.Video-1.png
diff --git a/testing/output/expected/love.test.graphics.applyTransform-1.png b/testing/resources/expected_output/love.test.graphics.applyTransform-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.applyTransform-1.png
rename to testing/resources/expected_output/love.test.graphics.applyTransform-1.png
diff --git a/testing/output/expected/love.test.graphics.arc-1.png b/testing/resources/expected_output/love.test.graphics.arc-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.arc-1.png
rename to testing/resources/expected_output/love.test.graphics.arc-1.png
diff --git a/testing/output/expected/love.test.graphics.arc-2.png b/testing/resources/expected_output/love.test.graphics.arc-2.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.arc-2.png
rename to testing/resources/expected_output/love.test.graphics.arc-2.png
diff --git a/testing/output/expected/love.test.graphics.arc-3.png b/testing/resources/expected_output/love.test.graphics.arc-3.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.arc-3.png
rename to testing/resources/expected_output/love.test.graphics.arc-3.png
diff --git a/testing/output/expected/love.test.graphics.captureScreenshot-1.png b/testing/resources/expected_output/love.test.graphics.captureScreenshot-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.captureScreenshot-1.png
rename to testing/resources/expected_output/love.test.graphics.captureScreenshot-1.png
diff --git a/testing/output/expected/love.test.graphics.circle-1.png b/testing/resources/expected_output/love.test.graphics.circle-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.circle-1.png
rename to testing/resources/expected_output/love.test.graphics.circle-1.png
diff --git a/testing/output/expected/love.test.graphics.clear-1.png b/testing/resources/expected_output/love.test.graphics.clear-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.clear-1.png
rename to testing/resources/expected_output/love.test.graphics.clear-1.png
diff --git a/testing/output/expected/love.test.graphics.draw-1.png b/testing/resources/expected_output/love.test.graphics.draw-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.draw-1.png
rename to testing/resources/expected_output/love.test.graphics.draw-1.png
diff --git a/testing/output/expected/love.test.graphics.drawInstanced-1.png b/testing/resources/expected_output/love.test.graphics.drawInstanced-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.drawInstanced-1.png
rename to testing/resources/expected_output/love.test.graphics.drawInstanced-1.png
diff --git a/testing/output/expected/love.test.graphics.drawLayer-1.png b/testing/resources/expected_output/love.test.graphics.drawLayer-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.drawLayer-1.png
rename to testing/resources/expected_output/love.test.graphics.drawLayer-1.png
diff --git a/testing/output/expected/love.test.graphics.ellipse-1.png b/testing/resources/expected_output/love.test.graphics.ellipse-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.ellipse-1.png
rename to testing/resources/expected_output/love.test.graphics.ellipse-1.png
diff --git a/testing/output/expected/love.test.graphics.intersectScissor-1.png b/testing/resources/expected_output/love.test.graphics.intersectScissor-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.intersectScissor-1.png
rename to testing/resources/expected_output/love.test.graphics.intersectScissor-1.png
diff --git a/testing/output/expected/love.test.graphics.line-1.png b/testing/resources/expected_output/love.test.graphics.line-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.line-1.png
rename to testing/resources/expected_output/love.test.graphics.line-1.png
diff --git a/testing/output/expected/love.test.graphics.origin-1.png b/testing/resources/expected_output/love.test.graphics.origin-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.origin-1.png
rename to testing/resources/expected_output/love.test.graphics.origin-1.png
diff --git a/testing/output/expected/love.test.graphics.points-1.png b/testing/resources/expected_output/love.test.graphics.points-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.points-1.png
rename to testing/resources/expected_output/love.test.graphics.points-1.png
diff --git a/testing/output/expected/love.test.graphics.polygon-1.png b/testing/resources/expected_output/love.test.graphics.polygon-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.polygon-1.png
rename to testing/resources/expected_output/love.test.graphics.polygon-1.png
diff --git a/testing/output/expected/love.test.graphics.pop-1.png b/testing/resources/expected_output/love.test.graphics.pop-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.pop-1.png
rename to testing/resources/expected_output/love.test.graphics.pop-1.png
diff --git a/testing/output/expected/love.test.graphics.print-1.png b/testing/resources/expected_output/love.test.graphics.print-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.print-1.png
rename to testing/resources/expected_output/love.test.graphics.print-1.png
diff --git a/testing/output/expected/love.test.graphics.printf-1.png b/testing/resources/expected_output/love.test.graphics.printf-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.printf-1.png
rename to testing/resources/expected_output/love.test.graphics.printf-1.png
diff --git a/testing/output/expected/love.test.graphics.push-1.png b/testing/resources/expected_output/love.test.graphics.push-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.push-1.png
rename to testing/resources/expected_output/love.test.graphics.push-1.png
diff --git a/testing/output/expected/love.test.graphics.rectangle-1.png b/testing/resources/expected_output/love.test.graphics.rectangle-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.rectangle-1.png
rename to testing/resources/expected_output/love.test.graphics.rectangle-1.png
diff --git a/testing/output/expected/love.test.graphics.rectangle-2.png b/testing/resources/expected_output/love.test.graphics.rectangle-2.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.rectangle-2.png
rename to testing/resources/expected_output/love.test.graphics.rectangle-2.png
diff --git a/testing/output/expected/love.test.graphics.replaceTransform-1.png b/testing/resources/expected_output/love.test.graphics.replaceTransform-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.replaceTransform-1.png
rename to testing/resources/expected_output/love.test.graphics.replaceTransform-1.png
diff --git a/testing/output/expected/love.test.graphics.rotate-1.png b/testing/resources/expected_output/love.test.graphics.rotate-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.rotate-1.png
rename to testing/resources/expected_output/love.test.graphics.rotate-1.png
diff --git a/testing/output/expected/love.test.graphics.scale-1.png b/testing/resources/expected_output/love.test.graphics.scale-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.scale-1.png
rename to testing/resources/expected_output/love.test.graphics.scale-1.png
diff --git a/testing/output/expected/love.test.graphics.setBlendMode-1.png b/testing/resources/expected_output/love.test.graphics.setBlendMode-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.setBlendMode-1.png
rename to testing/resources/expected_output/love.test.graphics.setBlendMode-1.png
diff --git a/testing/output/expected/love.test.graphics.setCanvas-1.png b/testing/resources/expected_output/love.test.graphics.setCanvas-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.setCanvas-1.png
rename to testing/resources/expected_output/love.test.graphics.setCanvas-1.png
diff --git a/testing/output/expected/love.test.graphics.setColor-1.png b/testing/resources/expected_output/love.test.graphics.setColor-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.setColor-1.png
rename to testing/resources/expected_output/love.test.graphics.setColor-1.png
diff --git a/testing/output/expected/love.test.graphics.setColorMask-1.png b/testing/resources/expected_output/love.test.graphics.setColorMask-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.setColorMask-1.png
rename to testing/resources/expected_output/love.test.graphics.setColorMask-1.png
diff --git a/testing/output/expected/love.test.graphics.setFont-1.png b/testing/resources/expected_output/love.test.graphics.setFont-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.setFont-1.png
rename to testing/resources/expected_output/love.test.graphics.setFont-1.png
diff --git a/testing/output/expected/love.test.graphics.setLineJoin-1.png b/testing/resources/expected_output/love.test.graphics.setLineJoin-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.setLineJoin-1.png
rename to testing/resources/expected_output/love.test.graphics.setLineJoin-1.png
diff --git a/testing/output/expected/love.test.graphics.setLineStyle-1.png b/testing/resources/expected_output/love.test.graphics.setLineStyle-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.setLineStyle-1.png
rename to testing/resources/expected_output/love.test.graphics.setLineStyle-1.png
diff --git a/testing/output/expected/love.test.graphics.setLineWidth-1.png b/testing/resources/expected_output/love.test.graphics.setLineWidth-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.setLineWidth-1.png
rename to testing/resources/expected_output/love.test.graphics.setLineWidth-1.png
diff --git a/testing/output/expected/love.test.graphics.setScissor-1.png b/testing/resources/expected_output/love.test.graphics.setScissor-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.setScissor-1.png
rename to testing/resources/expected_output/love.test.graphics.setScissor-1.png
diff --git a/testing/output/expected/love.test.graphics.setShader-1.png b/testing/resources/expected_output/love.test.graphics.setShader-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.setShader-1.png
rename to testing/resources/expected_output/love.test.graphics.setShader-1.png
diff --git a/testing/output/expected/love.test.graphics.setStencilState-1.png b/testing/resources/expected_output/love.test.graphics.setStencilState-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.setStencilState-1.png
rename to testing/resources/expected_output/love.test.graphics.setStencilState-1.png
diff --git a/testing/output/expected/love.test.graphics.setWireframe-1.png b/testing/resources/expected_output/love.test.graphics.setWireframe-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.setWireframe-1.png
rename to testing/resources/expected_output/love.test.graphics.setWireframe-1.png
diff --git a/testing/output/expected/love.test.graphics.shear-1.png b/testing/resources/expected_output/love.test.graphics.shear-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.shear-1.png
rename to testing/resources/expected_output/love.test.graphics.shear-1.png
diff --git a/testing/output/expected/love.test.graphics.shear-2.png b/testing/resources/expected_output/love.test.graphics.shear-2.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.shear-2.png
rename to testing/resources/expected_output/love.test.graphics.shear-2.png
diff --git a/testing/output/expected/love.test.graphics.translate-1.png b/testing/resources/expected_output/love.test.graphics.translate-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.translate-1.png
rename to testing/resources/expected_output/love.test.graphics.translate-1.png
diff --git a/testing/output/expected/notes.txt b/testing/resources/expected_output/notes.txt
similarity index 100%
rename from testing/output/expected/notes.txt
rename to testing/resources/expected_output/notes.txt
diff --git a/testing/resources/love.etc.ktx b/testing/resources/love.etc.ktx
new file mode 100644
index 000000000..46f4567e4
Binary files /dev/null and b/testing/resources/love.etc.ktx differ
diff --git a/testing/tests/filesystem.lua b/testing/tests/filesystem.lua
index c7d76e6f6..2f34f920b 100644
--- a/testing/tests/filesystem.lua
+++ b/testing/tests/filesystem.lua
@@ -362,6 +362,11 @@ end
-- love.filesystem.mountFullPath
love.test.filesystem.mountFullPath = function(test)
+ if love.system.getOS() == 'Android' then
+ test:skipTest('getSource() mounting is not supported for .love files')
+ return
+ end
+
-- mount something in the working directory
local mount = love.filesystem.mountFullPath(love.filesystem.getSource() .. '/tests', 'tests', 'read')
test:assertTrue(mount, 'check can mount')
@@ -375,6 +380,11 @@ end
-- love.filesystem.unmountFullPath
love.test.filesystem.unmountFullPath = function(test)
+ if love.system.getOS() == 'Android' then
+ test:skipTest('getSource() mounting is not supported for .love files')
+ return
+ end
+
-- try unmounting something we never mounted
local unmount1 = love.filesystem.unmountFullPath(love.filesystem.getSource() .. '/faker')
test:assertFalse(unmount1, 'check not mounted to start with')
@@ -393,7 +403,7 @@ love.test.filesystem.mountCommonPath = function(test)
local mount3 = love.filesystem.mountCommonPath('userhome', 'userhome', 'readwrite')
local mount4 = love.filesystem.mountCommonPath('userappdata', 'userappdata', 'readwrite')
-- userdesktop isnt valid on linux
- if love.system.getOS() ~= 'Linux' then
+ if love.system.getOS() ~= 'Linux' and love.system.getOS() ~= 'Android' then
local mount5 = love.filesystem.mountCommonPath('userdesktop', 'userdesktop', 'readwrite')
test:assertTrue(mount5, 'check mount userdesktop')
end
diff --git a/testing/tests/graphics.lua b/testing/tests/graphics.lua
index 860d82099..2ac1db34c 100644
--- a/testing/tests/graphics.lua
+++ b/testing/tests/graphics.lua
@@ -374,9 +374,18 @@ love.test.graphics.Image = function(test)
-- check image properties
test:assertFalse(image:isCompressed(), 'check not compressed')
test:assertFalse(image:isFormatLinear(), 'check not linear')
- local cimage = love.graphics.newImage('resources/love.dxt1')
- test:assertObject(cimage)
- test:assertTrue(cimage:isCompressed(), 'check is compressed')
+
+ -- check compressed
+ local supportedimgs = love.graphics.getTextureFormats({canvas = false})
+ if supportedimgs['DXT1'] then
+ local cimage = love.graphics.newImage('resources/love.dxt1')
+ test:assertObject(cimage)
+ test:assertTrue(cimage:isCompressed(), 'check is compressed')
+ elseif supportedimgs['ETC1'] then
+ local cimage = love.graphics.newImage('resources/love.etc.ktx')
+ test:assertObject(cimage)
+ test:assertTrue(cimage:isCompressed(), 'check is compressed')
+ end
-- check pixel replacement
local rimage = love.image.newImageData('resources/loveinv.png')
diff --git a/testing/tests/window.lua b/testing/tests/window.lua
index 98cfc2f43..08090dc97 100644
--- a/testing/tests/window.lua
+++ b/testing/tests/window.lua
@@ -94,8 +94,10 @@ end
-- @NOTE could prob add more checks on the flags here based on conf.lua
love.test.window.getMode = function(test)
local w, h, flags = love.window.getMode()
- test:assertEquals(360, w, 'check w')
- test:assertEquals(240, h, 'check h')
+ if love._os ~= 'iOS' and love._os ~= 'Android' then
+ test:assertEquals(360, w, 'check w')
+ test:assertEquals(240, h, 'check h')
+ end
test:assertFalse(flags["fullscreen"], 'check fullscreen')
end
@@ -164,6 +166,11 @@ end
-- love.window.isMaximized
love.test.window.isMaximized = function(test)
+ if love.system.getOS() == 'Android' or love.system.getOS() == 'iOS' then
+ test:skipTest('undefined/unavailable in mobile')
+ return
+ end
+
test:assertFalse(love.window.isMaximized(), 'check window not maximized')
love.window.maximize()
test:waitFrames(10)
@@ -175,6 +182,11 @@ end
-- love.window.isMinimized
love.test.window.isMinimized = function(test)
+ if love.system.getOS() == 'Android' or love.system.getOS() == 'iOS' then
+ test:skipTest('undefined/unavailable in mobile')
+ return
+ end
+
-- check not minimized to start
test:assertFalse(love.window.isMinimized(), 'check window not minimized')
-- try to minimize
@@ -204,6 +216,11 @@ end
-- love.window.maximize
love.test.window.maximize = function(test)
+ if love.system.getOS() == 'Android' or love.system.getOS() == 'iOS' then
+ test:skipTest('undefined/unavailable in mobile')
+ return
+ end
+
test:assertFalse(love.window.isMaximized(), 'check window not maximized')
-- check maximizing is set
love.window.maximize()
@@ -216,6 +233,11 @@ end
-- love.window.minimize
love.test.window.minimize = function(test)
+ if love.system.getOS() == 'Android' or love.system.getOS() == 'iOS' then
+ test:skipTest('undefined/unavailable in mobile')
+ return
+ end
+
test:assertFalse(love.window.isMinimized(), 'check window not minimized')
-- check minimizing is set
love.window.minimize()
@@ -234,6 +256,11 @@ end
-- love.window.restore
love.test.window.restore = function(test)
+ if love.system.getOS() == 'Android' or love.system.getOS() == 'iOS' then
+ test:skipTest('undefined/unavailable in mobile')
+ return
+ end
+
-- check minimized to start
love.window.minimize()
test:waitFrames(10)
@@ -286,8 +313,10 @@ love.test.window.setMode = function(test)
})
-- check what we set is returned
local width, height, flags = love.window.getMode()
- test:assertEquals(512, width, 'check window w match')
- test:assertEquals(512, height, 'check window h match')
+ if love.system.getOS() ~= 'iOS' and love.system.getOS() ~= 'Android' then
+ test:assertEquals(512, width, 'check window w match')
+ test:assertEquals(512, height, 'check window h match')
+ end
test:assertFalse(flags["fullscreen"], 'check window not fullscreen')
test:assertFalse(flags["resizable"], 'check window not resizeable')
love.window.setMode(360, 240, {
@@ -298,6 +327,11 @@ end
-- love.window.setPosition
love.test.window.setPosition = function(test)
+ if love.system.getOS() == 'Android' or love.system.getOS() == 'iOS' then
+ test:skipTest('undefined/unavailable in mobile')
+ return
+ end
+
-- check position is returned
love.window.setPosition(100, 100, 1)
test:waitFrames(10)