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?
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?