aboutsummaryrefslogtreecommitdiffstats
path: root/share/qtcreator/templates/wizards/autotest/files/tst_main.cpp
blob: 1c915089d6f9661b21f9971689b42a5046027ccd (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
@if  "%{TestFrameWork}" == "QtQuickTest"
#include <QtQuickTest/quicktest.h>
@if "%{UseSetupCode}" === "true"
#include "setup.h"

QUICK_TEST_MAIN_WITH_SETUP(example, Setup)
@else

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

#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 My test module
#include <boost/test/included/unit_test.hpp>

BOOST_AUTO_TEST_SUITE( %{TestSuiteName} )

BOOST_AUTO_TEST_CASE( %{TestCaseName} )
{
  BOOST_TEST( true /* test assertion */ );
}

BOOST_AUTO_TEST_SUITE_END()
@endif
@if "%{TestFrameWork}" == "BoostTest_dyn"
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE My test module
#include <boost/test/unit_test.hpp>
@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