Only colour error type, not error message in isoltest.

This commit is contained in:
Daniel Kirchner 2018-03-15 16:27:34 +01:00
parent 7fa892eca9
commit 50ad89d369

View File

@ -78,8 +78,11 @@ void SyntaxTest::printExpected(ostream& _stream, string const& _linePrefix, bool
FormattedScope(_stream, _formatted, {BOLD, GREEN}) << _linePrefix << "Success" << endl; FormattedScope(_stream, _formatted, {BOLD, GREEN}) << _linePrefix << "Success" << endl;
else else
for (auto const& expectation: m_expectations) for (auto const& expectation: m_expectations)
{
FormattedScope(_stream, _formatted, {BOLD, expectation.type == "Warning" ? YELLOW : RED}) << FormattedScope(_stream, _formatted, {BOLD, expectation.type == "Warning" ? YELLOW : RED}) <<
_linePrefix << expectation.type << ": " << expectation.message << endl; _linePrefix << expectation.type << ": ";
_stream << expectation.message << endl;
}
} }
void SyntaxTest::printErrorList( void SyntaxTest::printErrorList(
@ -99,6 +102,7 @@ void SyntaxTest::printErrorList(
bool isWarning = (error->type() == Error::Type::Warning); bool isWarning = (error->type() == Error::Type::Warning);
if (isWarning && _ignoreWarnings) continue; if (isWarning && _ignoreWarnings) continue;
{
FormattedScope scope(_stream, _formatted, {BOLD, isWarning ? YELLOW : RED}); FormattedScope scope(_stream, _formatted, {BOLD, isWarning ? YELLOW : RED});
_stream << _linePrefix; _stream << _linePrefix;
if (_lineNumbers) if (_lineNumbers)
@ -109,7 +113,9 @@ void SyntaxTest::printErrorList(
if (line >= 0) if (line >= 0)
_stream << "(" << line << "): "; _stream << "(" << line << "): ";
} }
_stream << error->typeName() << ": " << errorMessage(*error) << endl; _stream << error->typeName() << ": ";
}
_stream << errorMessage(*error) << endl;
} }
} }