-
Notifications
You must be signed in to change notification settings - Fork 5.3k
test: Use test-listener rather than TestBase to assure quiescence after each method. #5833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jmarantz
merged 23 commits into
envoyproxy:master
from
jmarantz:all-tests-use-test-base
Feb 13, 2019
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
724cbd3
Change all TEST(xxx, yyy) to TEST_F(TestBase, xxx_yyy)
jmarantz 64bba6a
Move the 'DISABLED_' prefix back to the beginning of test-names.
jmarantz cd608f9
Taste test on pattern for test that does not change its name.
jmarantz 5c21bad
Merge branch 'master' into all-tests-use-test-base
jmarantz 0de32bd
format
jmarantz 459949a
Merge branch 'master' into all-tests-use-test-base
jmarantz bf666e9
prototype a different way to handle TEST() macros.
jmarantz 35a9e7f
more hacking
jmarantz fe43b26
Merge branch 'master' into all-tests-use-test-base
jmarantz 2470e0e
backout previous hacks.
jmarantz ebc0819
Use Alyssa's pattern for making a class for TEST_F with 'using'. Fix …
jmarantz c2762db
Merge branch 'master' into all-tests-use-test-base
jmarantz 57421dd
Move a base-class definition outside of ASAN ifdefs, as the tests tha…
jmarantz 06df0dd
Add tests for the new TEST macro format-checkers.
jmarantz fd530dc
Format the formatter.
jmarantz d10c34a
Merge branch 'master' into all-tests-use-test-base
jmarantz 7f0f5f8
Merge branch 'master' into all-tests-use-test-base
jmarantz 2ff3458
Merge branch 'master' into all-tests-use-test-base
jmarantz 7bf4886
Merge branch 'master' into all-tests-use-test-base
jmarantz dbe65a2
Merge branch 'master' into all-tests-use-test-base
jmarantz b0cd75c
Merge branch 'master' into all-tests-use-test-base
jmarantz f93bf12
Back out the TEST( -> TEST_F( changes in favor of establishing a gtes…
jmarantz 2e8a6c5
Merge branch 'master' into all-tests-use-test-base
jmarantz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ | |
|
|
||
| namespace Envoy { | ||
|
|
||
| // Provides a common test-base class for all tests in Envoy to use. This offers | ||
| // Provides a test listener to be called after each test method. This offers | ||
| // a place to put hooks we'd like to run on every test. There's currently a | ||
| // check that all test-scoped singletons have been destroyed. A test-scoped | ||
| // singleton might remain at the end of a test if it's transitively referenced | ||
|
|
@@ -17,18 +17,16 @@ namespace Envoy { | |
| // than there were at the start of it. This is likely to fail in a few | ||
| // places when introduced, but we could add known test overrides for this. | ||
| // | ||
| // Note: nothing compute-intensive should be put in this test-class, as it will | ||
| // Note: nothing compute-intensive should be put in this class, as it will | ||
| // be a tax paid by every test method in the codebase. | ||
| class TestBase : public ::testing::Test { | ||
| public: | ||
| static void checkSingletonQuiescensce(); | ||
| ~TestBase() override; | ||
| class TestListener : public ::testing::EmptyTestEventListener { | ||
| void OnTestEnd(const ::testing::TestInfo& test_info) override; | ||
| }; | ||
|
|
||
| // Templatized version of TestBase. See above notes. | ||
| template <class T> class TestBaseWithParam : public ::testing::TestWithParam<T> { | ||
| public: | ||
| ~TestBaseWithParam() { TestBase::checkSingletonQuiescensce(); } | ||
| }; | ||
| // TODO(jmarantz): Before Alyssa found this TestListener hook for me, we had | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Optional: think it's worth removing the check_format checks in this PR, just so folks can create new testing::Test classes while we get around to clean up? |
||
| // merged a PR that added the same functionality via common TestBase classes. | ||
| // These should be removed. | ||
| using TestBase = ::testing::Test; | ||
| template <class T> using TestBaseWithParam = ::testing::TestWithParam<T>; | ||
|
|
||
| } // namespace Envoy | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bonus points if you can think of a more descriptive name - I currently can't :-P