X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;f=WCudaMSE%2FTuto_CppTest%2Fsrc%2Fcpp%2Ftest%2FmainTest.cpp;fp=WCudaMSE%2FTuto_CppTest%2Fsrc%2Fcpp%2Ftest%2FmainTest.cpp;h=5fac621ca91070c41b3d23904b702028be7da111;hb=8d08c12b29c2a14684f35c023ee39e694bb80d25;hp=0000000000000000000000000000000000000000;hpb=226de81f7e1f1fbf4ac79d0d089e8a05ec7159a0;p=GPU.git diff --git a/WCudaMSE/Tuto_CppTest/src/cpp/test/mainTest.cpp b/WCudaMSE/Tuto_CppTest/src/cpp/test/mainTest.cpp new file mode 100755 index 0000000..5fac621 --- /dev/null +++ b/WCudaMSE/Tuto_CppTest/src/cpp/test/mainTest.cpp @@ -0,0 +1,81 @@ +#include +#include +#include + +#include "cppTest+.h" + +#include "TestScalarJunit.h" +#include "TestIntegerJunit.h" + +using std::cout; +using std::endl; +using std::string; +using std::ofstream; +using std::auto_ptr; + +using Test::Suite; + +/*----------------------------------------------------------------------*\ + |* Declaration *| + \*---------------------------------------------------------------------*/ + +/*--------------------------------------*\ + |* Imported *| + \*-------------------------------------*/ + +// Already in cppTest+.h +//extern bool runTestConsole(string titre, Test::Suite& test); +//extern bool runTestHtml(string titre, Test::Suite& test); + +/*--------------------------------------*\ + |* Private *| + \*-------------------------------------*/ + +static bool testInteger(void); +static bool testALL(void); + +/*----------------------------------------------------------------------*\ + |* Implementation *| + \*---------------------------------------------------------------------*/ + +/*--------------------------------------*\ + |* Public *| + \*-------------------------------------*/ + +int mainTest(void) + { + // bool isOk = testInteger(); + bool isOk = testALL(); + + cout << "\nisOK = " << isOk << endl; + + return isOk ? EXIT_SUCCESS : EXIT_FAILURE; + } + +/*--------------------------------------*\ + |* Private *| + \*-------------------------------------*/ + +bool testALL() + { + Suite testSuite; + + testSuite.add(auto_ptr(new TestScalarJunit())); + testSuite.add(auto_ptr(new TestIntegerJunit())); + + return runTestHtml("TestALL_HTML", testSuite); + //return runTestConsole("TestALL_Console", testSuite); + } + +bool testInteger(void) + { + TestIntegerJunit* ptrTest = new TestIntegerJunit(); + + //return runTestHtml("TestIntegerJunit", *ptrTest); + return runTestConsole("TestIntegerJunit", *ptrTest); + } + +/*----------------------------------------------------------------------*\ + |* End *| + \*---------------------------------------------------------------------*/ +