27 lines
601 B
C++
27 lines
601 B
C++
|
#include "TestCaseRunner.h"
|
||
|
|
||
|
#include <vector>
|
||
|
#include <iostream>
|
||
|
|
||
|
void TestCaseRunner::AddTestCase(const std::string& label, TestCasePtr testCase)
|
||
|
{
|
||
|
mCases.push_back({label, std::move(testCase)});
|
||
|
}
|
||
|
|
||
|
bool TestCaseRunner::Run()
|
||
|
{
|
||
|
bool testsPassed = true;
|
||
|
for(const auto& test : mCases)
|
||
|
{
|
||
|
std::cout << "Running " << test.first << std::endl;
|
||
|
const auto result = test.second->Run();
|
||
|
if (!result)
|
||
|
{
|
||
|
std::cout << test.first << " Failed" << std::endl;
|
||
|
testsPassed = false;
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
return testsPassed;
|
||
|
}
|