Skip to content

Commit

Permalink
tests: don't run window minimize/maximize tests on Linux CI
Browse files Browse the repository at this point in the history
xvfb doesn't support those operations.
  • Loading branch information
slime73 committed Oct 17, 2024
1 parent 31ce65b commit 1ecc8a1
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions testing/tests/window.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ end

-- love.window.getFullscreen
love.test.window.getFullscreen = function(test)
if GITHUB_RUNNER and test:isOS('Linux') then
return test:skipTest("xvfb on Linux doesn't support fullscreen")
end

-- check not fullscreen to start
test:assertFalse(love.window.getFullscreen(), 'check not fullscreen')
love.window.setFullscreen(true)
Expand Down Expand Up @@ -164,6 +168,10 @@ end

-- love.window.isMaximized
love.test.window.isMaximized = function(test)
if GITHUB_RUNNER and test:isOS('Linux') then
return test:skipTest("xvfb on Linux doesn't support window maximization")
end

test:assertFalse(love.window.isMaximized(), 'check window not maximized')
love.window.maximize()
test:waitFrames(10)
Expand All @@ -175,6 +183,10 @@ end

-- love.window.isMinimized
love.test.window.isMinimized = function(test)
if GITHUB_RUNNER and test:isOS('Linux') then
return test:skipTest("xvfb on Linux doesn't support window minimization")
end

-- check not minimized to start
test:assertFalse(love.window.isMinimized(), 'check window not minimized')
-- try to minimize
Expand Down Expand Up @@ -204,6 +216,10 @@ end

-- love.window.maximize
love.test.window.maximize = function(test)
if GITHUB_RUNNER and test:isOS('Linux') then
return test:skipTest("xvfb on Linux doesn't support window maximization")
end

test:assertFalse(love.window.isMaximized(), 'check window not maximized')
-- check maximizing is set
love.window.maximize()
Expand All @@ -216,6 +232,10 @@ end

-- love.window.minimize
love.test.window.minimize = function(test)
if GITHUB_RUNNER and test:isOS('Linux') then
return test:skipTest("xvfb on Linux doesn't support window minimization")
end

test:assertFalse(love.window.isMinimized(), 'check window not minimized')
-- check minimizing is set
love.window.minimize()
Expand All @@ -234,6 +254,10 @@ end

-- love.window.restore
love.test.window.restore = function(test)
if GITHUB_RUNNER and test:isOS('Linux') then
return test:skipTest("xvfb on Linux doesn't support window minimization")
end

-- check minimized to start
love.window.minimize()
test:waitFrames(10)
Expand All @@ -257,6 +281,10 @@ end

-- love.window.setFullscreen
love.test.window.setFullscreen = function(test)
if GITHUB_RUNNER and test:isOS('Linux') then
return test:skipTest("xvfb on Linux doesn't support fullscreen")
end

-- check fullscreen is set
love.window.setFullscreen(true)
test:assertTrue(love.window.getFullscreen(), 'check fullscreen')
Expand Down

0 comments on commit 1ecc8a1

Please sign in to comment.