Skip to content

Add test that launches Oolite, creates a snapshot and closes it#591

Open
mcarans wants to merge 23 commits intoOoliteProject:masterfrom
mcarans:add_test
Open

Add test that launches Oolite, creates a snapshot and closes it#591
mcarans wants to merge 23 commits intoOoliteProject:masterfrom
mcarans:add_test

Conversation

@mcarans
Copy link
Copy Markdown
Contributor

@mcarans mcarans commented Apr 6, 2026

CI for Linux and Windows for test
Allow Windows build to use AddOns folder in same directory (as well as one level up as now)
Expose quit function to JavaScript
Snapshot is checked - it must be a valid PNG file > 100Kb

Note Arch test is broken due to GNUstep not supporting clang 22 just yet

Example output from Windows CI test:

📦 Found UCRT64 Mesa driver at /ucrt64/bin/opengl32.dll
[*] Moving to D:/a/oolite/oolite/oolite.app
[*] Console server listening on 8563
[*] Executing: ./oolite.exe --no-splash
[+] Oolite connected from ('127.0.0.1', 64783)
[+] Handshake started. Oolite version: 1.93
[*] Connection Approved.
[*] Requesting snapshot and quit...
[*] Waiting for process to exit...
[*] Captured D:/a/_temp/msys64/tmp/oolite_snapshot_bnwm41ov/oolite-001.png (408 KB)
[+] Success: Snapshot passed quality check.

Example output from Ubuntu CI test:


[*] Moving to /home/runner/work/oolite/oolite/oolite.app
[*] Console server listening on 8563
[*] Executing: xwfb-run -- ./oolite --no-splash
[+] Oolite connected from ('127.0.0.1', 37796)
[+] Handshake started. Oolite version: 1.93
[*] Connection Approved.
[*] Requesting snapshot and quit...
[*] Waiting for process to exit...
[*] Captured /tmp/oolite_snapshot_doyjlm0u/oolite-001.png (416 KB)
[+] Success: Snapshot passed quality check.

mcarans added 17 commits April 5, 2026 20:37
Make AddOns folder in oolite.app not build
Add Python test that launches Oolite, takes a snapshot and quits
Add make -f Makefile test
Add to test_builds workflow
Add Windows test build
Exclude AddOns in oolite.app folder as it is already one level up
Install mesa in standard install (since by default it won't be used instead of hardware acceleration)
@mcarans mcarans requested a review from phkb April 6, 2026 22:01
Copy link
Copy Markdown
Contributor

@phkb phkb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than my note below, I'm happy with the change.

{ "takeSnapShot", GlobalTakeSnapShot, 1 },
#endif
{ "pauseGame", GlobalPauseGame, 0 },
{ "quitGame", GlobalQuitGame, 0 },
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might be better to move the quitGame global method into the #ifndef NDEBUG section, same as the "takeSnapshot" method. It's not a function that should ever be called by a script, and will only be used in debug scenarios.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants