aboutsummaryrefslogtreecommitdiffstats
path: root/share/qtcreator/templates/wizards/autotest/files/tst_main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'share/qtcreator/templates/wizards/autotest/files/tst_main.cpp')
-rw-r--r--share/qtcreator/templates/wizards/autotest/files/tst_main.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/share/qtcreator/templates/wizards/autotest/files/tst_main.cpp b/share/qtcreator/templates/wizards/autotest/files/tst_main.cpp
index 923fad9f9b..e4f33d2716 100644
--- a/share/qtcreator/templates/wizards/autotest/files/tst_main.cpp
+++ b/share/qtcreator/templates/wizards/autotest/files/tst_main.cpp
@@ -24,3 +24,20 @@ BOOST_AUTO_TEST_CASE( %{TestCaseName} )
BOOST_TEST( true /* test assertion */ );
}
@endif
+@if "%{TestFrameWork}" == "Catch2"
+@if "%{Catch2NeedsQt}" == "true"
+#define CATCH_CONFIG_RUNNER
+@else
+#define CATCH_CONFIG_MAIN
+@endif
+#include <catch2/catch.hpp>
+@if "%{Catch2NeedsQt}" == "true"
+#include <QtGui/QGuiApplication>
+
+int main(int argc, char** argv)
+{
+ QGuiApplication app(argc, argv);
+ return Catch::Session().run(argc, argv);
+}
+@endif
+@endif