Skip to content
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

Verify RegisterProfilerManager doesn't overwrite an existing registration #1837

Merged
merged 4 commits into from
Oct 24, 2024

Conversation

xdje42
Copy link
Contributor

@xdje42 xdje42 commented Aug 8, 2024

Tested:
Configure with:
cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DBENCHMARK_DOWNLOAD_DEPENDENCIES=on
Then run:
ctest -R profiler_manager_gtest
Before change test fails (expected), after change test passes (expected)

…tion

Tested:
Add a second registration to test/profiler_manager_test.cc and
verify the test crashes as expected.
@xdje42 xdje42 marked this pull request as ready for review August 8, 2024 21:46
@dmah42
Copy link
Member

dmah42 commented Aug 9, 2024

i don't see the test in the PR

@xdje42
Copy link
Contributor Author

xdje42 commented Aug 9, 2024

Yeah, I wasn't sure how to write a crash test. Is there an existing example?

@dmah42
Copy link
Member

dmah42 commented Aug 12, 2024

it would be a standard googletest death test (https://github.com/google/googletest/blob/main/docs/advanced.md#death-tests) .. the test file must end with _gtest.cc so we run it against googletest correctly. but bear in mind we only assert-fatal in debug, not release.

@dmah42
Copy link
Member

dmah42 commented Oct 23, 2024

did you manage to figure out the death test?

xdje42 and others added 2 commits October 23, 2024 12:29
…tion

Tested:
Configure with:
cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DBENCHMARK_DOWNLOAD_DEPENDENCIES=on
Then run:
ctest -R profiler_manager_gtest
Before change test fails (expected), after change test passes (expected)
@xdje42 xdje42 force-pushed the i1807-dont-clobber-existing-manager branch from 8ded36c to 227bca2 Compare October 23, 2024 19:46
@xdje42
Copy link
Contributor Author

xdje42 commented Oct 23, 2024

Oops. I was away during August, and this got dropped to the bottom of my queue.
Death test added.

@dmah42 dmah42 merged commit ffc727a into google:main Oct 24, 2024
80 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants