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),
|
mHeight(height),
|
||||||
mDataType(dataType)
|
mDataType(dataType)
|
||||||
{
|
{
|
||||||
|
initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
Image::~Image()
|
Image::~Image()
|
||||||
|
|
|
@ -48,7 +48,6 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initialize();
|
void initialize();
|
||||||
|
|
||||||
unsigned mWidth{1};
|
unsigned mWidth{1};
|
||||||
unsigned mHeight{1};
|
unsigned mHeight{1};
|
||||||
unsigned mBitDepth{8};
|
unsigned mBitDepth{8};
|
||||||
|
|
|
@ -67,7 +67,16 @@ bool TestCaseRunner::run(const std::vector<std::string>& args)
|
||||||
|
|
||||||
sLastTestFailed = false;
|
sLastTestFailed = false;
|
||||||
std::cout << "TestFramework: Running Test - " << test_case->getName() << std::endl;
|
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)
|
if (sLastTestFailed)
|
||||||
{
|
{
|
||||||
std::cout << "Failed at line: " << sFailureLine << std::endl;
|
std::cout << "Failed at line: " << sFailureLine << std::endl;
|
||||||
|
|
Loading…
Reference in a new issue