1 #ifndef UNITTEST_TESTRUNNER_H
2 #define UNITTEST_TESTRUNNER_H
6 #include "CurrentTest.h"
14 UNITTEST_LINKAGE
int RunAllTests();
18 bool operator()(
const Test*
const)
const
24 class UNITTEST_LINKAGE TestRunner
27 explicit TestRunner(TestReporter& reporter);
30 template<
class Predicate >
31 int RunTestsIf(TestList
const& list,
char const* suiteName,
32 const Predicate& predicate,
int maxTestTimeInMs)
const
34 Test* curTest = list.GetHead();
38 if (IsTestInSuite(curTest, suiteName) && predicate(curTest))
39 RunTest(m_result, curTest, maxTestTimeInMs);
41 curTest = curTest->m_nextTest;
47 TestResults* GetTestResults();
50 TestReporter* m_reporter;
51 TestResults* m_result;
55 bool IsTestInSuite(
const Test*
const curTest,
char const* suiteName)
const;
56 void RunTest(TestResults*
const result, Test*
const curTest,
int const maxTestTimeInMs)
const;