Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-1321

Separate unit tests out into separate executables

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Won't Do
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Testing

    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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            rassi J Rassi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: