AnalysisFramework: Add filteredErrors()

This commit is contained in:
Kamil Śliwak 2023-08-04 20:38:15 +02:00
parent e62bc30e9e
commit 6f3a379557
3 changed files with 6 additions and 2 deletions

View File

@ -68,7 +68,7 @@ AnalysisFramework::parseAnalyseAndReturnError(
compiler().analyze();
ErrorList errors = filterErrors(compiler().errors(), _reportWarnings);
ErrorList errors = filteredErrors(_reportWarnings);
if (errors.size() > 1 && !_allowMultipleErrors)
BOOST_FAIL("Multiple errors found: " + formatErrors());

View File

@ -68,6 +68,10 @@ protected:
/// filter out the warnings in m_warningsToFilter or all warnings and infos if _includeWarningsAndInfos is false
langutil::ErrorList filterErrors(langutil::ErrorList const& _errorList, bool _includeWarningsAndInfos = true) const;
langutil::ErrorList filteredErrors(bool _includeWarningsAndInfos = true) const
{
return filterErrors(compiler().errors(), _includeWarningsAndInfos);
}
std::vector<std::string> m_warningsToFilter = {"This is a pre-release compiler version"};
std::vector<std::string> m_messagesToCut = {"Source file requires different compiler version (current compiler is"};

View File

@ -116,7 +116,7 @@ void SyntaxTest::parseAndAnalyze()
void SyntaxTest::filterObtainedErrors()
{
for (auto const& currentError: filterErrors(compiler().errors(), true))
for (auto const& currentError: filteredErrors())
{
int locationStart = -1;
int locationEnd = -1;