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?
"Twenty years from now you will be more disappointed by the things you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore. Dream. Discover." - Mark Twain
You may have just won ten million dollars! Or, maybe a tiny ad.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop