mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
SyntaxTest: Allow derived test cases to filter out warnings and infos
This commit is contained in:
parent
73b9077ab0
commit
c965d6332c
@ -38,7 +38,13 @@ using namespace solidity::frontend::test;
|
|||||||
using namespace boost::unit_test;
|
using namespace boost::unit_test;
|
||||||
namespace fs = boost::filesystem;
|
namespace fs = boost::filesystem;
|
||||||
|
|
||||||
SyntaxTest::SyntaxTest(string const& _filename, langutil::EVMVersion _evmVersion): CommonSyntaxTest(_filename, _evmVersion)
|
SyntaxTest::SyntaxTest(
|
||||||
|
string const& _filename,
|
||||||
|
langutil::EVMVersion _evmVersion,
|
||||||
|
Error::Severity _minSeverity
|
||||||
|
):
|
||||||
|
CommonSyntaxTest(_filename, _evmVersion),
|
||||||
|
m_minSeverity(_minSeverity)
|
||||||
{
|
{
|
||||||
m_optimiseYul = m_reader.boolSetting("optimize-yul", true);
|
m_optimiseYul = m_reader.boolSetting("optimize-yul", true);
|
||||||
}
|
}
|
||||||
@ -98,6 +104,9 @@ void SyntaxTest::filterObtainedErrors()
|
|||||||
{
|
{
|
||||||
for (auto const& currentError: filteredErrors())
|
for (auto const& currentError: filteredErrors())
|
||||||
{
|
{
|
||||||
|
if (currentError->severity() < m_minSeverity)
|
||||||
|
continue;
|
||||||
|
|
||||||
int locationStart = -1;
|
int locationStart = -1;
|
||||||
int locationEnd = -1;
|
int locationEnd = -1;
|
||||||
string sourceName;
|
string sourceName;
|
||||||
|
@ -41,7 +41,11 @@ public:
|
|||||||
{
|
{
|
||||||
return std::make_unique<SyntaxTest>(_config.filename, _config.evmVersion);
|
return std::make_unique<SyntaxTest>(_config.filename, _config.evmVersion);
|
||||||
}
|
}
|
||||||
SyntaxTest(std::string const& _filename, langutil::EVMVersion _evmVersion);
|
SyntaxTest(
|
||||||
|
std::string const& _filename,
|
||||||
|
langutil::EVMVersion _evmVersion,
|
||||||
|
langutil::Error::Severity _minSeverity = langutil::Error::Severity::Info
|
||||||
|
);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void setupCompiler();
|
virtual void setupCompiler();
|
||||||
@ -49,6 +53,7 @@ protected:
|
|||||||
virtual void filterObtainedErrors();
|
virtual void filterObtainedErrors();
|
||||||
|
|
||||||
bool m_optimiseYul{};
|
bool m_optimiseYul{};
|
||||||
|
langutil::Error::Severity m_minSeverity{};
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user