Skip to content

🐛 Keep GoogleTest discovery artifacts in the build tree - #1954

Merged
burgholzer merged 1 commit into
mainfrom
agent/extract-1912-gtest-discovery
Jul 27, 2026
Merged

🐛 Keep GoogleTest discovery artifacts in the build tree#1954
burgholzer merged 1 commit into
mainfrom
agent/extract-1912-gtest-discovery

Conversation

@burgholzer

@burgholzer burgholzer commented Jul 27, 2026

Copy link
Copy Markdown
Member

🤖 AI text below 🤖

Description

CMake 4.3 writes a cmake_test_discovery_*.json bookkeeping file to the directory passed to gtest_discover_tests(WORKING_DIRECTORY ...). Our test helpers passed source directories there because the same argument also controls the runtime working directory of each discovered test. As a result, configuring and building tests could dirty the source tree.

Run GoogleTest discovery from the current binary directory so the bookkeeping file remains a build artifact. Preserve the existing runtime working directory by setting the discovered tests' WORKING_DIRECTORY property separately. The property name is deferred through a generator expression so CMake's argument parser does not interpret it as a second discovery option.

This is extracted from #1912 because it is independent of the QDMI configuration work.

Validation

  • Configured and built representative targets with CMake 4.3.2.
  • Confirmed that no cmake_test_discovery_*.json files appear outside build/.
  • Confirmed that the ordinary helper still runs a FoMaC test from its source directory.
  • Confirmed that the custom-working-directory helper still runs an IR test from its configured build directory.
  • uvx nox -s lint
  • git diff --check

Checklist

  • The pull request only contains commits that are focused and relevant to this change.
  • I have added appropriate tests that cover the new/changed functionality. (Existing tests exercise both helper variants.)
  • I have updated the documentation to reflect these changes. (No user-facing documentation change is needed.)
  • I have added entries to the changelog for any noteworthy additions, changes, fixes, or removals. (Not user-facing.)
  • I have added migration instructions to the upgrade guide (if needed). (No migration is needed.)
  • The changes follow the project's style guidelines and introduce no new warnings.
  • The changes are fully tested and pass the CI checks. (Local checks pass; CI is pending.)
  • I have reviewed my own code changes.

If PR contains AI-assisted content:

  • Any agent that created, edited, or submitted GitHub content was explicitly authorized for that scope, as required by our AI Usage Guidelines.
  • Every agent-authored or agent-edited public text body begins with the visible disclosure 🤖 *AI text below* 🤖 (titles are exempt).
  • AI-assisted commits include an Assisted-by: [Model Name] via [Tool Name] footer.
  • I confirm that I have personally reviewed and understood all AI-generated content, and accept full responsibility for it.

@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@burgholzer burgholzer added code quality Code quality improvements c++ Anything related to C++ code labels Jul 27, 2026
@burgholzer burgholzer self-assigned this Jul 27, 2026
@burgholzer
burgholzer marked this pull request as ready for review July 27, 2026 17:48
@burgholzer
burgholzer merged commit d14b33f into main Jul 27, 2026
33 checks passed
@burgholzer
burgholzer deleted the agent/extract-1912-gtest-discovery branch July 27, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Anything related to C++ code code quality Code quality improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant