I am writing/running my UnitTests using a slight adaptation of the standard JUCE approach… I run the tests with a Console App and the UnitTestRunner class which has
#JUCE_UNIT_TESTS=1 defined in the Console App’s ProJucer file.
One of my tests interacts with the OnlineUnlockStatus::attemptWebserverUnlock method which needs to run on a background thread. I’m hitting the breakpoint in that method because the thread isn’t a background thread.
I’d like to run this test on a background thread, but it’s not clear which is the best approach that avoids messing with the existing thread model of the juce unit tests.
I’ve considered writing a custom test class to run each test in it inside a thread, which seems like it could create more issues than it solves. Another idea is to just spawn a single background thread in the console app’s
Main and run the whole UnitTestRunner from that background thread.
Curious if anyone has encountered this issue or has any thoughts/suggestions. Thanks!