Ajout de l'ensemble du workspace.
[GPU.git] / WCudaMSE / Tuto_CppTest / src / cpp / test / mainTest.cpp
diff --git a/WCudaMSE/Tuto_CppTest/src/cpp/test/mainTest.cpp b/WCudaMSE/Tuto_CppTest/src/cpp/test/mainTest.cpp
new file mode 100755 (executable)
index 0000000..5fac621
--- /dev/null
@@ -0,0 +1,81 @@
+#include <stdlib.h>\r
+#include <fstream>\r
+#include <string>\r
+\r
+#include "cppTest+.h"\r
+\r
+#include "TestScalarJunit.h"\r
+#include "TestIntegerJunit.h"\r
+\r
+using std::cout;\r
+using std::endl;\r
+using std::string;\r
+using std::ofstream;\r
+using std::auto_ptr;\r
+\r
+using Test::Suite;\r
+\r
+/*----------------------------------------------------------------------*\\r
+ |*                    Declaration                                     *|\r
+ \*---------------------------------------------------------------------*/\r
+\r
+/*--------------------------------------*\\r
+ |*            Imported                *|\r
+ \*-------------------------------------*/\r
+\r
+// Already in cppTest+.h\r
+//extern bool runTestConsole(string titre, Test::Suite& test);\r
+//extern bool runTestHtml(string titre, Test::Suite& test);\r
+\r
+/*--------------------------------------*\\r
+ |*            Private                 *|\r
+ \*-------------------------------------*/\r
+\r
+static bool testInteger(void);\r
+static bool testALL(void);\r
+\r
+/*----------------------------------------------------------------------*\\r
+ |*                    Implementation                                  *|\r
+ \*---------------------------------------------------------------------*/\r
+\r
+/*--------------------------------------*\\r
+ |*            Public                  *|\r
+ \*-------------------------------------*/\r
+\r
+int mainTest(void)\r
+    {\r
+    // bool isOk = testInteger();\r
+    bool isOk = testALL();\r
+\r
+    cout << "\nisOK = " << isOk << endl;\r
+\r
+    return isOk ? EXIT_SUCCESS : EXIT_FAILURE;\r
+    }\r
+\r
+/*--------------------------------------*\\r
+ |*            Private                 *|\r
+ \*-------------------------------------*/\r
+\r
+bool testALL()\r
+    {\r
+    Suite testSuite;\r
+\r
+    testSuite.add(auto_ptr<Suite>(new TestScalarJunit()));\r
+    testSuite.add(auto_ptr<Suite>(new TestIntegerJunit()));\r
+\r
+    return runTestHtml("TestALL_HTML", testSuite);\r
+    //return runTestConsole("TestALL_Console", testSuite);\r
+    }\r
+\r
+bool testInteger(void)\r
+    {\r
+    TestIntegerJunit* ptrTest = new TestIntegerJunit();\r
+\r
+    //return runTestHtml("TestIntegerJunit", *ptrTest);\r
+    return runTestConsole("TestIntegerJunit", *ptrTest);\r
+    }\r
+\r
+/*----------------------------------------------------------------------*\\r
+ |*                    End                                             *|\r
+ \*---------------------------------------------------------------------*/\r
+\r