TheLartians / ModernCppStarter

🚀 Kick-start your C++! A template for modern C++ projects using CMake, CI, code coverage, clang-format, reproducible dependency management and much more.

Home Page:https://thelartians.github.io/ModernCppStarter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cxxopts tests are leaked in the all project

TheLartians opened this issue · comments

Introduced by using the new shorthand syntax which excludes inner targets. However, this doesn't prevent cxxopts from adding its tests the main tests target. We should therefore add the flag to disable tests again.

Originally posted by @ClausKlein in #88 (comment)

IMHO we have to prevent the extern project do run their tests at all

bash-3.2$ ninja options_test 
[0/2] Re-checking globbed directories...
[3/3] Linking CXX executable _deps/cxxopts-build/test/options_test
bash-3.2$ 
bash-3.2$ ctest
Test project /Users/clausklein/Workspace/cpp/ModernCppStarter/build/all
    Start 1: options
1/4 Test #1: options ..........................   Passed    0.01 sec
    Start 2: find-package-test
2/4 Test #2: find-package-test ................   Passed    3.01 sec
    Start 3: add-subdirectory-test
3/4 Test #3: add-subdirectory-test ............   Passed    3.03 sec
    Start 4: greeterTests
4/4 Test #4: greeterTests .....................   Passed    0.01 sec

100% tests passed, 0 tests failed out of 4

Total Test time (real) =   6.05 sec

it is caused by CXXOPTS_BUILD_TESTS

Fixed by #91