From c73ba612f4c41a2f068debdb368789ae15dfb5a4 Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 22 Jun 2017 16:32:46 +0200 Subject: Fix test error reporting if we ignore warnings. --- test/libsolidity/SolidityNameAndTypeResolution.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'test/libsolidity') diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index f649bf00..616ef47f 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -103,16 +103,22 @@ parseAnalyseAndReturnError(string const& _source, bool _reportWarnings = false, if (success) if (!StaticAnalyzer(errorReporter).analyze(*sourceUnit)) success = false; - if (errorReporter.errors().size() > 1 && !_allowMultipleErrors) - BOOST_FAIL("Multiple errors found"); + std::shared_ptr error; for (auto const& currentError: errorReporter.errors()) { if ( (_reportWarnings && currentError->type() == Error::Type::Warning) || (!_reportWarnings && currentError->type() != Error::Type::Warning) ) - return make_pair(sourceUnit, currentError); + { + if (error && !_allowMultipleErrors) + BOOST_FAIL("Multiple errors found"); + if (!error) + error = currentError; + } } + if (error) + return make_pair(sourceUnit, error); } catch (InternalCompilerError const& _e) { -- cgit