We’re trying to include Catch2 tests. This was my intended strategy (MacOS, XCode / AppCode):
- Create new folder
- Create new target
- Set header search paths for
teststo mimic those of other plugin targets.
#include "catch.hpp" #include <JuceHeader.h> #include "project_module_to_test.cpp" ... Tests ...
- Create build config for
- Build and run.
Unfortunately this gives an error:
No global header file was included!. This references
JuceHeader.h which suggests silencing the error using
Attempted fix: Add this to the top of
Result: Lots of linker errors.
At this point I notice that the plugin targets include (in build phases) the JUCE implementation files from
JUCE Library Code as source.
Attempted fix: Add these files to the source for the
Result: Lots more errors including (mysteriously) the return of the initial
No global header file error.
At this point I decide that there is something going way, way, way over my head.
Is this a completely misguided way of configuring Catch2 tests for JUCE or is there something small I’m missing?