From fb1534d320eead90f9216d479b507fccfd9653d9 Mon Sep 17 00:00:00 2001 From: Sudara Date: Thu, 12 Sep 2024 21:53:10 +0200 Subject: [PATCH] Add Catch2 main functions --- benchmarks/Catch2Main.cpp | 17 +++++++++++++++++ tests/Catch2Main.cpp | 18 ++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 benchmarks/Catch2Main.cpp create mode 100644 tests/Catch2Main.cpp diff --git a/benchmarks/Catch2Main.cpp b/benchmarks/Catch2Main.cpp new file mode 100644 index 0000000..94fcb08 --- /dev/null +++ b/benchmarks/Catch2Main.cpp @@ -0,0 +1,17 @@ +// All test files are included in the executable via the Glob in CMakeLists.txt + +#include "juce_gui_basics/juce_gui_basics.h" +#include + +int main (int argc, char* argv[]) +{ + // This lets us use JUCE's MessageManager without leaking. + // PluginProcessor might need this if you use the APVTS for example. + // You'll also need it for tests that rely on juce::Graphics, juce::Timer, etc. + // It's nicer DX when placed here vs. manually in Catch2 SECTIONs + juce::ScopedJuceInitialiser_GUI gui; + + const int result = Catch::Session().run (argc, argv); + + return result; +} diff --git a/tests/Catch2Main.cpp b/tests/Catch2Main.cpp new file mode 100644 index 0000000..d786588 --- /dev/null +++ b/tests/Catch2Main.cpp @@ -0,0 +1,18 @@ +// All test files are included in the executable via the Glob in CMakeLists.txt + +#include "juce_gui_basics/juce_gui_basics.h" +#include + +int main (int argc, char* argv[]) +{ + // This lets us use JUCE's MessageManager without leaking. + // PluginProcessor might need this if you use the APVTS for example. + // You'll also need it for tests that rely on juce::Graphics, juce::Timer, etc. + // It's nicer DX when placed here vs. manually in Catch2 SECTIONs + juce::ScopedJuceInitialiser_GUI gui; + + const int result = Catch::Session().run (argc, argv); + + return result; +} +#include