2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-01-08 21:15:35 +03:00
rehlds/dep/cppunitlite/src/TestResult.cpp

39 lines
721 B
C++
Raw Normal View History

2015-05-04 21:25:41 +03:00
#include "cppunitlite/TestResult.h"
#include "cppunitlite/Failure.h"
#include <sstream>
#include <iostream>
TestResult::TestResult ()
: failureCount (0)
{
}
void TestResult::testsStarted ()
{
}
void TestResult::addFailure (const Failure& failure) {
std::stringstream ss;
ss << "Failure in test '" << failure.testName << "' :" << failure.message;
std::cout << ss.str() << std::endl;
std::cout.flush();
2015-05-04 21:25:41 +03:00
failureCount++;
}
void TestResult::testsEnded () {
std::stringstream ss;
if (failureCount > 0) {
ss << "There were " << failureCount << " failures";
} else {
ss << "There were no test failures";
}
std::cout << ss.str() << std::endl;
std::cout.flush();
2015-05-04 21:25:41 +03:00
}