1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
#include "test_result.h"
#include "base_c/nano.h"
#include "test_failure.h"
using namespace indigo;
TestResult::TestResult() : _testCount(0), _secondsElapsed(0.0f)
{
_startTime = nanoClock();
}
TestResult::~TestResult()
{
}
void TestResult::testWasRun()
{
_testCount++;
}
void TestResult::startTests()
{
}
int TestResult::addFailure(Failure* failure)
{
_failures.add(failure);
return _failures.size();
}
void TestResult::endTests()
{
_secondsElapsed = nanoHowManySeconds((nanoClock() - _startTime));
}
int TestResult::failureCount() const
{
return _failures.size();
}
int TestResult::testCount() const
{
return _testCount;
}
|