Merge remote-tracking branch 'origin/topic/awelzel/3090-propagate-doctest-defines'

* origin/topic/awelzel/3090-propagate-doctest-defines:
  Options: Do not output full usage on --test error
  CMakeLists: Propagate DOCTEST defines to external plugins

(cherry picked from commit 2fddddbf51)
This commit is contained in:
Arne Welzel 2023-06-15 18:35:32 +02:00 committed by Tim Wojtulewicz
parent 413610b5c0
commit 8ee9b3c9e4
2 changed files with 3 additions and 1 deletions

View file

@ -410,8 +410,10 @@ endif ()
if (ENABLE_ZEEK_UNIT_TESTS) if (ENABLE_ZEEK_UNIT_TESTS)
enable_testing() enable_testing()
add_definitions(-DDOCTEST_CONFIG_SUPER_FAST_ASSERTS) add_definitions(-DDOCTEST_CONFIG_SUPER_FAST_ASSERTS)
target_compile_definitions(zeek_dynamic_plugin_base INTERFACE DOCTEST_CONFIG_SUPER_FAST_ASSERTS)
else () else ()
add_definitions(-DDOCTEST_CONFIG_DISABLE) add_definitions(-DDOCTEST_CONFIG_DISABLE)
target_compile_definitions(zeek_dynamic_plugin_base INTERFACE DOCTEST_CONFIG_DISABLE)
endif () endif ()
if (ENABLE_CCACHE) if (ENABLE_CCACHE)

View file

@ -301,7 +301,7 @@ Options parse_cmdline(int argc, char** argv)
fprintf(stderr, "ERROR: C++ unit tests are disabled for this build.\n" fprintf(stderr, "ERROR: C++ unit tests are disabled for this build.\n"
" Please re-compile with ENABLE_ZEEK_UNIT_TESTS " " Please re-compile with ENABLE_ZEEK_UNIT_TESTS "
"to run the C++ unit tests.\n"); "to run the C++ unit tests.\n");
usage(argv[0], 1); exit(1);
#endif #endif
auto is_separator = [](const char* cstr) auto is_separator = [](const char* cstr)