Skip to content

test: define individual unit tests for CTEST#1244

Merged
supervacuus merged 3 commits into
masterfrom
chore/ctest-individual-declarations
Jun 16, 2025
Merged

test: define individual unit tests for CTEST#1244
supervacuus merged 3 commits into
masterfrom
chore/ctest-individual-declarations

Conversation

@vaind

@vaind vaind commented May 14, 2025

Copy link
Copy Markdown
Contributor

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_unit to CTEST, we add individual unit tests by reading the existing tests.inc file.

I've also noticed that the sentry_fuzz_json and sentry_example have 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 ctest command users , such as IDE integrations. Maybe worth adding a changelog item anyway if some SDK consumer launched ctest with the target filter sentry_test_unit.

Before
before
and after:
after

@supervacuus

Copy link
Copy Markdown
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.

@supervacuus

Copy link
Copy Markdown
Collaborator

Hi @vaind, do you still want to add or fix something here?

@vaind

vaind commented Jun 16, 2025

Copy link
Copy Markdown
Contributor Author

Hi @vaind, do you still want to add or fix something here?

I just forgot to mark this as ready

@vaind
vaind marked this pull request as ready for review June 16, 2025 09:47
@supervacuus
supervacuus merged commit 931c468 into master Jun 16, 2025
3 checks passed
@supervacuus
supervacuus deleted the chore/ctest-individual-declarations branch June 16, 2025 10:19
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"
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