Mercurial > fife-parpg
annotate ext/UnitTest++/src/DeferredTestReporter.cpp @ 37:0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
author | jasoka@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Sat, 12 Jul 2008 12:00:57 +0000 |
parents | |
children |
rev | line source |
---|---|
37
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
1 #include "DeferredTestReporter.h" |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
2 #include "TestDetails.h" |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
3 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
4 using namespace UnitTest; |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
5 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
6 void DeferredTestReporter::ReportTestStart(TestDetails const& details) |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
7 { |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
8 m_results.push_back(DeferredTestResult(details.suiteName, details.testName)); |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
9 } |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
10 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
11 void DeferredTestReporter::ReportFailure(TestDetails const& details, char const* failure) |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
12 { |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
13 DeferredTestResult& r = m_results.back(); |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
14 r.failed = true; |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
15 r.failures.push_back(DeferredTestResult::Failure(details.lineNumber, failure)); |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
16 r.failureFile = details.filename; |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
17 } |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
18 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
19 void DeferredTestReporter::ReportTestFinish(TestDetails const&, float const secondsElapsed) |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
20 { |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
21 DeferredTestResult& r = m_results.back(); |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
22 r.timeElapsed = secondsElapsed; |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
23 } |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
24 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
25 DeferredTestReporter::DeferredTestResultList& DeferredTestReporter::GetResults() |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
26 { |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
27 return m_results; |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
28 } |