Skip to content

Add the gtest include dir only to muse_global instead of every module - #268

Open
luapmartin wants to merge 1 commit into
musescore:mainfrom
luapmartin:no-gtest-in-module-includes
Open

Add the gtest include dir only to muse_global instead of every module#268
luapmartin wants to merge 1 commit into
musescore:mainfrom
luapmartin:no-gtest-in-module-includes

Conversation

@luapmartin

@luapmartin luapmartin commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Resolves: audacity/audacity#11897

muse_create_module / declare_module add the googletest include directory to every module unconditionally, so any production TU can include gtest headers — in the Audacity build that was 407 non-test TUs across all modules. The only production code that needs it is logremover.h in muse_global (gtest_prod.h / FRIEND_TEST under MUSE_ENABLE_UNIT_TESTS), so the include dir is now added there, guarded by the same option, and removed from the generic module setup. Test targets are unaffected: gtest.cmake already adds the include dir to test executables.

Verified against the Audacity build: only muse_global and googletest's own targets still see the gtest include dir; full build and 28/28 test suites pass.

  • I signed the CLA
  • The title of the PR describes the problem it addresses.
  • Each commit's message describes its purpose and effects, and references the issue it resolves. If changes are extensive, there is a sequence of easily reviewable commits.
  • The code in the PR follows the coding rules.
  • I understand all aspects of the code I'm contributing and I'm able to explain it if requested.
  • The code compiles and runs on my machine, preferably after each commit individually. I have manually tested and verified that my changes fulfil their intended purpose.
  • No prior attempts to resolve this problem exist, or if they do, I listed them in my PR description and described how I avoided repeating past mistakes.
  • There are no unnecessary changes.
  • I created a unit test or vtest to verify the changes I made (if applicable).

Build configuration

audacity: audacity/audacity/master
audacity platforms: linux_x64
musescore: musescore/MuseScore/main
musescore platforms: linux_x64

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: 31f39dc9-d722-4473-a80e-7fd7a8157f48

📥 Commits

Reviewing files that changed from the base of the PR and between b101b6e and a40d908.

📒 Files selected for processing (3)
  • buildscripts/cmake/DeclareModuleSetup.cmake
  • framework/cmake/MuseCreateModule.cmake
  • framework/global/CMakeLists.txt
💤 Files with no reviewable changes (2)
  • framework/cmake/MuseCreateModule.cmake
  • buildscripts/cmake/DeclareModuleSetup.cmake

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change removes the GoogleTest source include path from muse_create_module. When unit tests are enabled, framework/global/CMakeLists.txt retrieves the GoogleTest source directory and adds its include path privately to muse_global.

Merge Risk: ⚪ Minimal · up to a40d9

The change limits GoogleTest headers to the production target that requires them while leaving test targets unaffected. Full build and test verification passed, and no actionable merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: limiting the GoogleTest include directory to muse_global instead of every module.
Description check ✅ Passed The description includes the issue reference, motivation, implementation details, testing results, and completed checklist. The unchecked unit-test item is reasonably applicable because this build-con…
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Full details: Description check

Explanation

The description includes the issue reference, motivation, implementation details, testing results, and completed checklist. The unchecked unit-test item is reasonably applicable because this build-configuration change was verified through existing tests.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@luapmartin

Copy link
Copy Markdown
Contributor Author

/build

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

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.

Remove the googletest include dir from every muse module

1 participant