aboutsummaryrefslogtreecommitdiffstats
path: root/share/qtcreator/templates/wizards/autotest/files/tst_main.cpp
blob: e4f33d2716462ab8769a5a904d5310d5f5d4a169 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
@if  "%{TestFrameWork}" == "QtQuickTest"
#include <QtQuickTest/quicktest.h>

QUICK_TEST_MAIN(example)
@endif
@if "%{TestFrameWork}" == "GTest"
%{Cpp:LicenseTemplate}\
#include "%{TestCaseFileWithHeaderSuffix}"

#include <gtest/gtest.h>

int main(int argc, char *argv[])
{
    ::testing::InitGoogleTest(&argc, argv);
    return RUN_ALL_TESTS();
}
@endif
@if "%{TestFrameWork}" == "BoostTest"
#define BOOST_TEST_MODULE %{TestSuiteName}
#include <boost/test/included/unit_test.hpp>

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