{
detail_info = string();
detail_debug = string();
+ fail_reason = string();
passed = false;
start_test((*i)->get_description());
const ExceptionCheck *exc_check = (*i)->get_exception_check();
if(verbose)
detail_info += detail_debug;
+ if(!passed)
+ {
+ if(fail_reason.empty())
+ detail_info += "Failed without reason";
+ else
+ detail_info += fail_reason;
+ }
if(!detail_info.empty())
{
vector<string> lines = split(detail_info, '\n');
void Test::fail_test(const string &why)
{
IO::print("\033[31mfailed\033[0m\n");
- IO::print(" %s\n", why);
+ fail_reason = why;
}
void Test::expect(bool cond, const string &expr)
std::list<Function *> functions;
std::string detail_info;
std::string detail_debug;
+ std::string fail_reason;
bool passed;
protected: