SMTChecker: Keep counterexamples on test expectation update

This commit is contained in:
Martin Blicha 2023-07-24 17:01:12 +02:00
parent 83fe3d4011
commit 2e38798408
2 changed files with 12 additions and 0 deletions

View File

@ -140,6 +140,7 @@ TestCase::TestResult SMTCheckerTest::run(ostream& _stream, string const& _linePr
void SMTCheckerTest::filterObtainedErrors() void SMTCheckerTest::filterObtainedErrors()
{ {
SyntaxTest::filterObtainedErrors(); SyntaxTest::filterObtainedErrors();
m_unfilteredErrorList = m_errorList;
static auto removeCex = [](vector<SyntaxTestError>& errors) { static auto removeCex = [](vector<SyntaxTestError>& errors) {
for (auto& e: errors) for (auto& e: errors)
@ -156,3 +157,10 @@ void SMTCheckerTest::filterObtainedErrors()
removeCex(m_errorList); removeCex(m_errorList);
} }
} }
void SMTCheckerTest::printUpdatedExpectations(ostream &_stream, const string &_linePrefix) const {
if (!m_unfilteredErrorList.empty())
printErrorList(_stream, m_unfilteredErrorList, _linePrefix, false);
else
CommonSyntaxTest::printUpdatedExpectations(_stream, _linePrefix);
}

View File

@ -42,6 +42,8 @@ public:
void filterObtainedErrors() override; void filterObtainedErrors() override;
void printUpdatedExpectations(std::ostream& _stream, std::string const& _linePrefix) const override;
protected: protected:
/* /*
Options that can be set in the test: Options that can be set in the test:
@ -62,6 +64,8 @@ protected:
ModelCheckerSettings m_modelCheckerSettings; ModelCheckerSettings m_modelCheckerSettings;
bool m_ignoreCex = false; bool m_ignoreCex = false;
std::vector<SyntaxTestError> m_unfilteredErrorList;
}; };
} }