Skip to content

fix(cmake): 🐛 enable_testing() before add_subdirectory(cpp) for root ctest - #224

Merged
robertodr merged 1 commit into
mainfrom
fix/ctest-root-test-discovery
Aug 12, 2026
Merged

fix(cmake): 🐛 enable_testing() before add_subdirectory(cpp) for root ctest#224
robertodr merged 1 commit into
mainfrom
fix/ctest-root-test-discovery

Conversation

@JoshCudbyAlgo

@JoshCudbyAlgo JoshCudbyAlgo commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

enable_testing()/include(CTest) lived in cpp/CMakeLists.txt, called after the root CMakeLists.txt had already run add_subdirectory(cpp). CTest's enabled-ness does not propagate back up to an already-processed parent directory, so the root build tree never got a CTestTestfile.cmake and ctest --test-dir build/editable/Release (the documented entry point) reported "No tests were found!!!" even though the suite itself passed.

Changes

  • Changed when enable_testing and include(CTest) are called

Checklist

  • Tests added or updated to cover the changes
  • Documentation updated (docstrings, docs/, CONTRIBUTING.md) if needed
  • CHANGELOG / release notes updated if applicable

AI/LLM disclosure

  • I did not use LLM tooling, or used it only privately for ideation
  • I used the following tool to help write this PR description: ClaudeCode:claude-sonnet-5
  • I used the following tool to generate or modify code: ClaudeCode:claude-sonnet-5

Important

By opening this PR I confirm that I have read CONTRIBUTING.md and I agree to the terms of the Contributor License Agreement.

Warning

If you're contributing on behalf of your employer, contact cla@algorithmiq.fi to arrange a Corporate CLA.

…ctest

enable_testing()/include(CTest) lived in cpp/CMakeLists.txt, called after
the root CMakeLists.txt had already run add_subdirectory(cpp). CTest's
enabled-ness does not propagate back up to an already-processed parent
directory, so the root build tree never got a CTestTestfile.cmake and
`ctest --test-dir build/editable/Release` (the documented entry point)
reported "No tests were found!!!" even though the suite itself passed.

Assisted-by: ClaudeCode:claude-sonnet-5
@github-actions

Copy link
Copy Markdown

Docs preview: https://pr-224.monoprop-docs.pages.dev

@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.70%. Comparing base (5836a06) to head (3313e60).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #224   +/-   ##
=======================================
  Coverage   97.70%   97.70%           
=======================================
  Files          14       14           
  Lines         742      742           
  Branches       98       98           
=======================================
  Hits          725      725           
  Misses         12       12           
  Partials        5        5           
Flag Coverage Δ
cpp 97.70% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@sonarqubecloud

Copy link
Copy Markdown

@robertodr
robertodr merged commit a997b77 into main Aug 12, 2026
24 checks passed
@robertodr
robertodr deleted the fix/ctest-root-test-discovery branch August 12, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants