diff options
author | dan miller | 2007-10-19 05:20:48 +0000 |
---|---|---|
committer | dan miller | 2007-10-19 05:20:48 +0000 |
commit | d48ea5bb797037069d641da41da0f195f0124491 (patch) | |
tree | 40ff433d94859d629aac933d5ec73b382f62ba1a /libraries/ode-0.9/tests/CppTestHarness/TestRunner.cpp | |
parent | dont ask (diff) | |
download | opensim-SC_OLD-d48ea5bb797037069d641da41da0f195f0124491.zip opensim-SC_OLD-d48ea5bb797037069d641da41da0f195f0124491.tar.gz opensim-SC_OLD-d48ea5bb797037069d641da41da0f195f0124491.tar.bz2 opensim-SC_OLD-d48ea5bb797037069d641da41da0f195f0124491.tar.xz |
one more for the gipper
Diffstat (limited to 'libraries/ode-0.9/tests/CppTestHarness/TestRunner.cpp')
-rw-r--r-- | libraries/ode-0.9/tests/CppTestHarness/TestRunner.cpp | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/libraries/ode-0.9/tests/CppTestHarness/TestRunner.cpp b/libraries/ode-0.9/tests/CppTestHarness/TestRunner.cpp new file mode 100644 index 0000000..51db141 --- /dev/null +++ b/libraries/ode-0.9/tests/CppTestHarness/TestRunner.cpp | |||
@@ -0,0 +1,56 @@ | |||
1 | #include "TestRunner.h" | ||
2 | #include "TestLauncher.h" | ||
3 | #include "TestResults.h" | ||
4 | #include "Test.h" | ||
5 | |||
6 | #include "PrintfTestReporter.h" | ||
7 | |||
8 | namespace CppTestHarness | ||
9 | { | ||
10 | |||
11 | TestRunner::TestRunner() | ||
12 | : m_testLauncherListHead(TestLauncher::GetHeadAddr()) | ||
13 | , m_testReporter(&m_defaultTestReporter) | ||
14 | { | ||
15 | } | ||
16 | |||
17 | TestRunner::~TestRunner() | ||
18 | { | ||
19 | } | ||
20 | |||
21 | void TestRunner::SetTestLauncherListHead(TestLauncher** listHead) | ||
22 | { | ||
23 | m_testLauncherListHead = listHead; | ||
24 | } | ||
25 | |||
26 | void TestRunner::SetTestReporter(TestReporter* testReporter) | ||
27 | { | ||
28 | m_testReporter = testReporter; | ||
29 | } | ||
30 | |||
31 | int TestRunner::RunAllTests() | ||
32 | { | ||
33 | int failureCount = 0; | ||
34 | |||
35 | int testCount = 0; | ||
36 | TestLauncher const* curLauncher = *m_testLauncherListHead; | ||
37 | while (curLauncher) | ||
38 | { | ||
39 | ++testCount; | ||
40 | |||
41 | TestResults result(*m_testReporter); | ||
42 | curLauncher->Launch(result); | ||
43 | |||
44 | if (result.Failed()) | ||
45 | ++failureCount; | ||
46 | |||
47 | curLauncher = curLauncher->GetNext(); | ||
48 | } | ||
49 | |||
50 | m_testReporter->ReportSummary(testCount, failureCount); | ||
51 | |||
52 | return failureCount; | ||
53 | } | ||
54 | |||
55 | } | ||
56 | |||