28 #ifndef PT_UNIT_TESTSUITE_H
29 #define PT_UNIT_TESTSUITE_H
31 #include <Pt/Unit/Api.h>
32 #include <Pt/Unit/Test.h>
33 #include <Pt/Unit/TestFixture.h>
34 #include <Pt/Unit/TestMethod.h>
35 #include <Pt/Unit/TestProtocol.h>
40 class SerializationInfo;
88 test.setArgs(args, argCount);
124 virtual void setUp();
132 virtual void tearDown();
153 void runTest(
const std::string& name,
const SerializationInfo* args = 0, std::size_t argCount = 0);
159 template <
class ParentT>
160 void registerMethod(
const std::string& name, ParentT& parent,
void (ParentT::*method)() )
162 Pt::Unit::TestMethod* test =
new BasicTestMethod<ParentT>(this->name() +
"::" + name, parent, method);
163 this->registerTest(test);
166 template <
class ParentT,
typename A1>
167 void registerMethod(
const std::string& name, ParentT& parent,
void (ParentT::*method)(A1) )
169 Pt::Unit::TestMethod* test =
new BasicTestMethod<ParentT, A1>(this->name() +
"::" + name, parent, method);
170 this->registerTest(test);
173 template <
class ParentT,
typename A1,
typename A2>
174 void registerMethod(
const std::string& name, ParentT& parent,
void (ParentT::*method)(A1, A2) )
176 Pt::Unit::TestMethod* test =
new BasicTestMethod<ParentT, A1, A2>(this->name() +
"::" + name, parent, method);
177 this->registerTest(test);
180 template <
class ParentT,
typename A1,
typename A2,
typename A3>
181 void registerMethod(
const std::string& name, ParentT& parent,
void (ParentT::*method)(A1, A2, A3) )
183 Pt::Unit::TestMethod* test =
new BasicTestMethod<ParentT, A1, A2, A3>(this->name() +
"::" + name, parent, method);
184 this->registerTest(test);
187 template <
class ParentT,
typename A1,
typename A2,
typename A3,
typename A4>
188 void registerMethod(
const std::string& name, ParentT& parent,
void (ParentT::*method)(A1, A2, A3, A4) )
190 Pt::Unit::TestMethod* test =
new BasicTestMethod<ParentT, A1, A2, A3, A4>(this->name() +
"::" + name, parent, method);
191 this->registerTest(test);
194 template <
class ParentT,
typename A1,
typename A2,
typename A3,
typename A4,
typename A5>
195 void registerMethod(
const std::string& name, ParentT& parent,
void (ParentT::*method)(A1, A2, A3, A4, A5) )
197 Pt::Unit::TestMethod* test =
new BasicTestMethod<ParentT, A1, A2, A3, A4, A5>(this->name() +
"::" + name, parent, method);
198 this->registerTest(test);
202 void registerTest(TestMethod* test);
204 TestMethod* findTestMethod(
const std::string& name);
210 std::multimap<std::string, TestMethod*> _tests;
Protocol and data driven testing.
Definition: TestSuite.h:76
Protocol for test suites.
Definition: TestProtocol.h:51
Context in which test are run.
Definition: TestContext.h:46
Fixture interface for tests.
Definition: TestFixture.h:40
Test base class
Definition: Test.h:54
Represents arbitrary types during serialization.
Definition: SerializationInfo.h:58