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