aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-06-22 22:32:46 +0800
committerchriseth <chris@ethereum.org>2017-06-28 17:41:03 +0800
commitc73ba612f4c41a2f068debdb368789ae15dfb5a4 (patch)
tree47ad683bde03426150d5321094b344f2f4d45b2d /test/libsolidity
parentaf7ff3a3efec0394e8d44453f46af4e692cc224f (diff)
downloaddexon-solidity-c73ba612f4c41a2f068debdb368789ae15dfb5a4.tar.gz
dexon-solidity-c73ba612f4c41a2f068debdb368789ae15dfb5a4.tar.zst
dexon-solidity-c73ba612f4c41a2f068debdb368789ae15dfb5a4.zip
Fix test error reporting if we ignore warnings.
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp12
1 files changed, 9 insertions, 3 deletions
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 const> 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)
{