Non-fatal erros do not stop ASTJSON test execution

This commit is contained in:
wechman 2022-02-18 09:13:33 +01:00 committed by wechman
parent 5f7ff667b9
commit 38639417e1

View File

@ -141,14 +141,14 @@ TestCase::TestResult ASTJSONTest::run(ostream& _stream, string const& _linePrefi
if (!c.parseAndAnalyze(variant.stopAfter)) if (!c.parseAndAnalyze(variant.stopAfter))
{ {
// Ignore non-fatal analysis errors, we only want to export. // We just want to export so raise fatal analysis errors only
if (c.state() > CompilerStack::State::Parsed) if (c.state() < CompilerStack::State::ParsedAndImported)
continue; {
SourceReferenceFormatter formatter(_stream, c, _formatted, false); SourceReferenceFormatter formatter(_stream, c, _formatted, false);
formatter.printErrorInformation(c.errors()); formatter.printErrorInformation(c.errors());
return TestResult::FatalError; return TestResult::FatalError;
} }
}
resultsMatch = resultsMatch && runTest( resultsMatch = resultsMatch && runTest(
variant, variant,