Skip to content

Commit

Permalink
Non-fatal errors are no longer ignored in ASTJSON parse-only cases
Browse files Browse the repository at this point in the history
  • Loading branch information
wechman committed Feb 17, 2022
1 parent 4dbc0f2 commit babfb44
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions test/libsolidity/ASTJSONTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <fstream>
#include <memory>
#include <stdexcept>
#include <iostream>

using namespace solidity::langutil;
using namespace solidity::frontend;
Expand Down Expand Up @@ -138,17 +139,7 @@ TestCase::TestResult ASTJSONTest::run(ostream& _stream, string const& _linePrefi
c.reset();
c.setSources(sources);
c.setEVMVersion(solidity::test::CommonOptions::get().evmVersion());

if (!c.parseAndAnalyze(variant.stopAfter))
{
// Ignore non-fatal analysis errors, we only want to export.
if (c.state() > CompilerStack::State::Parsed)
continue;

SourceReferenceFormatter formatter(_stream, c, _formatted, false);
formatter.printErrorInformation(c.errors());
return TestResult::FatalError;
}
c.parseAndAnalyze(variant.stopAfter);

resultsMatch = resultsMatch && runTest(
variant,
Expand Down

0 comments on commit babfb44

Please sign in to comment.