Restructuring GUI unit tests

Captain's Log: Stardate 77916.5

Today I continued to slog through all the unit tests on MacOS to get more of them working. I got pretty much all of the tests that do not involve OpenCL working, which is very nice.

Most of the problems that gave me grief had to do with the fact that JUCE is really just not designed to make apps that are easily testable. I had found some hacks on Windows that worked well enough, but the same kinds of hacks on MacOS just lead me to a dead end -- OS-level GUI stuff that wasn't playing along.

So, I finally broke down and solved the issue in a more general way, which is to run all the unit tests in a JUCEApplication. This means that the tests are actually running in a full JUCE app, so they have access to all the environmental stuff that JUCE sets up behind the scenes via the app machinery.

This annoys me, because it removes a lot of isolation between the tests. Before, I had hacked a way to destroy and recreate the GUI state between tests, so they couldn't interfere with one another. But now they all use the same application state, etc.

Still, it's nice to have most of the tests passing. I think now I just need to clean up some of the ridiculous hacks I've done for the MacOS support and I can leave it alone for the moment.


© 2024 Anukari LLC, All Rights Reserved
Contact Us|Legal