[CXX-1321] Separate unit tests out into separate executables Created: 15/Apr/17  Updated: 18/Jan/23  Resolved: 18/Jan/23

Status: Closed
Project: C++ Driver
Component/s: Testing
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: J Rassi Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: bgtrack
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CXX-1078 Divide mongocxx tests into unit, mock... Closed

 Description   

Currently, all bsoncxx tests link against the entire public bsoncxx library. The same applies for mongocxx tests.

Instead, we should consider separating out our unit tests from our integration tests, and create separate executables for each class being unit tested. A few pros/cons:

  • Pro: we'll have a cleaner way to test non-public functionality when we allow building/testing without static libraries (we currently always build the static library, but this won't be the case when CXX-1257 is resolved).
  • Pro: this will encourage maintainers to keep a clean internal dependency tree, since each unit-testable component of both libraries will need to have their dependencies explicitly listed.
  • Con: clean builds will take longer, due to additional time spent linking the newly-added executables (possibly additional time re-compiling unit test dependencies, depending on how we implement unit test dependencies in CMake).

In order to do achieve this, we will need to create a new target with common dependencies (e.g. our polyfill libraries) that unit tests can depend on.



 Comments   
Comment by Rishabh Bisht [ 18/Jan/23 ]

After careful evaluation, we have decided to close this ticket. Please add a comment if the impact of this ticket increases.
Thanks.

Generated at Wed Feb 07 22:02:11 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.