According to this piece of code , it looks like you should get the property at some point while you create your test in order to pass it as a parameter for a specific test.
Perhaps the goal was to let you do:
#define CPPUNIT_TEST_WITH_PARAM(testMethod,param) \ CPPUNIT_TEST_ADD( new CppUnit::ParameterizedTestCase<ThisTestFixtureType>( \ context.getTestNameFor( #testMethod ), \ #testMethod, \ &TestFixtureType::testMethod, \ context.makeFixture(), \ context.getStringProperty( param ) ) ) CPPUNIT_TEST_SUITE( MyTestSuite); CPPUNIT_TEST_SUITE_PROPERTY( "param1", "foo" ) CPPUNIT_TEST_SUITE_PROPERTY( "param2", "bar" ) CPPUNIT_CPPUNIT_TEST_WITH_PARAM( func, "param1" ) CPPUNIT_CPPUNIT_TEST_WITH_PARAM( func, "param2" ) CPPUNIT_TEST_SUITE_END(); void func( const std::string& param );
And that would end up calling func("foo") and func("bar") . Which would be nice, because it would add parameterized string tests.
However, this is just an attempt to guess , since ParameterizedTestCase not part of the old version 1.12.1 and is not part of the latest releases (so the macro CPPUNIT_TEST_ADD ), I think that this is apparently something that was in terms of release but interrupted, and the macro CPPUNIT_TEST_SUITE_PROPERTY is useless here. getStringProperty also remains, and I did not find a way to use it correctly.
In conclusion, it looks like broken material and, in any case, apparently, is not intended to share the setup / break code, but moreover, to have parameterized tests (which can actually be done using the templates, see this post ).
jpo38
source share