Skip to content

[CMake 4/7] Make probability test fixtures safe for grouped linking - #3504

Open
SteveBronder wants to merge 1 commit into
developfrom
cmake-split/04-probability-tests
Open

SteveBronder wants to merge 1 commit into
developfrom
cmake-split/04-probability-tests

Conversation

@SteveBronder

@SteveBronder SteveBronder commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Generated probability sources include fixture headers in multiple translation units. Inline header-defined helpers, distinguish four colliding fixture class names, and move ordinary GoogleTests from fixture headers into their unit-test sources. All 12 moved test blocks retain their original contents.

Part 4 of the CMake migration split from #3463.

Targets cmake-split/03-tbb-isolation (#3503) as the preceding layer of the native stack. The review contains only this layer's prepared patch and its supporting tests.

Tests

  • Reproduced all four fixture-name collisions; renamed fixtures compile together.
  • Verified all 12 relocated test blocks against their original contents.
  • Independent Make Bernoulli CDF test passes.
  • The combined CMake stack passes 324 generated Bernoulli tests.
  • The complete probability matrix remains for CI.

Side Effects

Test fixture names change to avoid collisions, and ordinary tests run once in their unit sources instead of being repeated in generated probability sources.

Release notes

Prepare generated probability fixtures for grouped linking without duplicating ordinary tests.

Checklist

  • Copyright holder: Simons Foundation
  • The complete basic-test and CI matrix is passing
  • C++ idioms and Doxygen documentation have completed review
  • Focused validation is passing as described above; remaining coverage is listed

Related PRs

Native stack: https://github.com/stan-dev/math/stack/3509

WardBrian
WardBrian previously approved these changes Nov 3, 2026
@SteveBronder
SteveBronder enabled stacked auto-merge November 4, 2026 16:15
stacked auto-merge was automatically disabled November 4, 2026 16:44

Auto-merge was disabled for another pull request in the stack

@SteveBronder
SteveBronder removed this pull request from stack #3507 November 4, 2026 16:44
@SteveBronder
SteveBronder added this pull request to stack #3509 November 4, 2026 16:44
@SteveBronder SteveBronder changed the title [CMake 4/6] Make probability test fixtures safe for grouped linking [CMake 4/7] Make probability test fixtures safe for grouped linking Nov 4, 2026
@SteveBronder
SteveBronder force-pushed the cmake-split/04-probability-tests branch from 320f21c to 9bac38c Compare November 5, 2026 14:39
@WardBrian
WardBrian force-pushed the cmake-split/04-probability-tests branch from 9bac38c to f9899e0 Compare November 6, 2026 10:47
Base automatically changed from cmake-split/03-tbb-isolation to develop November 6, 2026 20:06
Inline shared probability-test helpers and distinguish colliding fixture
types. Move ordinary GoogleTests out of generated fixture headers into
unit sources, preserving their assertions and avoiding duplicate tests.
@WardBrian
WardBrian force-pushed the cmake-split/04-probability-tests branch from f9899e0 to 8c2c013 Compare November 6, 2026 20:06

This branch has not been deployed

No deployments
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