11
|
1 |
/*
|
|
2 |
* Copyright (C) 2008 Remko Troncon
|
|
3 |
* Licensed under the MIT license.
|
|
4 |
* See COPYING for license details.
|
|
5 |
*/
|
|
6 |
|
|
7 |
#ifndef QtTestUtil_H
|
|
8 |
#define QtTestUtil_H
|
|
9 |
|
|
10 |
#include "QtTestUtil/TestRegistration.h"
|
|
11 |
|
|
12 |
/**
|
|
13 |
* A macro to register a test class.
|
|
14 |
*
|
|
15 |
* This macro will create a static variable which registers the
|
|
16 |
* testclass with the TestRegistry, and creates an instance of the
|
|
17 |
* test class.
|
|
18 |
*
|
|
19 |
* Execute this macro in the body of your unit test's .cpp file, e.g.
|
|
20 |
* class MyTest {
|
|
21 |
* ...
|
|
22 |
* };
|
|
23 |
*
|
|
24 |
* QTTESTUTIL_REGISTER_TEST(MyTest)
|
|
25 |
*/
|
|
26 |
#define QTTESTUTIL_REGISTER_TEST(TestClass) \
|
|
27 |
static QtTestUtil::TestRegistration<TestClass> TestClass##Registration
|
|
28 |
|
|
29 |
#endif
|