From 5c44dfbb9e8a3e6876b6d41756f89ce5be1036ae Mon Sep 17 00:00:00 2001 From: Christian Kreibich Date: Thu, 2 Dec 2021 12:57:28 -0800 Subject: [PATCH] Flip unit tests to being enabled by default This flips --enable-cpp-tests to --disable-cpp-tests, enabling unit testing by default. The help output has a minor corresponding tweak as well. --- configure | 9 +++++---- src/Options.cc | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/configure b/configure index 9db0899dc7..ddf4ce1bf1 100755 --- a/configure +++ b/configure @@ -55,7 +55,6 @@ Usage: $0 [OPTION]... [VAR=VALUE]... Optional Features: --enable-coverage compile with code coverage support (implies debugging mode) - --enable-cpp-tests build Zeek's C++ unit tests --enable-debug compile in debugging mode (like --build-type=Debug) --enable-fuzzers build fuzzer targets --enable-jemalloc link against jemalloc @@ -70,6 +69,7 @@ Usage: $0 [OPTION]... [VAR=VALUE]... --disable-broker-tests don't try to build Broker unit tests --disable-btest don't install BTest --disable-btest-pcaps don't install Zeek's BTest input pcaps + --disable-cpp-tests don't build Zeek's C++ unit tests --disable-python don't try to build python bindings for Broker --disable-zeekctl don't install ZeekControl --disable-zkg don't install zkg @@ -163,6 +163,7 @@ append_cache_entry ZEEK_ETC_INSTALL_DIR PATH $prefix/etc append_cache_entry ENABLE_DEBUG BOOL false append_cache_entry ENABLE_PERFTOOLS BOOL false append_cache_entry ENABLE_JEMALLOC BOOL false +append_cache_entry ENABLE_ZEEK_UNIT_TESTS BOOL true append_cache_entry BUILD_SHARED_LIBS BOOL true append_cache_entry INSTALL_AUX_TOOLS BOOL true append_cache_entry INSTALL_BTEST BOOL true @@ -260,9 +261,6 @@ while [ $# -ne 0 ]; do append_cache_entry ENABLE_COVERAGE BOOL true append_cache_entry ENABLE_DEBUG BOOL true ;; - --enable-cpp-tests) - append_cache_entry ENABLE_ZEEK_UNIT_TESTS BOOL true - ;; --enable-debug) append_cache_entry ENABLE_DEBUG BOOL true ;; @@ -307,6 +305,9 @@ while [ $# -ne 0 ]; do --disable-btest-pcaps) append_cache_entry INSTALL_BTEST_PCAPS BOOL false ;; + --disable-cpp-tests) + append_cache_entry ENABLE_ZEEK_UNIT_TESTS BOOL false + ;; --disable-python) append_cache_entry DISABLE_PYTHON_BINDINGS BOOL true ;; diff --git a/src/Options.cc b/src/Options.cc index 2fa98a3b3a..0870acade1 100644 --- a/src/Options.cc +++ b/src/Options.cc @@ -143,8 +143,9 @@ void usage(const char* prog, int code) fprintf(stderr, " --pseudo-realtime[=] | enable pseudo-realtime for performance " "evaluation (default 1)\n"); fprintf(stderr, " -j|--jobs | enable supervisor mode\n"); + fprintf(stderr, " --test | run unit tests ('--test -h' for help, " - "only when compiling with ENABLE_ZEEK_UNIT_TESTS)\n"); + "not available when built without ENABLE_ZEEK_UNIT_TESTS)\n"); fprintf(stderr, " $ZEEKPATH | file search path (%s)\n", util::zeek_path().c_str()); fprintf(stderr, " $ZEEK_PLUGIN_PATH | plugin search path (%s)\n",