From 915496528c81251dd3c5cc1c028bc42d78459628 Mon Sep 17 00:00:00 2001 From: lmp Date: Wed, 22 Nov 2023 10:38:02 +0100 Subject: [PATCH] ci: fix visual tests --- .github/workflows/ci_visual_tests.yml | 3 ++- lib/wm.sdl.v | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci_visual_tests.yml b/.github/workflows/ci_visual_tests.yml index 0e4e886..67195bc 100644 --- a/.github/workflows/ci_visual_tests.yml +++ b/.github/workflows/ci_visual_tests.yml @@ -23,6 +23,7 @@ jobs: DISPLAY: :99 LIBGL_ALWAYS_SOFTWARE: true SDL2_VERSION: 2.28.2 + SHY_CI_VISUAL_TEST: 1 steps: - name: Checkout V uses: actions/checkout@v2 @@ -90,7 +91,7 @@ jobs: id: compare continue-on-error: true run: | - Xvfb $DISPLAY -dpi 96 -screen 0 1280x1024x24 & + Xvfb $DISPLAY -dpi 96 -screen 0 960x614x24 & sleep 1 # give xvfb time to start v gret -r ~/.vmodules/shy -t ./shy-visual-tests/vgret.shy_examples.toml -v ./fresh-examples ./shy-visual-tests v gret -r ~/.vmodules/shy -t ./shy-visual-tests/vgret.shy_visual_tests.toml -v ./fresh-visual-tests ./shy-visual-tests diff --git a/lib/wm.sdl.v b/lib/wm.sdl.v index 3ad6681..f4e63ee 100644 --- a/lib/wm.sdl.v +++ b/lib/wm.sdl.v @@ -173,6 +173,11 @@ fn (mut wm WM) new_window(config WindowConfig) !&Window { window_flags = window_flags | u32(sdl.WindowFlags.resizable) } + // NOTE this is a specialcase for Shy's visual tests + if os.getenv('SHY_CI_VISUAL_TEST').len > 0 { + window_flags = window_flags | u32(sdl.WindowFlags.fullscreen) + } + // $if opengl ? { window_flags = window_flags | u32(sdl.WindowFlags.opengl) | u32(sdl.WindowFlags.allow_highdpi) // }