aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/ode-0.9/tests/CppTestHarness/TestMacros.h
blob: 12a91cd53ec174ea840d2b2bbe021e9d7ceb709e (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
#ifndef TEST_MACROS_H
#define TEST_MACROS_H

//----------------------------
#define TEST(Name) \
	class Test##Name : public CppTestHarness::Test \
	{ \
	public: \
		Test##Name() : Test(#Name, __FILE__, __LINE__) {} \
	private: \
		virtual void RunImpl(CppTestHarness::TestResults& testResults_); \
	}; \
	CppTestHarness::TypedTestLauncher< Test##Name > \
		staticInitTest##Name##Creator(CppTestHarness::TestLauncher::GetHeadAddr()); \
	\
	void Test##Name::RunImpl(CppTestHarness::TestResults& testResults_)

//----------------------------
#define TEST_FIXTURE(Fixture, Name) \
	class Test##Name : public CppTestHarness::Test, public Fixture \
	{ \
	public: \
		Test##Name() : Test(#Name, __FILE__, __LINE__) {} \
	private: \
		virtual void RunImpl(CppTestHarness::TestResults& testResults_); \
	}; \
	CppTestHarness::TypedTestLauncher< Test##Name > \
		staticInitTest##Name##Creator(CppTestHarness::TestLauncher::GetHeadAddr()); \
	\
	void Test##Name::RunImpl(CppTestHarness::TestResults& testResults_)

//----------------------------
#define TEST_FIXTURE_CTOR(Fixture, CtorParams, Name) \
	class Test##Name : public CppTestHarness::Test, public Fixture \
	{ \
	public: \
		Test##Name() : Test(#Name, __FILE__, __LINE__), Fixture CtorParams {} \
	private: \
		virtual void RunImpl(CppTestHarness::TestResults& testResults_); \
	}; \
	CppTestHarness::TypedTestLauncher< Test##Name > \
		staticInitTest##Name##Creator(CppTestHarness::TestLauncher::GetHeadAddr()); \
	\
	void Test##Name::RunImpl(CppTestHarness::TestResults& testResults_)


#endif