Ajout de l'ensemble du workspace.
[GPU.git] / WCudaMSE / API_CppTest / SRC / core / extension / testTools.cpp
1 #include <stdlib.h>
2 #include <iostream>
3 #include <fstream>
4
5 #include "cppTest+.h"
6
7 using std::cout;
8 using std::endl;
9 using std::string;
10 using std::ofstream;
11
12 /*----------------------------------------------------------------------*\
13 |* Implementation *|
14 \*---------------------------------------------------------------------*/
15
16 bool runTestConsole(string titre, Test::Suite& test)
17 {
18 cout << "\n[" << titre << "]\n" << endl;
19
20 Test::TextOutput output(Test::TextOutput::Verbose); // Try Verbose or Terse
21 return test.run(output);
22 }
23
24 bool runTestHtml(string titre, Test::Suite& test)
25 {
26 cout << "\n[Output HTML] : " << titre << endl << endl;
27
28 string fileName=titre+".html";
29
30 const char* fileNameC=fileName.c_str();
31
32 ofstream file;
33 file.open(fileNameC);
34
35 if (file.bad())
36 {
37 return false;
38 }
39 else
40 {
41 //file << "Test"<<std::endl;
42 Test::HtmlOutput output;
43 bool isOk = test.run(output);
44
45 output.generate(file);
46 file.close();
47
48 return isOk;
49 }
50 }
51
52 /*----------------------------------------------------------------------*\
53 |* End *|
54 \*---------------------------------------------------------------------*/
55