X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;f=WCudaMSE%2FStudent_Cuda%2Fsrc%2Fcpp%2Ftest%2FmainTest.cpp;fp=WCudaMSE%2FStudent_Cuda%2Fsrc%2Fcpp%2Ftest%2FmainTest.cpp;h=259f355c3526818b3043d335fae30fae06e12abd;hb=8d08c12b29c2a14684f35c023ee39e694bb80d25;hp=0000000000000000000000000000000000000000;hpb=226de81f7e1f1fbf4ac79d0d089e8a05ec7159a0;p=GPU.git diff --git a/WCudaMSE/Student_Cuda/src/cpp/test/mainTest.cpp b/WCudaMSE/Student_Cuda/src/cpp/test/mainTest.cpp new file mode 100755 index 0000000..259f355 --- /dev/null +++ b/WCudaMSE/Student_Cuda/src/cpp/test/mainTest.cpp @@ -0,0 +1,77 @@ +#include +#include +#include + +#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 *| + \*---------------------------------------------------------------------*/ +