test: define individual unit tests for CTEST#1244
Merged
Merged
Conversation
Collaborator
|
I have no clue why the test setup was so weirdly defined in CMake. I do not interface with CTest often, but this is undoubtedly an improvement for anyone using integrated test discovery. |
Collaborator
|
Hi @vaind, do you still want to add or fix something here? |
Contributor
Author
I just forgot to mark this as ready |
vaind
marked this pull request as ready for review
June 16, 2025 09:47
supervacuus
approved these changes
Jun 16, 2025
BernhardMarconato
pushed a commit
to elgatosf/sentry-native
that referenced
this pull request
Apr 21, 2026
* test: define individual unit tests for CTEST * chore: add SENTRY_CTEST_INDIVIDUAL option * rename the aggregate test target to "unit-tests"
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
During development, I'm used to running individual unit tests via Test Explorer in VS Code.
However, this has not been possible for sentry-native because of its use of add_test().
This PR changes the behavior - instead of adding a single
sentry_test_unitto CTEST, we add individual unit tests by reading the existingtests.incfile.I've also noticed that the
sentry_fuzz_jsonandsentry_examplehave been added to CTEST but they're actually not test executables, so removing those.Note: this does not influence anyone launching executable directly (what we also do in CI in this repo), only
ctestcommand users , such as IDE integrations. Maybe worth adding a changelog item anyway if some SDK consumer launched ctest with the target filtersentry_test_unit.Before


and after: