Skip to content

CXX-2753 Move test files into test subdirectory #1041

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 19, 2023

Conversation

eramongodb
Copy link
Contributor

@eramongodb eramongodb commented Oct 19, 2023

This PR is a followup to #1037 and the last expected PR related to CXX-2753. Verified by this patch.

As with the prior PRs, this PR does NOT affect binary or source compatibility. It only moves around test files and modifies CMake config and test code accordingly.

Specifically, the bsoncxx catch.hh and to_string.hh headers formerly located under lib/bsoncxx/v_noabi/bsoncxx/test_util is moved into the test subdirectory. These headers are only used by test code and are not required by the bsoncxx library itself. The mongocxx client_helpers component formerly under lib/mongocxx/v_noabi/mongocxx/test_util is moved into the test subdirectory for the same reason. This is also supported by the fact that all code that needed to be updated with test_util -> test are already under the test subdirectories for each project.

To support this relocation, the ${CMAKE_CURRENT_SOURCE_DIR}/../.. directory (which corresponds to <repo-root>/src) is added to the include directories of test targets. This is to allow inclusion of test headers via <bsoncxx/test/...> and <third_party/...>. This was seen as preferable to simply <header.(hpp|hh)> without any prefix. This technically also permits <bsoncxx/include/...>, <bsoncxx/lib/...>, and etc. in test code, but this is not an intended or supported pattern and should be rejected in future code reviews.

@eramongodb eramongodb requested a review from kevinAlbs October 19, 2023 15:26
@eramongodb eramongodb self-assigned this Oct 19, 2023
Copy link
Collaborator

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

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

LGTM. Suggested removal of client_helpers_cpp variable.

@eramongodb eramongodb merged commit 253ba2e into mongodb:master Oct 19, 2023
@eramongodb eramongodb deleted the cxx-2753 branch October 19, 2023 18:30
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