瀏覽代碼

lolunit: unit tests now display a meaningful report in Visual Studio.

undefined
Sam Hocevar 9 年之前
父節點
當前提交
24cbf425c2
共有 1 個文件被更改,包括 16 次插入9 次删除
  1. +16
    -9
      tools/lolunit/lolunit.h

+ 16
- 9
tools/lolunit/lolunit.h 查看文件

@@ -207,23 +207,30 @@ public:
}
std::cout << "\n";

std::cout << "\n\n";
std::stringstream summary;
summary << "\n\n";
if (failcases)
{
std::cout << "!!!FAILURES!!!\n";
std::cout << "Test Results:\n";
std::cout << "Run: " << testcases
<< " Failures: " << failcases
<< " Errors: 0\n"; /* TODO: handle errors */
summary << "!!!FAILURES!!!\n";
summary << "Test Results:\n";
summary << "Run: " << testcases
<< " Failures: " << failcases
<< " Errors: 0\n"; /* TODO: handle errors */
summary << errors.str();

std::cout << errors.str();
ret = false;
}
else
{
std::cout << "OK (" << testcases << " tests)\n";
summary << "OK (" << testcases << " tests)\n";
}
std::cout << "\n\n";
summary << "\n\n";

#if _WIN32
::OutputDebugStringA(summary.str().c_str());
#else
std::cout << summary.str();
#endif

return ret;
}


Loading…
取消
儲存