Add exception handling for test runner.

This commit is contained in:
James Grogan 2023-01-16 18:16:14 +00:00
parent b76dc184b3
commit d370c26c42
3 changed files with 11 additions and 3 deletions

View file

@ -67,7 +67,16 @@ bool TestCaseRunner::run(const std::vector<std::string>& args)
sLastTestFailed = false;
std::cout << "TestFramework: Running Test - " << test_case->getName() << std::endl;
test_case->run();
try{
test_case->run();
}
catch(...)
{
std::cout << "Failed with exception" << std::endl;
mFailingTests.push_back(test_case->getName());
};
if (sLastTestFailed)
{
std::cout << "Failed at line: " << sFailureLine << std::endl;