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 b03a8b4 commit 0b56e8f
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion testing/tests/window.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,15 @@ 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)
-- check now fullscreen
test:assertTrue(love.window.getFullscreen(), 'check now fullscreen')
test:waitFrames(10)
love.window.setFullscreen(false) -- reset
end

Expand Down Expand Up @@ -165,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 @@ -176,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 @@ -205,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 @@ -217,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 Down Expand Up @@ -258,6 +277,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 0b56e8f

Please sign in to comment.