Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

End-to-end testing with LWJGL

Ranch Hand
Posts: 146
Mac Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
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
    Bookmark Topic Watch Topic
  • New Topic