diff --git a/CMakeLists.txt b/CMakeLists.txt index 1dafffdbe15..66645c053cb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,6 +37,7 @@ execute_process(COMMAND id -ng OUTPUT_VARIABLE BUILD_GROUP OUTPUT_STRIP_TRAILING execute_process(COMMAND uname -n OUTPUT_VARIABLE BUILD_MACHINE OUTPUT_STRIP_TRAILING_WHITESPACE) # Options +option(BUILD_REGRESSION_TESTING "Build regression tests (default ON)" ON) set(DEFAULT_STACK_SIZE 1048576 CACHE STRING "Default stack size (default 1048576)") option(ENABLE_FAST_SDK "Use fast SDK APIs (default OFF)") option(ENABLE_JEMALLOC "Use jemalloc (default OFF)") @@ -207,6 +208,7 @@ check_symbol_exists(SSL_CTX_set_tlsext_ticket_key_cb openssl/ssl.h HAVE_SSL_CTX_ set(CATCH_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/lib/catch2) include(CTest) +set(TS_HAS_TESTS ${BUILD_REGRESSION_TESTING}) message("Configuring for ${HOST_OS}") diff --git a/include/tscore/ink_config.h.cmake.in b/include/tscore/ink_config.h.cmake.in index cc0446822d1..d3a9a321f66 100644 --- a/include/tscore/ink_config.h.cmake.in +++ b/include/tscore/ink_config.h.cmake.in @@ -115,6 +115,7 @@ const int DEFAULT_STACKSIZE = @DEFAULT_STACK_SIZE@; #cmakedefine01 TS_HAS_IN6_IS_ADDR_UNSPECIFIED #cmakedefine01 TS_HAS_JEMALLOC #cmakedefine01 TS_HAS_TCMALLOC +#cmakedefine01 TS_HAS_TESTS #cmakedefine01 TS_HAS_PROFILER #cmakedefine01 TS_USE_DIAGS #cmakedefine01 TS_USE_EPOLL diff --git a/iocore/cache/CMakeLists.txt b/iocore/cache/CMakeLists.txt index 637bf599afc..20e907834e8 100644 --- a/iocore/cache/CMakeLists.txt +++ b/iocore/cache/CMakeLists.txt @@ -31,6 +31,9 @@ add_library(inkcache STATIC RamCacheLRU.cc Store.cc ) +if(BUILD_REGRESSION_TESTING) + target_sources(inkcache PRIVATE CacheTest.cc) +endif() target_link_libraries(inkcache PRIVATE ZLIB::ZLIB) if(HAVE_LZMA_H) target_link_libraries(inkcache PRIVATE LibLZMA::LibLZMA) diff --git a/iocore/net/CMakeLists.txt b/iocore/net/CMakeLists.txt index f5a97b3a661..d726cc9c3b2 100644 --- a/iocore/net/CMakeLists.txt +++ b/iocore/net/CMakeLists.txt @@ -64,6 +64,9 @@ add_library(inknet STATIC SSLDynlock.cc SNIActionPerformer.cc ) +if(BUILD_REGRESSION_TESTING) + target_sources(inknet PRIVATE NetVCTest.cc) +endif() target_link_libraries(inknet PUBLIC inkevent records_p) target_compile_options(inknet PUBLIC -Wno-deprecated-declarations) target_include_directories(inknet PRIVATE diff --git a/proxy/CMakeLists.txt b/proxy/CMakeLists.txt index 62083e5ee17..eb95e797231 100644 --- a/proxy/CMakeLists.txt +++ b/proxy/CMakeLists.txt @@ -35,7 +35,9 @@ add_library(proxy STATIC StatPages.cc Transform.cc ) - +if(BUILD_REGRESSION_TESTING) + target_sources(proxy PRIVATE RegressionSM.cc) +endif() set(PROXY_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/proxy ${CMAKE_SOURCE_DIR}/proxy/http diff --git a/proxy/http/CMakeLists.txt b/proxy/http/CMakeLists.txt index 9605c21bbdf..35d20aed8fb 100644 --- a/proxy/http/CMakeLists.txt +++ b/proxy/http/CMakeLists.txt @@ -40,6 +40,10 @@ add_library(http STATIC PreWarmConfig.cc PreWarmManager.cc ) +if(BUILD_REGRESSION_TESTING) + target_sources(http PRIVATE RegressionHttpTransact.cc) +endif() + target_include_directories(http PRIVATE ${IOCORE_INCLUDE_DIRS} ${PROXY_INCLUDE_DIRS} @@ -47,4 +51,4 @@ target_include_directories(http PRIVATE ${CMAKE_SOURCE_DIR}/mgmt/utils ${YAMLCPP_INCLUDE_DIR} ) -add_subdirectory(remap) \ No newline at end of file +add_subdirectory(remap)