/*! called whenever the tested process is finished \param exitCode exit code \param exitStatus exit status */ void Server::onProcessFinished( int exitCode, QProcess::ExitStatus exitStatus ) { Q_UNUSED( exitCode ); Q_UNUSED( exitStatus ); // TODO manage backtrace correctly onFail( "Fatal : application has quitted unexpectedly", "" /*Test::get()->getBacktrace()*/ ); delete _process; _process = 0; emit testedApplicationFinished(); }
void CrashReporter::onDone() { QByteArray data = m_reply->readAll(); m_ui->progressBar->setValue( m_ui->progressBar->maximum() ); m_ui->button->setText( tr( "Close" ) ); QString const response = QString::fromUtf8( data ); if ( ( m_reply->error() != QNetworkReply::NoError ) || !response.startsWith( "CrashID=" ) ) { onFail( m_reply->error(), m_reply->errorString() ); } else m_ui->progressLabel->setText( tr( "Sent! <b>Many thanks</b>." ) ); }
/*! called whenever a message from the client is received */ void Server::onMessageReceived() { QDataStream in(_localSocket); in.setVersion(QDataStream::Qt_4_0); // read all while ( !in.atEnd() ) { QString testFunctionName, message, backtrace, actual, expected, testCaseName; TestFunction* testFunction = 0; Message* messageObject = 0; int type; // parse message and build internal data model in >> type; switch ( type ) { case Test::WARN: in >> message >> backtrace; testFunction = _testCase ? _testCase->getCurrentTestFunction() : 0; Q_ASSERT( testFunction ); messageObject = new Message( message, backtrace ); testFunction->addWarnMessage( messageObject ); emit warnMessageAdded( messageObject, testFunction ); break; case Test::FAIL: in >> message >> backtrace; onFail( message, backtrace ); break; case Test::FUNCTION_START: in >> testFunctionName; Q_ASSERT( _testCase ); testFunction = new TestFunction( testFunctionName ); _testCase->addTestFunction( testFunction ); emit testFunctionStarted( testFunction ); break; case Test::FUNCTION_PASS: testFunction = _testCase ? _testCase->getCurrentTestFunction() : 0; Q_ASSERT( testFunction ); testFunction->pass(); emit testFunctionPassed( testFunction ); break; case Test::TESTCASE_START: delete _testCase; in >> testCaseName; _testCase = new TestCase( testCaseName, this ); emit testCaseStarted( _testCase ); break; case Test::TESTCASE_END: emit testCaseEnded( _testCase ); break; } } // TODO to be removed (still used in MainWindow for output display) emit outputReceived(); }