Ajout de l'ensemble du workspace.
[GPU.git] / WCudaMSE / Student_Cuda / src / cpp / test / mainTest.cpp
1 #include <stdlib.h>
2 #include <iostream>
3 #include <string>
4
5 #include "cppTest+.h"
6 #include "Device.h"
7 #include "StringTools.h"
8 #include "cudaTools.h"
9
10 #include "TestHello.h"
11
12
13 using std::string;
14 using std::cout;
15 using std::endl;
16
17 using Test::Suite;
18
19 /*----------------------------------------------------------------------*\
20 |* Declaration *|
21 \*---------------------------------------------------------------------*/
22
23 /*--------------------------------------*\
24 |* Imported *|
25 \*-------------------------------------*/
26
27 /*--------------------------------------*\
28 |* Private *|
29 \*-------------------------------------*/
30
31 static bool testALL();
32
33 /*--------------------------------------*\
34 |* Public *|
35 \*-------------------------------------*/
36
37 int mainTest();
38
39 /*----------------------------------------------------------------------*\
40 |* Implementation *|
41 \*---------------------------------------------------------------------*/
42
43 /*--------------------------------------*\
44 |* Public *|
45 \*-------------------------------------*/
46
47 int mainTest()
48 {
49 bool isOk = testALL();
50
51 cout << "\nisOK = " << isOk << endl;
52
53 return isOk ? EXIT_SUCCESS : EXIT_FAILURE;
54 }
55
56 /*--------------------------------------*\
57 |* Private *|
58 \*-------------------------------------*/
59
60 bool testALL()
61 {
62 int deviceId=Device::getDeviceId();
63
64 Suite testSuite;
65
66 testSuite.add(std::auto_ptr < Suite > (new TestHello(deviceId)));
67
68 string titre = "deviceId_" + StringTools::toString(deviceId);
69
70 return runTestHtml(titre, testSuite); // Attention: html create in working directory!!
71 //return runTestConsole(titre, testSuite);
72 }
73
74 /*----------------------------------------------------------------------*\
75 |* End *|
76 \*---------------------------------------------------------------------*/
77