Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

End-to-end testing with LWJGL

Ranch Hand
Posts: 146
Mac Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic