Add exception handling for test runner.
This commit is contained in:
parent
b76dc184b3
commit
d370c26c42
3 changed files with 11 additions and 3 deletions
|
@ -12,7 +12,7 @@ Image::Image(unsigned width, unsigned height, DataType dataType)
|
|||
mHeight(height),
|
||||
mDataType(dataType)
|
||||
{
|
||||
|
||||
initialize();
|
||||
}
|
||||
|
||||
Image::~Image()
|
||||
|
|
|
@ -48,7 +48,6 @@ public:
|
|||
|
||||
private:
|
||||
void initialize();
|
||||
|
||||
unsigned mWidth{1};
|
||||
unsigned mHeight{1};
|
||||
unsigned mBitDepth{8};
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue