void FileTestItem::onRunFinished_(bool success)
{
    setProgress(1.0);
    setStatus(success ? Status::Pass : Status::Fail);

    QString testRelPath = testRunner_->testRelPath();

    switch (testRunner_->status())
    {
    case TestRunner::Status::CompileError:
        appendToCommandLineOutput(compileOutput());
        appendToCommandLineOutput("FAIL: " + testRelPath + "\n");
        break;

    case TestRunner::Status::RunError:
        appendToCommandLineOutput(runOutput());
        appendToCommandLineOutput("FAIL: " + testRelPath + "\n");
        break;

    case TestRunner::Status::Pass:
        appendToCommandLineOutput("PASS: "******"\n");
        break;

    default:
        appendToCommandLineOutput("????: " + testRelPath + "\n");
        break;
    }

    emit runFinished(this);
}
示例#2
0
QString TestRunner::output() const
{
    QString res;

    switch (status())
    {
    case Status::NotCompiledYet:
        res = QString();
        break;

    case Status::Compiling:
    case Status::CompileError:
    case Status::NotRunYet:
        res = compileOutput();
        break;

    case Status::Running:
    case Status::RunError:
    case Status::Pass:
        res = runOutput();
        break;
    }

    return res;
}
示例#3
0
// コンパイラスロット数を設定
bool CCompilerSet::setCompilerSlotNum(int num)
{
	for(int i = m_compilers.size(); num < i; i--) {
		m_compilers.pop_back();
	}

	for(int i = m_compilers.size(); i < num; i++) {
		m_compilers.push_back(new CCompiler(this));
	}

	// スロットに関連付けをしてシグナルを受け取れるように
	foreach(CCompiler* compiler, m_compilers)
	{
		connect(compiler, SIGNAL(compileStarted(QUuid)),  this, SLOT(compileStarted(QUuid)));
		connect(compiler, SIGNAL(compileFailure()),       this, SLOT(compileFailure()));
		connect(compiler, SIGNAL(compileSuccessful()),    this, SLOT(compileSuccessful()));
		connect(compiler, SIGNAL(compileOutput(QString)), this, SLOT(compileReadOutput(QString)));
	}