// Called after the test ends. // Print a summary only if the test failed. void TersePrinter::OnTestEnd(const TestInfo& test_info) { if (test_info.result()->Passed()) { if (!useTerseOutput) { // print the message header test_header_printed_ = true; PrintTestHeader(COLOR_GREEN); // print the message trailer ColoredPrintf(COLOR_GREEN, "[ OK ] "); printf("%s.%s", test_case_name_.c_str(), test_info_name_.c_str()); // print the test time if (GTEST_FLAG(print_time)) printf(" (%s ms)\n", internal::StreamableToString( test_info.result()->elapsed_time()).c_str()); else printf("\n"); } } else { ColoredPrintf(COLOR_RED, "%s", "[ FAILED ] "); printf("%s.%s\n", test_case_name_.c_str(), test_info_name_.c_str()); } fflush(stdout); }
void OnTestEnd(const TestInfo& test_info) { std::pair<gcString, bool> res = std::make_pair(m_szLastTest, test_info.result()->Passed()); std::pair<gcString, uint64> end = std::make_pair(m_szLastTest, (uint64)test_info.result()->elapsed_time()); onTestResultEvent(res); onTestEndEnd(end); }
void prepare(TestInfo info) { //Loading::initRW(); ADDeviceEmulator::runLater(1.5f, [info]() { info.finish(); }); }
void SDKUnitTestListener::OnTestEnd(const TestInfo& test_info) { if (test_info.result()->Passed()) { PushResult( "[ OK ] " ); } else { PushResult( "[ FAILED ] " ); } PrintTestName(test_info.test_case_name(), test_info.name() ); if (GTEST_FLAG(print_time)) { PushResult( UTIL_VarArgs(" (%s ms)\n", internal::StreamableToString( test_info.result()->elapsed_time()).c_str()) ); } else { PushResult( "\n" ); } }
void playGame(TestInfo info, const char* table) { TableCells table_cells; int x=0; int y=0; int max_ell = Cell::N -1; for(int i=0; i<Cell::N*Cell::N; ++i) { x = i%4; y = max_ell - i/4; if(table[i] != '-') { Letter curr_letter(table[i]); table_cells.setLetter(x,y,curr_letter); } } int64_t score = 25000; SessionManager::getInstance()->beginTheGame(); SessionManager::getInstance()->tableChanged(table_cells); SessionManager::getInstance()->scoreChanged(score); CCDirector::sharedDirector()->replaceScene(PlayScene::scene(GameMode::Continue)); ADDeviceEmulator::runLater(1.5f, [info](){ ADDeviceEmulator::createScreenShoot(info); info.finish(); }); }
void openLevelScene(TestInfo info, CollectionID id, int difficulty) { CCDirector::sharedDirector()->replaceScene(LevelScene::scene(id,difficulty)); ADDeviceEmulator::runLater(2.5f, [info](){ ADDeviceEmulator::createScreenShoot(info); info.finish(); }); }
void openAllCollectionsScene(TestInfo info) { CCDirector::sharedDirector()->replaceScene(SelectCollection::scene()); ADDeviceEmulator::runLater(2.5f, [info](){ ADDeviceEmulator::createScreenShoot(info); info.finish(); }); }
void continueGame(TestInfo info) { CCDirector::sharedDirector()->replaceScene(PlayScene::scene(GameMode::Continue)); ADDeviceEmulator::runLater(1.5f, [info](){ ADDeviceEmulator::createScreenShoot(info); info.finish(); }); }
void openMainScene(TestInfo info) { CCDirector::sharedDirector()->replaceScene(MainMenu::scene()); ADDeviceEmulator::runLater(2.5f, [info]() { ADDeviceEmulator::createScreenShoot(info); info.finish(); }); }
void purchaseBuy(TestInfo info) { CCDirector::sharedDirector()->replaceScene(SettingsScene::scene(true)); ADDeviceEmulator::runLater(2.5f, [info](){ ADDeviceEmulator::createScreenShoot(info); info.finish(); }); }
void openSettings(TestInfo info) { CCDirector::sharedDirector()->replaceScene(SettingsScene::scene()); ADDeviceEmulator::runLater(1.5f, [info](){ ADDeviceEmulator::createScreenShoot(info); info.finish(); }); }
void openOneCollectionScene(TestInfo info, int collection_number) { Collection* collection = RW::getCollectionByIndex(collection_number); CCDirector::sharedDirector()->replaceScene(SelectLevel::scene(collection)); ADDeviceEmulator::runLater(2.5f, [info]() { ADDeviceEmulator::createScreenShoot(info); info.finish(); }); }
virtual void OnTestEnd(const TestInfo& test_info) { if (test_info.result()->Passed()) { _CrtMemState stateNow, stateDiff; _CrtMemCheckpoint(&stateNow); int diffResult = _CrtMemDifference(&stateDiff, &memState_, &stateNow); if (diffResult) { FAIL() << "Memory leak of " << stateDiff.lSizes[1] << " byte(s) detected."; } } }
void TestSuite::OnTestEnd(const TestInfo& test_info) { const TestResult *testResult = test_info.result(); if (testResult->Passed()) { this->currentTestInfo->status = true; this->currentTestInfo->summary = "Test passed"; } this->currentTestInfo->timeInMillis = testResult->elapsed_time(); this->testsResults->addResult(this->currentTestInfo); delete this->currentTestInfo; }
void openAllCollectionScene(TestInfo info, bool first_collections) { // 'scene' is an autorelease object CCScene *scene = CCScene::create(); // 'layer' is an autorelease object SelectCollection *layer = SelectCollection::create(); BackgroundHolder::backgroundSwitchTo(scene,0,false); scene->addChild(layer); CCDirector::sharedDirector()->replaceScene(scene); //move scroll zone if(!first_collections) layer->moveCollectionScrollZone(); ADDeviceEmulator::runLater(4.5f, [info]() { ADDeviceEmulator::createScreenShoot(info); info.finish(); }); }
void openOneLevelScene(TestInfo info, int collection_number, int level_number, int free_space_id) { Collection* collection = RW::getCollectionByIndex(collection_number); //get level std::vector<Level*> levels = collection->getLevels(); Level* level; for(unsigned int i=0; i<levels.size() ; ++i) { if(levels[i]->getLevelID() == level_number) { level = levels[i]; break; } } // 'scene' is an autorelease object CCScene *scene = CCScene::create(); // 'layer' is an autorelease object LevelScene *layer = LevelScene::create(level); BackgroundHolder::backgroundSwitchTo(scene,0,false); scene->addChild(layer); CCDirector::sharedDirector()->replaceScene(scene); layer->clickEquationSpace(free_space_id); ADDeviceEmulator::runLater(3.5f, [info]() { ADDeviceEmulator::createScreenShoot(info); info.finish(); }); }
// Called after a test ends void AlternatePrinter::OnTestEnd(const TestInfo& test_info) { fprintf(stdout, "*** TEST %s.%s ending.\n", test_info.test_case_name(), test_info.name()); fflush(stdout); }
void SDKUnitTestListener::OnTestStart(const TestInfo& test_info) { PushResult( "[ RUN ] " ); PrintTestName(test_info.test_case_name(), test_info.name()); PushResult( "\n" ); }
// Called before the test starts. // Save information for the failure message. // The test start information is actually printed by // OnTestPartResult() and prints the failures only. void TersePrinter::OnTestStart(const TestInfo& test_info) { test_header_printed_ = false; test_case_name_ = test_info.test_case_name(); test_info_name_ = test_info.name(); }
void TestSuite::OnTestStart(const TestInfo& test_info) { this->currentTestInfo = new UnitTestInfo(); this->currentTestInfo->test_case_name = test_info.test_case_name(); this->currentTestInfo->test_name = test_info.name(); }
void OnTestStart(const TestInfo& test_info) { m_szLastTest = gcString("{0}/{1}", test_info.test_case_name(), test_info.name()); onTestStartEvent(m_szLastTest); }