Changed: dWorldAttachQuickStepDynamicIterationStatisticsSink function has been added
[ode.git] / tests / UnitTest++ / src / TestReporterStdout.cpp
blob133e6faa92832e9c10c7064f1dfd8d1281327e9b
1 #include "TestReporterStdout.h"
2 #include <cstdio>
4 #include "TestDetails.h"
6 namespace UnitTest {
8 void TestReporterStdout::ReportFailure(TestDetails const& details, char const* failure)
10 #ifdef __APPLE__
11 char const* const errorFormat = "%s:%d: error: Failure in %s: %s\n";
12 #else
13 char const* const errorFormat = "%s(%d): error: Failure in %s: %s\n";
14 #endif
15 std::printf(errorFormat, details.filename, details.lineNumber, details.testName, failure);
18 void TestReporterStdout::ReportTestStart(TestDetails const& /*test*/)
22 void TestReporterStdout::ReportTestFinish(TestDetails const& /*test*/, float)
26 void TestReporterStdout::ReportSummary(int const totalTestCount, int const failedTestCount,
27 int const failureCount, float secondsElapsed)
29 if (failureCount > 0)
30 std::printf("FAILURE: %d out of %d tests failed (%d failures).\n", failedTestCount, totalTestCount, failureCount);
31 else
32 std::printf("Success: %d tests passed.\n", totalTestCount);
33 std::printf("Test time: %.2f seconds.\n", secondsElapsed);