Win a copy of Raising Young Coders: A Parent’s Guide to Teaching Programming at Home this week in the General Computing forum!
Forums Login/signup

End-to-end testing with LWJGL

+Pie Number of slices to send: Send
I'm writing a little game engine with LWJGL as my graphics library. For testing purposes I'd like to be able to either launch LWGJL as a separate process or call `main` directly and be able to compare past and previous screenshots (a bit like Reacts snapshots). On macOS, LWJGL requires the JVM to be started with `-XrunOnFirstThread`.

The first option is problematic because there is no easy way to capture graphical output or simulate input. The pro of this approach is that it would truly be end-to-end and exercise the system as an external user would.

The second option is problematic because I can't configure Junit5 to run each test on the first thread (I'd accept sequential tests too). The pro of this approach is that it doesn't require all kinds of external dependencies, such as xvfb, to be installed before tests can be run.

For what it's worth, I envisage something like the following test code (maybe game would be injected into system, tbd):



Has anyone any thoughts or suggestions on how I can achieve this?

reply
reply
This thread has been viewed 380 times.
Similar Threads
Java video game
LINUX GUI
Building a game using Spring Framework Java
Displaying a PNG using JLWGL and Slick
Java Timer
More...

All times above are in ranch (not your local) time.
The current ranch time is
Jun 27, 2025 04:36:31.