本文整理汇总了C++中Executable::setOutputParser方法的典型用法代码示例。如果您正苦于以下问题:C++ Executable::setOutputParser方法的具体用法?C++ Executable::setOutputParser怎么用?C++ Executable::setOutputParser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Executable
的用法示例。
在下文中一共展示了Executable::setOutputParser方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: construct
Case* CaseBuilder::construct()
{
Q_ASSERT(m_executable);
QFileInfo exeLocation(m_executable->location().toLocalFile());
QString cazeName = m_executable->name();
if (!m_suite.isEmpty() && cazeName.startsWith(m_suite + '-')) {
QStringList spl = cazeName.split('-');
Q_ASSERT(spl.count() > 1);
spl.removeFirst();
cazeName = spl.join("-");
}
Case* caze = new Case(cazeName, exeLocation);
caze->setExecutable( m_executable );
Executable* exe = m_executable;
//exe->setLocation(KUrl(exeLocation.absoluteFilePath()));
m_executable->setCase(caze);
exe->setOutputParser( new OutputParser);
QStringList exeFunctionOut = m_executable->fetchFunctions();
bool success = false;
foreach(QString line, exeFunctionOut) { //krazy:exclude=foreach
if (line.endsWith(QLatin1String("()")) &&
!line.contains(QLatin1String(" "))) {
// recognize this as a legit qtest function output line
line.chop(2); // remove "()"
Command* foo = new Command(line, caze);
caze->addChild(foo);
success = true;
} else { // garbage
if (!line.isEmpty()) {
kDebug() << "Garbage line:\n" << line;
}
}
}
if (success) {
return caze;
} else {
delete caze;
return 0;
}
}