TestApplication.h
Go to the documentation of this file.00001 00002 // 00003 // This source file is a part of ParCompMark 00004 // Parallel Compositing Benchmark Framework 00005 // 00006 // for latest info see http://parcompmark.sourceforge.net 00007 00008 // 00009 // Copyright (C) 2006 IT2 ParCompMark Dev. Team 00010 // 00011 // This program is free software; you can redistribute it and/or 00012 // modify it under the terms of the GNU General Public License 00013 // as published by the Free Software Foundation; either version 2 00014 // of the License, or (at your option) any later version. 00015 // 00016 // This program is distributed in the hope that it will be useful, 00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 // GNU General Public License for more details. 00020 // 00021 // You should have received a copy of the GNU General Public License 00022 // along with this program; if not, write to the Free Software 00023 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00024 00027 00028 #ifndef __TEST_APPLICATION_H__ 00029 # define __TEST_APPLICATION_H__ 00030 00031 // 00032 // CppUnit include 00033 // 00034 # include <cppunit/extensions/HelperMacros.h> 00035 00036 // 00037 // Tested class include 00038 // 00039 # define PARCOMPMARK_TEST 00040 # include "../../include/PCMApplication.h" 00041 # undef PARCOMPMARK_TEST 00042 00043 // 00044 // Opening namespace of the tested project 00045 // 00046 using namespace ParCompMark; 00047 00048 namespace ParCompMarkTest 00049 { 00050 00056 class TestApplication:public CppUnit::TestFixture 00057 { 00058 00059 // First, we declare the suite, passing the class name to the macro: 00061 CPPUNIT_TEST_SUITE(TestApplication); 00062 00063 // Then, we declare each test case of the fixture: 00065 CPPUNIT_TEST(test_constructor); 00066 CPPUNIT_TEST(test_destructor); 00067 CPPUNIT_TEST(test_complement_int_int); 00068 CPPUNIT_TEST(test_parseCommandLine_cu32_cchar_pp); 00069 CPPUNIT_TEST(test_showHelp_cstd__string); 00070 CPPUNIT_TEST(test_showVersion_cstd__string); 00071 CPPUNIT_TEST(test_setCommanderOn_cstd__string); 00072 CPPUNIT_TEST(test_setGUIOn_cstd__string); 00073 CPPUNIT_TEST(test_setLowLevelOn_cstd__string); 00074 CPPUNIT_TEST(test_setLowLevelScriptFile_cstd__string); 00075 CPPUNIT_TEST(test_setDynamicScriptFile_cstd__string); 00076 CPPUNIT_TEST(test_setScenarioScriptFile_cstd__string); 00077 CPPUNIT_TEST(test_setCluster_cstd__string); 00078 CPPUNIT_TEST(test_setParameters_cstd__string); 00079 CPPUNIT_TEST(test_setInput_cstd__string); 00080 CPPUNIT_TEST(test_setOutput_cstd__string); 00081 CPPUNIT_TEST(test_setExpectedHostCount_cstd__string); 00082 CPPUNIT_TEST(test_setUserInterface_cstd__string); 00083 CPPUNIT_TEST(test_hasEnvironmentVariable_cstd__string); 00084 CPPUNIT_TEST(test_getEnvironmentVariable_cstd__string); 00085 CPPUNIT_TEST(test_terminateHandler); 00086 CPPUNIT_TEST(test_terminateHandlerNOP); 00087 CPPUNIT_TEST(test_unexpectedHandler); 00088 CPPUNIT_TEST(test_segfaultHandler_int); 00089 CPPUNIT_TEST(test_interruptHandler_int); 00090 CPPUNIT_TEST(test_setupHandlers); 00091 CPPUNIT_TEST(test_initialize); 00092 CPPUNIT_TEST(test_finalize); 00093 CPPUNIT_TEST(test_finalizeCommander); 00094 CPPUNIT_TEST(test_finalizeSoldier); 00095 CPPUNIT_TEST(test_setFromConfigOptions); 00096 CPPUNIT_TEST(test_createVirtualMachines); 00097 CPPUNIT_TEST(test_startOperation); 00098 CPPUNIT_TEST(test_commanderOperation); 00099 CPPUNIT_TEST(test_soldierOperation); 00100 CPPUNIT_TEST(test_textUserInterface); 00101 CPPUNIT_TEST(test_noUserInterface); 00102 CPPUNIT_TEST(test_executeUserCommand_cstd__string); 00103 CPPUNIT_TEST(test_processSquirrelCommandList); 00104 CPPUNIT_TEST(test_doPostCommand); 00105 CPPUNIT_TEST(test_loadLowLevelScript_cchar_p); 00106 CPPUNIT_TEST(test_loadDynamicScript_cchar_p); 00107 CPPUNIT_TEST(test_loadScenarioScript_cchar_p); 00108 CPPUNIT_TEST(test_pushSquirrelCommand_cchar_p); 00109 CPPUNIT_TEST(test_createLowLevelScript_cstd__string); 00110 CPPUNIT_TEST(test_processScenarioScript); 00111 CPPUNIT_TEST(test_setEnvironmentVariablesToSquirrel); 00112 CPPUNIT_TEST(test_initializeDynamicScriptParameters_cbool); 00113 CPPUNIT_TEST(test_retrieveDynamicScriptParameters); 00114 CPPUNIT_TEST(test_writeOutput); 00115 CPPUNIT_TEST(test_waitForOutput); 00116 CPPUNIT_TEST(test_getInstance); 00117 CPPUNIT_TEST(test_quit); 00118 CPPUNIT_TEST(test_compileDynamic); 00119 CPPUNIT_TEST(test_start); 00120 CPPUNIT_TEST(test_stop); 00121 CPPUNIT_TEST(test_autoDetection); 00122 CPPUNIT_TEST(test_cleanup); 00123 CPPUNIT_TEST(test_getHostListForSquirrel); 00124 CPPUNIT_TEST(test_getLowLevelScriptForSquirrel); 00125 CPPUNIT_TEST(test_getDynamicScriptForSquirrel); 00126 CPPUNIT_TEST(test_hasScenarioScript); 00127 CPPUNIT_TEST(test_getDynamicScriptParametersForSquirrel); 00128 CPPUNIT_TEST(test_getProgramInfo); 00129 CPPUNIT_TEST(test_calculateMessageSendTime); 00130 CPPUNIT_TEST(test__loadScenario); 00131 CPPUNIT_TEST(test__loadDynamic); 00132 CPPUNIT_TEST(test__compileDynamic); 00133 CPPUNIT_TEST(test__start); 00134 CPPUNIT_TEST(test__stop); 00135 CPPUNIT_TEST(test__pseudoStop); 00136 CPPUNIT_TEST(test__quit); 00137 00138 // Finally, we end the suite declaration: 00140 CPPUNIT_TEST_SUITE_END(); 00141 00142 public: 00143 00145 void setUp(); 00146 00148 void tearDown(); 00149 00150 protected: 00151 00152 // 00153 // Constructor & destructor tests 00154 // 00155 00159 void test_constructor(); 00160 00164 void test_destructor(); 00165 00166 // 00167 // Class method tests 00168 // 00169 00173 void test_complement_int_int(); 00174 00178 void test_parseCommandLine_cu32_cchar_pp(); 00179 00183 void test_showHelp_cstd__string(); 00184 00188 void test_showVersion_cstd__string(); 00189 00193 void test_setCommanderOn_cstd__string(); 00194 00198 void test_setGUIOn_cstd__string(); 00199 00203 void test_setLowLevelOn_cstd__string(); 00204 00208 void test_setLowLevelScriptFile_cstd__string(); 00209 00213 void test_setDynamicScriptFile_cstd__string(); 00214 00218 void test_setScenarioScriptFile_cstd__string(); 00219 00223 void test_setCluster_cstd__string(); 00224 00228 void test_setParameters_cstd__string(); 00229 00233 void test_setInput_cstd__string(); 00234 00238 void test_setOutput_cstd__string(); 00239 00243 void test_setExpectedHostCount_cstd__string(); 00244 00248 void test_setUserInterface_cstd__string(); 00249 00253 void test_hasEnvironmentVariable_cstd__string(); 00254 00258 void test_getEnvironmentVariable_cstd__string(); 00259 00263 void test_terminateHandler(); 00264 00268 void test_terminateHandlerNOP(); 00269 00273 void test_unexpectedHandler(); 00274 00278 void test_segfaultHandler_int(); 00279 00283 void test_interruptHandler_int(); 00284 00288 void test_getInstance(); 00289 00290 // 00291 // Method tests 00292 // 00293 00297 void test_setupHandlers(); 00298 00302 void test_initialize(); 00303 00307 void test_finalize(); 00308 00312 void test_finalizeCommander(); 00313 00317 void test_finalizeSoldier(); 00318 00322 void test_setFromConfigOptions(); 00323 00327 void test_createVirtualMachines(); 00328 00332 void test_startOperation(); 00333 00337 void test_writeOutput(); 00338 00342 void test_waitForOutput(); 00343 00347 void test_quit(); 00348 00352 void test_compileDynamic(); 00353 00357 void test_start(); 00358 00362 void test_stop(); 00363 00367 void test_autoDetection(); 00368 00372 void test_cleanup(); 00373 00377 void test_getHostListForSquirrel(); 00378 00382 void test_getLowLevelScriptForSquirrel(); 00383 00387 void test_getDynamicScriptForSquirrel(); 00388 00392 void test_hasScenarioScript(); 00393 00397 void test_getDynamicScriptParametersForSquirrel(); 00398 00402 void test_getProgramInfo(); 00403 00407 void test_calculateMessageSendTime(); 00408 00412 void test__pseudoStop(); 00413 00417 void test_commanderOperation(); 00418 00422 void test_soldierOperation(); 00423 00427 void test_textUserInterface(); 00428 00432 void test_noUserInterface(); 00433 00437 void test_executeUserCommand_cstd__string(); 00438 00442 void test_processSquirrelCommandList(); 00443 00447 void test_doPostCommand(); 00448 00452 void test_loadLowLevelScript_cchar_p(); 00453 00457 void test_loadDynamicScript_cchar_p(); 00458 00462 void test_loadScenarioScript_cchar_p(); 00463 00467 void test_pushSquirrelCommand_cchar_p(); 00468 00472 void test_createLowLevelScript_cstd__string(); 00473 00477 void test_processScenarioScript(); 00478 00482 void test_setEnvironmentVariablesToSquirrel(); 00483 00487 void test_initializeDynamicScriptParameters_cbool(); 00488 00492 void test_retrieveDynamicScriptParameters(); 00493 00497 void test__loadScenario(); 00498 00502 void test__loadDynamic(); 00503 00507 void test__compileDynamic(); 00508 00512 void test__start(); 00513 00517 void test__stop(); 00518 00522 void test__quit(); 00523 00524 }; 00525 00526 } 00527 00528 #endif