TestCmdlineParser: properly reset settings and parser between tests (#5310)

This commit is contained in:
Oliver Stöneberg 2023-08-12 21:43:12 +02:00 committed by GitHub
parent 0901ba9a7e
commit 2b3dec4418
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 624 additions and 638 deletions

View File

@ -91,6 +91,8 @@ bool TestFixture::prepareTest(const char testname[])
mTemplateFormat.clear(); mTemplateFormat.clear();
mTemplateLocation.clear(); mTemplateLocation.clear();
prepareTestInternal();
// Check if tests should be executed // Check if tests should be executed
if (testToRun.empty() || testToRun == testname) { if (testToRun.empty() || testToRun == testname) {
// Tests will be executed - prepare them // Tests will be executed - prepare them

View File

@ -60,6 +60,7 @@ protected:
virtual void run() = 0; virtual void run() = 0;
bool prepareTest(const char testname[]); bool prepareTest(const char testname[]);
virtual void prepareTestInternal() {}
std::string getLocationStr(const char * const filename, const unsigned int linenr) const; std::string getLocationStr(const char * const filename, const unsigned int linenr) const;
bool assert_(const char * const filename, const unsigned int linenr, const bool condition) const; bool assert_(const char * const filename, const unsigned int linenr, const bool condition) const;

File diff suppressed because it is too large Load Diff