Edit: A patch for the Projucer is available a little further down
At our company we work with JUCE to create cross-platform audio plugins. We started to integrate unit tests and so far this has been rather tedious to setup.
Basically what we do: We have a project that compiles the plugin as VST /AU / etc… Then there’s another Console-App project that simply runs our unit tests from the same codebase (which are done with the googletest / gtest framework)
Now here’s an idea: We would like to add another build target to the projucer (much like suggested here). And I’d like to ask for advice on where to look in the projucer codebase or how to proceed generally.
I’ve seen the
ProjectType class and it seems to me, I’d have to add another entry into the
Target::Type enum - something like
Target::Type::gtestStandaloneApp. Then, I’d have to add a couple of other lines here and there to make this visible throughout the app.
My idea was to take the current standalone app target as a foundation and simply throw out the existing code and add to main() the single call into the googletest framework that runs all tests.
However, I can track the use of the
Target::Type enum throughout the Projucer codebase, but I have yet to find where the code for the standalone app target actually comes from. There’s no template in the
BinaryData and I haven’t seen any hints in the code at all.
Any advice would be appreciated.
EDIT: Some more hints, in case someone else is interested:
LibraryModule::CompileUnit::isNeededForExporter()could be used to assign code files to the unit test exporter only, e.g. by sorting out files with a suffix like
_gtest- just like it is done there for the other build targets as well.
- the code for the standalone app is found in the juce module