Skip to content

[beman-tidy] Implement cmake.skip_tests - #346

Merged
neatudarius merged 1 commit into
bemanproject:mainfrom
neatudarius:implement/issue-73-cmake-skip-tests
Jul 26, 2026
Merged

neatudarius merged 1 commit into
bemanproject:mainfrom
neatudarius:implement/issue-73-cmake-skip-tests

Conversation

@neatudarius

@neatudarius neatudarius commented Jul 15, 2026 •

Copy link
Copy Markdown
Member

Implements #73

Local tested - it already runs and passes for 20/22 libraries in org. Check linked PRs for fixing remaining libraries.
This PR will be merged when all Beman library are green or their .beman-tidy.yml config disables this check.

@neatudarius
neatudarius force-pushed the implement/issue-73-cmake-skip-tests branch 3 times, most recently from 5917911 to 4709e8f Compare July 15, 2026 23:58
@neatudarius
neatudarius requested a review from Copilot July 16, 2026 00:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for the Beman Standard check cmake.skip_tests, intended to ensure a project’s root CMakeLists.txt defines BEMAN_<short_name>_BUILD_TESTS (defaulting to ${PROJECT_IS_TOP_LEVEL}) and guards add_subdirectory(tests...) behind if(BEMAN_<short_name>_BUILD_TESTS).

Changes:

  • Introduces CMakeSkipTestsCheck registered as cmake.skip_tests.
  • Adds pytest coverage for valid/invalid cmake.skip_tests cases.
  • Adds new invalid CMakeLists fixtures for missing option, wrong default, and missing guard.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
beman_tidy/lib/checks/beman_standard/cmake.py Adds the new cmake.skip_tests check implementation.
tests/lib/checks/beman_standard/cmake/test_cmake.py Adds tests for cmake.skip_tests (check-only; fix test is skipped).
tests/lib/checks/beman_standard/cmake/data/invalid/invalid-skip_tests-v1.txt Invalid fixture: missing the required BEMAN_<short_name>_BUILD_TESTS option.
tests/lib/checks/beman_standard/cmake/data/invalid/invalid-skip_tests-v2.txt Invalid fixture: option default is ON instead of ${PROJECT_IS_TOP_LEVEL}.
tests/lib/checks/beman_standard/cmake/data/invalid/invalid-skip_tests-v3.txt Invalid fixture: tests are not guarded by if(BEMAN_<short_name>_BUILD_TESTS).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@neatudarius
neatudarius force-pushed the implement/issue-73-cmake-skip-tests branch 5 times, most recently from 25243d8 to e0667c9 Compare July 16, 2026 00:30
@neatudarius
neatudarius force-pushed the implement/issue-73-cmake-skip-tests branch 5 times, most recently from b1d78b4 to 04b258f Compare July 16, 2026 06:56
@neatudarius
neatudarius force-pushed the implement/issue-73-cmake-skip-tests branch from 04b258f to 9407ad0 Compare July 16, 2026 06:58
Use shared cmake utils for unguarded add_subdirectory detection.
@neatudarius
neatudarius force-pushed the implement/issue-73-cmake-skip-tests branch from 9407ad0 to aa09345 Compare July 16, 2026 07:12
@neatudarius
neatudarius marked this pull request as ready for review July 16, 2026 07:29
@neatudarius
neatudarius merged commit aa09345 into bemanproject:main Jul 26, 2026
10 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