diff options
author | chriseth <chris@ethereum.org> | 2017-09-28 16:59:02 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2017-09-29 18:05:45 +0800 |
commit | 9d8edb46f24517dc5a0dbc0b496caad75cf39ca3 (patch) | |
tree | fc5448a20868ecb4e1dd2b84d3340f7dcf86c2f4 /test/libsolidity | |
parent | b92184688002c73fece4e8beb0beaa897649de4e (diff) | |
download | dexon-solidity-9d8edb46f24517dc5a0dbc0b496caad75cf39ca3.tar.gz dexon-solidity-9d8edb46f24517dc5a0dbc0b496caad75cf39ca3.tar.zst dexon-solidity-9d8edb46f24517dc5a0dbc0b496caad75cf39ca3.zip |
Allow test frameworks to filter out some warnings.
Diffstat (limited to 'test/libsolidity')
-rw-r--r-- | test/libsolidity/AnalysisFramework.cpp | 14 | ||||
-rw-r--r-- | test/libsolidity/AnalysisFramework.h | 3 |
2 files changed, 14 insertions, 3 deletions
diff --git a/test/libsolidity/AnalysisFramework.cpp b/test/libsolidity/AnalysisFramework.cpp index 5f5f6411..67cc027e 100644 --- a/test/libsolidity/AnalysisFramework.cpp +++ b/test/libsolidity/AnalysisFramework.cpp @@ -56,8 +56,18 @@ AnalysisFramework::parseAnalyseAndReturnError( for (auto const& currentError: m_compiler.errors()) { solAssert(currentError->comment(), ""); - if (currentError->comment()->find("This is a pre-release compiler version") == 0) - continue; + if (currentError->type() == Error::Type::Warning) + { + bool ignoreWarning = false; + for (auto const& filter: m_warningsToFilter) + if (currentError->comment()->find(filter) == 0) + { + ignoreWarning = true; + break; + } + if (ignoreWarning) + continue; + } if (_reportWarnings || (currentError->type() != Error::Type::Warning)) { diff --git a/test/libsolidity/AnalysisFramework.h b/test/libsolidity/AnalysisFramework.h index 172ae01b..07e28f2b 100644 --- a/test/libsolidity/AnalysisFramework.h +++ b/test/libsolidity/AnalysisFramework.h @@ -45,7 +45,7 @@ class AnalysisFramework { protected: - std::pair<SourceUnit const*, std::shared_ptr<Error const>> + virtual std::pair<SourceUnit const*, std::shared_ptr<Error const>> parseAnalyseAndReturnError( std::string const& _source, bool _reportWarnings = false, @@ -65,6 +65,7 @@ protected: std::string const& _signature ); + std::vector<std::string> m_warningsToFilter = {"This is a pre-release compiler version"}; dev::solidity::CompilerStack m_compiler; }; |