Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

add tests to CTest configuration#301

Open
gkoulin wants to merge 1 commit into
nmwsharp:master from
gkoulin:gk/ctest
Open

add tests to CTest configuration #301
gkoulin wants to merge 1 commit into
nmwsharp:master from
gkoulin:gk/ctest

Conversation

@gkoulin

@gkoulin gkoulin commented Oct 1, 2024

Copy link
Copy Markdown
Contributor

No description provided.

nmwsharp commented Apr 2, 2025

Copy link
Copy Markdown
Owner

Hi! Thanks for submitting this. What is the SPLIT_TESTS variable? Is that some standard CMake thing?

gkoulin commented Apr 29, 2025

Copy link
Copy Markdown
Contributor Author

Hi,

GTest provides a macro gtest_discover_tests which creates individual CTest per GTest test (declared by TEST C++ macro) embedded into a test binary. This can be useful when running tests locally to more easily inspect granular results, especially integrating with UI. When developing I found it useful to split tests up in this way.

However, there is a downside. When running all tests, this approach is slower, since each test executes the test binary with the filter to select just a single test. Therefore, it is not really appropriate for CI, where the goal is to run all tests as quickly as possible.

Hence, I introduced SPLIT_TESTS variable to handle both of these cases. Perhaps it should be an option with a help message.

I found this useful locally, so thought I would share it. Feel free to discard this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /