Commit 6522b4b5 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

handle skipping of test functions on a per-function basis

now we process all includes and loads in cumulative mode again.
functions without side effects don't need special attention in the first
place, obviously. and the printing functions already have their own
handling.
parent 35225c44
...@@ -821,7 +821,7 @@ bool ProFileEvaluator::Private::visitProValue(ProValue *value) ...@@ -821,7 +821,7 @@ bool ProFileEvaluator::Private::visitProValue(ProValue *value)
bool ProFileEvaluator::Private::visitProFunction(ProFunction *func) bool ProFileEvaluator::Private::visitProFunction(ProFunction *func)
{ {
if (!m_skipLevel && (!m_updateCondition || m_condition == ConditionFalse)) { if (!m_updateCondition || m_condition == ConditionFalse) {
QString text = func->text(); QString text = func->text();
int lparen = text.indexOf(QLatin1Char('(')); int lparen = text.indexOf(QLatin1Char('('));
int rparen = text.lastIndexOf(QLatin1Char(')')); int rparen = text.lastIndexOf(QLatin1Char(')'));
...@@ -829,10 +829,12 @@ bool ProFileEvaluator::Private::visitProFunction(ProFunction *func) ...@@ -829,10 +829,12 @@ bool ProFileEvaluator::Private::visitProFunction(ProFunction *func)
QString arguments = text.mid(lparen + 1, rparen - lparen - 1); QString arguments = text.mid(lparen + 1, rparen - lparen - 1);
QString funcName = text.left(lparen); QString funcName = text.left(lparen);
m_lineNo = func->lineNumber(); m_lineNo = func->lineNumber();
bool result = false; bool result;
if (!evaluateConditionalFunction(funcName.trimmed(), arguments, &result)) if (!evaluateConditionalFunction(funcName.trimmed(), arguments, &result)) {
m_invertNext = false;
return false; return false;
if (result ^ m_invertNext) }
if (!m_skipLevel && (result ^ m_invertNext))
m_condition = ConditionTrue; m_condition = ConditionTrue;
} }
m_invertNext = false; m_invertNext = false;
...@@ -1733,6 +1735,8 @@ bool ProFileEvaluator::Private::evaluateConditionalFunction(const QString &funct ...@@ -1733,6 +1735,8 @@ bool ProFileEvaluator::Private::evaluateConditionalFunction(const QString &funct
break; break;
} }
case T_INCLUDE: { case T_INCLUDE: {
if (m_skipLevel && !m_cumulative)
break;
QString parseInto; QString parseInto;
if (args.count() == 2) { if (args.count() == 2) {
parseInto = args[1]; parseInto = args[1];
...@@ -1749,6 +1753,8 @@ bool ProFileEvaluator::Private::evaluateConditionalFunction(const QString &funct ...@@ -1749,6 +1753,8 @@ bool ProFileEvaluator::Private::evaluateConditionalFunction(const QString &funct
break; break;
} }
case T_LOAD: { case T_LOAD: {
if (m_skipLevel && !m_cumulative)
break;
QString parseInto; QString parseInto;
bool ignore_error = false; bool ignore_error = false;
if (args.count() == 2) { if (args.count() == 2) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment