1 | #ifndef TEST_MACROS_H |
---|
2 | #define TEST_MACROS_H |
---|
3 | |
---|
4 | //---------------------------- |
---|
5 | #define TEST(Name) \ |
---|
6 | class Test##Name : public CppTestHarness::Test \ |
---|
7 | { \ |
---|
8 | public: \ |
---|
9 | Test##Name() : Test(#Name, __FILE__, __LINE__) {} \ |
---|
10 | private: \ |
---|
11 | virtual void RunImpl(CppTestHarness::TestResults& testResults_); \ |
---|
12 | }; \ |
---|
13 | CppTestHarness::TypedTestLauncher< Test##Name > \ |
---|
14 | staticInitTest##Name##Creator(CppTestHarness::TestLauncher::GetHeadAddr()); \ |
---|
15 | \ |
---|
16 | void Test##Name::RunImpl(CppTestHarness::TestResults& testResults_) |
---|
17 | |
---|
18 | //---------------------------- |
---|
19 | #define TEST_FIXTURE(Fixture, Name) \ |
---|
20 | class Test##Name : public CppTestHarness::Test, public Fixture \ |
---|
21 | { \ |
---|
22 | public: \ |
---|
23 | Test##Name() : Test(#Name, __FILE__, __LINE__) {} \ |
---|
24 | private: \ |
---|
25 | virtual void RunImpl(CppTestHarness::TestResults& testResults_); \ |
---|
26 | }; \ |
---|
27 | CppTestHarness::TypedTestLauncher< Test##Name > \ |
---|
28 | staticInitTest##Name##Creator(CppTestHarness::TestLauncher::GetHeadAddr()); \ |
---|
29 | \ |
---|
30 | void Test##Name::RunImpl(CppTestHarness::TestResults& testResults_) |
---|
31 | |
---|
32 | //---------------------------- |
---|
33 | #define TEST_FIXTURE_CTOR(Fixture, CtorParams, Name) \ |
---|
34 | class Test##Name : public CppTestHarness::Test, public Fixture \ |
---|
35 | { \ |
---|
36 | public: \ |
---|
37 | Test##Name() : Test(#Name, __FILE__, __LINE__), Fixture CtorParams {} \ |
---|
38 | private: \ |
---|
39 | virtual void RunImpl(CppTestHarness::TestResults& testResults_); \ |
---|
40 | }; \ |
---|
41 | CppTestHarness::TypedTestLauncher< Test##Name > \ |
---|
42 | staticInitTest##Name##Creator(CppTestHarness::TestLauncher::GetHeadAddr()); \ |
---|
43 | \ |
---|
44 | void Test##Name::RunImpl(CppTestHarness::TestResults& testResults_) |
---|
45 | |
---|
46 | |
---|
47 | #endif |
---|
48 | |
---|