X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;f=WCudaMSE%2FAPI_CppTest%2FSRC%2Fcore%2Fextension%2FtestTools.cpp;fp=WCudaMSE%2FAPI_CppTest%2FSRC%2Fcore%2Fextension%2FtestTools.cpp;h=73993b0b300a21460992b1df25d40c3d599f4048;hb=8d08c12b29c2a14684f35c023ee39e694bb80d25;hp=0000000000000000000000000000000000000000;hpb=226de81f7e1f1fbf4ac79d0d089e8a05ec7159a0;p=GPU.git diff --git a/WCudaMSE/API_CppTest/SRC/core/extension/testTools.cpp b/WCudaMSE/API_CppTest/SRC/core/extension/testTools.cpp new file mode 100755 index 0000000..73993b0 --- /dev/null +++ b/WCudaMSE/API_CppTest/SRC/core/extension/testTools.cpp @@ -0,0 +1,55 @@ +#include +#include +#include + +#include "cppTest+.h" + +using std::cout; +using std::endl; +using std::string; +using std::ofstream; + +/*----------------------------------------------------------------------*\ + |* Implementation *| + \*---------------------------------------------------------------------*/ + +bool runTestConsole(string titre, Test::Suite& test) + { + cout << "\n[" << titre << "]\n" << endl; + + Test::TextOutput output(Test::TextOutput::Verbose); // Try Verbose or Terse + return test.run(output); + } + +bool runTestHtml(string titre, Test::Suite& test) + { + cout << "\n[Output HTML] : " << titre << endl << endl; + + string fileName=titre+".html"; + + const char* fileNameC=fileName.c_str(); + + ofstream file; + file.open(fileNameC); + + if (file.bad()) + { + return false; + } + else + { + //file << "Test"<