Ajout de l'ensemble du workspace.
[GPU.git] / WCudaMSE / Student_Cuda / src / cpp / test / mainTest.cpp
diff --git a/WCudaMSE/Student_Cuda/src/cpp/test/mainTest.cpp b/WCudaMSE/Student_Cuda/src/cpp/test/mainTest.cpp
new file mode 100755 (executable)
index 0000000..259f355
--- /dev/null
@@ -0,0 +1,77 @@
+#include <stdlib.h>
+#include <iostream>
+#include <string>
+
+#include "cppTest+.h"
+#include "Device.h"
+#include "StringTools.h"
+#include "cudaTools.h"
+
+#include "TestHello.h"
+
+
+using std::string;
+using std::cout;
+using std::endl;
+
+using Test::Suite;
+
+/*----------------------------------------------------------------------*\
+ |*                    Declaration                                     *|
+ \*---------------------------------------------------------------------*/
+
+/*--------------------------------------*\
+ |*            Imported                *|
+ \*-------------------------------------*/
+
+/*--------------------------------------*\
+ |*            Private                 *|
+ \*-------------------------------------*/
+
+static bool testALL();
+
+/*--------------------------------------*\
+ |*            Public                  *|
+ \*-------------------------------------*/
+
+int mainTest();
+
+/*----------------------------------------------------------------------*\
+ |*                    Implementation                                  *|
+ \*---------------------------------------------------------------------*/
+
+/*--------------------------------------*\
+ |*            Public                  *|
+ \*-------------------------------------*/
+
+int mainTest()
+    {
+    bool isOk = testALL();
+
+    cout << "\nisOK = " << isOk << endl;
+
+    return isOk ? EXIT_SUCCESS : EXIT_FAILURE;
+    }
+
+/*--------------------------------------*\
+ |*            Private                 *|
+ \*-------------------------------------*/
+
+bool testALL()
+    {
+    int deviceId=Device::getDeviceId();
+
+    Suite testSuite;
+
+    testSuite.add(std::auto_ptr < Suite > (new TestHello(deviceId)));
+
+    string titre = "deviceId_" + StringTools::toString(deviceId);
+
+    return runTestHtml(titre, testSuite); // Attention: html create in working directory!!
+    //return runTestConsole(titre, testSuite);
+    }
+
+/*----------------------------------------------------------------------*\
+ |*                    End                                             *|
+ \*---------------------------------------------------------------------*/
+