Skip to content

Conversation

@mabruzzo
Copy link
Collaborator

@mabruzzo mabruzzo commented Dec 18, 2025

This PR should be reviewed after #471 has been merged


This has been on my todo list for quite a while.

This PR primarily makes 3 interrelated changes pertaining to the grtest machinery1:

  1. renames the grtest machinery its now called grtestutils
  2. moves the grtest machinery out of tests/unit into test/grtestutils
  3. lightly refactors the CMake logic (and add additional explanatory comments) so that instead of linking against each test file against either grtestutils or testdeps, we now link them all against testdeps

This PR also:

  • addresses a TODO item from grtestutils/cmd.cpp (it reduces code duplication)
  • explicitly links all test-code against the gmock library. While this doesn't have an immediate payoff, it will be a benefit for PR [newchem-cpp] cleanup test_status_reporting.cpp #472 and another PR. To be clear: THIS DOES NOT INTRODUCE ANY DEPENDENCIES2

Footnotes

  1. Recall: the grtest machinery defines logic used to help implement unit tests.

  2. For added context, the gmock library is a component of googletest that is already being compiled as part of googletest. In other words, gmock was already an implicit dependency. By making it an explicit dependency, our test-code can access additional "matcher" functionality. (This functionality is most useful for testing strings and "containers")

@mabruzzo mabruzzo force-pushed the ncc/factor-out-grtest branch from 8f8cd0a to 8cae777 Compare December 19, 2025 13:30
For context, the gmock library is a component of googletest (it's
already being installed). All this commit does is make it possible for
us to use it in subsequent PRs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-system Related to the build-system testing test suite, regression tests, ci infrastructure

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant