Skip to content

Commit e107563

Browse files
committed
SDL3: skip tests of unported stuff, run on CI
1 parent 179b3bc commit e107563

File tree

10 files changed

+86
-24
lines changed

10 files changed

+86
-24
lines changed

.github/workflows/build-sdl3.yml

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
strategy:
4343
fail-fast: false # if a particular matrix build fails, don't skip the rest
4444
matrix:
45-
os: [ubuntu-24.04, windows-latest, macos-14]
45+
os: [ubuntu-24.04, windows-latest, macos-15]
4646

4747
env:
4848
# Pip now forces us to either make a venv or set this flag, so we will do
@@ -54,25 +54,24 @@ jobs:
5454
steps:
5555
- uses: actions/[email protected]
5656

57-
- name: Install pygame deps (linux)
57+
- name: Fix apt issues (linux)
5858
if: matrix.os == 'ubuntu-24.04'
59-
run: |
60-
sudo apt-get update --fix-missing
61-
sudo apt-get install libfreetype6-dev libportmidi-dev python3-dev
59+
run: sudo apt-get update --fix-missing
6260

63-
- name: Install pygame deps (mac)
64-
if: matrix.os == 'macos-14'
65-
run: brew install freetype portmidi
61+
- name: Install pygame & SDL deps (mac)
62+
if: matrix.os == 'macos-15'
63+
run: brew install freetype harfbuzz portmidi libtiff webp
6664

67-
# taken from dependencies of the 'libsdl2-dev' package
68-
- name: Install SDL deps (linux)
65+
- name: Install pygame & SDL deps (linux)
6966
if: matrix.os == 'ubuntu-24.04'
7067
run: >
7168
sudo apt-get install libasound2-dev libdbus-1-dev libdecor-0-dev libdrm-dev
7269
libegl-dev libgbm-dev libgl-dev libgles-dev libibus-1.0-dev libpulse-dev
7370
libsamplerate0-dev libsndio-dev libudev-dev libwayland-dev libx11-dev
7471
libxcursor-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev
7572
libxkbcommon-dev libxrandr-dev libxss-dev libxt-dev libxv-dev libxxf86vm-dev
73+
libfreetype-dev libharfbuzz-dev libportmidi-dev libtiff-dev libwebp-dev \
74+
python3-dev
7675
7776
# taken from https://wiki.libsdl.org/SDL3/Installation
7877
- name: Install SDL3
@@ -93,7 +92,9 @@ jobs:
9392
cd SDL_image
9493
mkdir build
9594
cd build
96-
cmake -DCMAKE_BUILD_TYPE=Release ..
95+
cmake -DCMAKE_BUILD_TYPE=Release -DSDLIMAGE_VENDORED=0 \
96+
-DSDLIMAGE_BACKEND_STB=1 -DSDLIMAGE_BACKEND_IMAGEIO=0 \
97+
-DSDLIMAGE_AVIF=0 -DSDLIMAGE_JXL=0 -DSDLIMAGE_TIF=1 -DSDLIMAGE_WEBP=1 ..
9798
cmake --build . --config Release --parallel
9899
sudo cmake --install . --config Release
99100
@@ -104,20 +105,15 @@ jobs:
104105
cd SDL_ttf
105106
mkdir build
106107
cd build
107-
cmake -DCMAKE_BUILD_TYPE=Release ..
108+
cmake -DCMAKE_BUILD_TYPE=Release -DSDLTTF_VENDORED=0 -DSDLTTF_HARFBUZZ=1 ..
108109
cmake --build . --config Release --parallel
109110
sudo cmake --install . --config Release
110111
111112
- name: Build with SDL3
112113
run: python3 dev.py build --sdl3
113114

114-
# eventually we need to run all tests, but for now test that importing pygame
115-
# works
116-
- name: Test import works
117-
run: python3 -c 'import pygame'
118-
119-
# - name: Run tests
120-
# env:
121-
# SDL_VIDEODRIVER: "dummy"
122-
# SDL_AUDIODRIVER: "disk"
123-
# run: python3 -m pygame.tests -v --exclude opengl,music,timing --time_out 300
115+
- name: Run tests
116+
env:
117+
SDL_VIDEODRIVER: "dummy"
118+
SDL_AUDIODRIVER: "disk"
119+
run: python3 -m pygame.tests -v --exclude opengl,music,timing --time_out 300

test/controller_tags.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import pygame
2+
3+
__tags__ = ["sdl3_skip"]
4+
5+
exclude = pygame.get_sdl_version() >= (3, 0, 0)
6+
7+
if exclude:
8+
__tags__.extend(("ignore", "subprocess_ignore"))

test/gfxdraw_tags.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import pygame
2+
3+
__tags__ = ["sdl3_skip"]
4+
5+
exclude = pygame.get_sdl_version() >= (3, 0, 0)
6+
7+
if exclude:
8+
__tags__.extend(("ignore", "subprocess_ignore"))

test/joystick_tags.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import pygame
2+
3+
__tags__ = ["sdl3_skip"]
4+
5+
exclude = pygame.get_sdl_version() >= (3, 0, 0)
6+
7+
if exclude:
8+
__tags__.extend(("ignore", "subprocess_ignore"))

test/mixer_music_tags.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import pygame
2+
3+
__tags__ = ["sdl3_skip"]
4+
5+
exclude = pygame.get_sdl_version() >= (3, 0, 0)
6+
7+
if exclude:
8+
__tags__.extend(("ignore", "subprocess_ignore"))

test/mixer_tags.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import pygame
2+
3+
__tags__ = ["sdl3_skip"]
4+
5+
exclude = pygame.get_sdl_version() >= (3, 0, 0)
6+
7+
if exclude:
8+
__tags__.extend(("ignore", "subprocess_ignore"))

test/render_tags.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import pygame
2+
3+
__tags__ = ["sdl3_skip"]
4+
5+
exclude = pygame.get_sdl_version() >= (3, 0, 0)
6+
7+
if exclude:
8+
__tags__.extend(("ignore", "subprocess_ignore"))

test/sndarray_tags.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
__tags__ = ["array"]
1+
import pygame
22

3-
exclude = False
3+
__tags__ = ["array", "sdl3_skip"]
4+
5+
exclude = pygame.get_sdl_version() >= (3, 0, 0)
46

57
try:
68
import numpy

test/touch_tags.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import pygame
2+
3+
__tags__ = ["sdl3_skip"]
4+
5+
exclude = pygame.get_sdl_version() >= (3, 0, 0)
6+
7+
if exclude:
8+
__tags__.extend(("ignore", "subprocess_ignore"))

test/video_tags.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import pygame
2+
3+
__tags__ = ["sdl3_skip"]
4+
5+
exclude = pygame.get_sdl_version() >= (3, 0, 0)
6+
7+
if exclude:
8+
__tags__.extend(("ignore", "subprocess_ignore"))

0 commit comments

Comments
 (0)