morganstanley / binlog

A high performance C++ log library, producing structured binary logs
http://opensource.morganstanley.com/binlog/
Apache License 2.0
608 stars 72 forks source link

Disable UnitTest and IntegrationTest #160

Closed andrewkcorcoran closed 1 year ago

andrewkcorcoran commented 1 year ago

Currently if binlog is integrated into a project using FetchContent or add_subdirectory the binlog tests are unconditionally built and also added as CMake unit tests. As a result projects using binlog are forced to always run the binlog tests as part of their unit test runs. We should either automatically disable building and adding of tests to CMake when we detect binlog is being included as a dependent project (using the already existing $BINLOG_IS_TOPLEVEL_PROJECT) or add a CMake option to allow for manually disabling of tests.

erenon commented 1 year ago

What about using EXCLUDE_FROM_ALL with add_subdirectory? https://cmake.org/cmake/help/latest/command/add_subdirectory.html

andrewkcorcoran commented 1 year ago

That might workt for add_subdirectory but I don't believe it's supported by FetchContent. Additionally it would result in bread and brecovery no longer being built - which is not ideal as the user most probably wants those available.

andrewkcorcoran commented 1 year ago

@erenon see https://github.com/morganstanley/binlog/pull/151 may solve this issue.