CXX-2753 Move test files into test subdirectory #1041
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
andto_string.hh
headers formerly located underlib/bsoncxx/v_noabi/bsoncxx/test_util
is moved into thetest
subdirectory. These headers are only used by test code and are not required by the bsoncxx library itself. The mongocxxclient_helpers
component formerly underlib/mongocxx/v_noabi/mongocxx/test_util
is moved into thetest
subdirectory for the same reason. This is also supported by the fact that all code that needed to be updated withtest_util -> test
are already under thetest
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.