void FParser::Run(char *rover, char *data, char *end) { Rover = rover; try { PrevSection = NULL; // clear it while(*Rover) // go through the script executing each statement { // past end of script? if(Rover > end) break; PrevSection = Section; // store from prev. statement // get the line and tokens GetTokens(Rover); if(!NumTokens) { if(Section) // no tokens but a brace { // possible } at end of loop: // refer to spec.c spec_brace(); } continue; // continue to next statement } if(script_debug) PrintTokens(); // debug RunStatement(); // run the statement } } catch (const CFsError &err) { ErrorMessage(err.msg); } catch (const CFsTerminator &) { // The script has signalled that it wants to be terminated in an orderly fashion. } }
//***************************************************************************** // //! \brief Test execution thread function. //! //! \param None //! //! \details Test execution thread function. //! //! \return The test result xtrue or xfalse. // //***************************************************************************** xtBoolean TestMain(void) { int i, j; TestIOInit(); PrintLine(""); PrintLine("*** CooCox CoIDE components test suites"); PrintLine("***"); #ifdef TEST_COMPONENTS_NAME Print("*** Components: "); PrintLine(TEST_COMPONENTS_NAME); #endif #ifdef TEST_COMPONENTS_VERSION Print("*** Version: "); PrintLine(TEST_COMPONENTS_VERSION); #endif #ifdef TEST_BOARD_NAME Print("*** Test Board: "); PrintLine(TEST_BOARD_NAME); #endif PrintLine(""); g_bGlobalFail = xfalse; i = 0; while (g_psPatterns[i]) { j = 0; while (g_psPatterns[i][j]) { PrintNewLine(); Print("--- Test Case "); PrintN(i + 1); Print("."); PrintN(j + 1); Print(" ("); Print((char *)g_psPatterns[i][j]->GetTest()); PrintLine(")"); ExecuteTest(g_psPatterns[i][j]); if (g_bLocalFail == xtrue) { Print("--- Result: FAILURE "); PrintLine(""); // //printf error information // Print(g_pcErrorInfoBuffer); PrintLine(""); if (g_pcTokensBuffer < g_pcTok) { Print(" The tokens in buffer is: "); PrintTokens(); PrintLine(""); } } else { PrintLine("--- Result: SUCCESS "); } j++; } i++; } PrintNewLine(); PrintLine(""); Print("Final result: "); if (g_bGlobalFail == xtrue) PrintLine("FAILURE"); else PrintLine("SUCCESS"); return g_bGlobalFail; }