lightfixture.h
Go to the documentation of this file.00001 #ifndef CPPUT_LIGHTFIXTURE_H_INCLUDED
00002 # define CPPUT_LIGHTFIXTURE_H_INCLUDED
00003
00004 # include "forwards.h"
00005 # include "extendeddata.h"
00006 # include "testcase.h"
00007 # include "registry.h"
00008
00011 #define _CPPUT_LF_CLASS( FixtureType, testName ) \
00012 FixtureType##_##testName
00013
00018 #define _CPPUT_TEST_LIGHT_FIXTURE_IMPL( FixtureType, testName, specificsCode ) \
00019 class _CPPUT_LF_CLASS(FixtureType,testName) : public FixtureType \
00020 , public ::CppUT::TestExtendedDataFactory \
00021 { \
00022 public: \
00023 static ::CppUT::TestPtr cpputMakeTest() \
00024 { \
00025 ::CppUT::TestPtr test( ::CppUT::makeTestCase( \
00026 &_CPPUT_LF_CLASS(FixtureType,testName)::cpputTest, #testName ) ); \
00027 specificsCode \
00028 return test; \
00029 } \
00030 public: \
00031 static void cpputTest() \
00032 { \
00033 _CPPUT_LF_CLASS(FixtureType,testName) fixture; \
00034 fixture.testName(); \
00035 } \
00036 void testName(); \
00037 }; \
00038 CPPUT_REGISTER_TESTFACTORY_IN( &_CPPUT_LF_CLASS(FixtureType,testName)::cpputMakeTest, \
00039 #FixtureType ); \
00040 void _CPPUT_LF_CLASS(FixtureType,testName)::testName()
00041
00060 #define CPPUT_TEST_LIGHT_FIXTURE( FixtureType, testName ) \
00061 _CPPUT_TEST_LIGHT_FIXTURE_IMPL( FixtureType, testName, (void)0; )
00062
00081 #define CPPUT_TEST_LIGHT_FIXTURE_WITH_SPECIFICS( FixtureType, testName, specifics ) \
00082 _CPPUT_TEST_LIGHT_FIXTURE_IMPL( FixtureType, testName, \
00083 ( specifics ).apply( *test ); )
00084
00087 #define CPPUT_REGISTER_LIGHT_FIXTURE( FixtureType ) \
00088 CPPUT_REGISTER_SUITE_RELATIONSHIP_TO_DEFAULT( #FixtureType )
00089
00092 #define CPPUT_REGISTER_LIGHT_FIXTURE_IN( FixtureType, parentSuiteName ) \
00093 CPPUT_REGISTER_SUITE_RELATIONSHIP( #FixtureType, parentSuiteName )
00094
00095
00096 #endif // CPPUT_LIGHTFIXTURE_H_INCLUDED