Ajout de l'ensemble du workspace.
[GPU.git] / WCudaMSE / API_CppTest / SRC / core / extension / testTools.cpp
diff --git a/WCudaMSE/API_CppTest/SRC/core/extension/testTools.cpp b/WCudaMSE/API_CppTest/SRC/core/extension/testTools.cpp
new file mode 100755 (executable)
index 0000000..73993b0
--- /dev/null
@@ -0,0 +1,55 @@
+#include <stdlib.h>\r
+#include <iostream>\r
+#include <fstream>\r
+\r
+#include "cppTest+.h"\r
+\r
+using std::cout;\r
+using std::endl;\r
+using std::string;\r
+using std::ofstream;\r
+\r
+/*----------------------------------------------------------------------*\\r
+ |*                    Implementation                                  *|\r
+ \*---------------------------------------------------------------------*/\r
+\r
+bool runTestConsole(string titre, Test::Suite& test)\r
+    {\r
+    cout << "\n[" << titre << "]\n" << endl;\r
+\r
+    Test::TextOutput output(Test::TextOutput::Verbose); // Try Verbose or Terse\r
+    return test.run(output);\r
+    }\r
+\r
+bool runTestHtml(string titre, Test::Suite& test)\r
+    {\r
+    cout << "\n[Output HTML] : " << titre << endl << endl;\r
+\r
+    string fileName=titre+".html";\r
+\r
+   const char* fileNameC=fileName.c_str();\r
+\r
+    ofstream file;\r
+    file.open(fileNameC);\r
+\r
+    if (file.bad())\r
+       {\r
+       return false;\r
+       }\r
+    else\r
+       {\r
+       //file << "Test"<<std::endl;\r
+       Test::HtmlOutput output;\r
+       bool isOk = test.run(output);\r
+\r
+       output.generate(file);\r
+       file.close();\r
+\r
+       return isOk;\r
+       }\r
+    }\r
+\r
+/*----------------------------------------------------------------------*\\r
+ |*                    End                                             *|\r
+ \*---------------------------------------------------------------------*/\r
+\r