mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix test error reporting if we ignore warnings.
This commit is contained in:
parent
af7ff3a3ef
commit
c73ba612f4
@ -103,16 +103,22 @@ parseAnalyseAndReturnError(string const& _source, bool _reportWarnings = false,
|
|||||||
if (success)
|
if (success)
|
||||||
if (!StaticAnalyzer(errorReporter).analyze(*sourceUnit))
|
if (!StaticAnalyzer(errorReporter).analyze(*sourceUnit))
|
||||||
success = false;
|
success = false;
|
||||||
if (errorReporter.errors().size() > 1 && !_allowMultipleErrors)
|
std::shared_ptr<Error const> error;
|
||||||
BOOST_FAIL("Multiple errors found");
|
|
||||||
for (auto const& currentError: errorReporter.errors())
|
for (auto const& currentError: errorReporter.errors())
|
||||||
{
|
{
|
||||||
if (
|
if (
|
||||||
(_reportWarnings && currentError->type() == Error::Type::Warning) ||
|
(_reportWarnings && currentError->type() == Error::Type::Warning) ||
|
||||||
(!_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)
|
catch (InternalCompilerError const& _e)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user