mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Allow test frameworks to filter out some warnings.
This commit is contained in:
parent
b921846880
commit
9d8edb46f2
@ -56,8 +56,18 @@ AnalysisFramework::parseAnalyseAndReturnError(
|
|||||||
for (auto const& currentError: m_compiler.errors())
|
for (auto const& currentError: m_compiler.errors())
|
||||||
{
|
{
|
||||||
solAssert(currentError->comment(), "");
|
solAssert(currentError->comment(), "");
|
||||||
if (currentError->comment()->find("This is a pre-release compiler version") == 0)
|
if (currentError->type() == Error::Type::Warning)
|
||||||
continue;
|
{
|
||||||
|
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))
|
if (_reportWarnings || (currentError->type() != Error::Type::Warning))
|
||||||
{
|
{
|
||||||
|
@ -45,7 +45,7 @@ class AnalysisFramework
|
|||||||
{
|
{
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::pair<SourceUnit const*, std::shared_ptr<Error const>>
|
virtual std::pair<SourceUnit const*, std::shared_ptr<Error const>>
|
||||||
parseAnalyseAndReturnError(
|
parseAnalyseAndReturnError(
|
||||||
std::string const& _source,
|
std::string const& _source,
|
||||||
bool _reportWarnings = false,
|
bool _reportWarnings = false,
|
||||||
@ -65,6 +65,7 @@ protected:
|
|||||||
std::string const& _signature
|
std::string const& _signature
|
||||||
);
|
);
|
||||||
|
|
||||||
|
std::vector<std::string> m_warningsToFilter = {"This is a pre-release compiler version"};
|
||||||
dev::solidity::CompilerStack m_compiler;
|
dev::solidity::CompilerStack m_compiler;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user