You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bn...@apache.org on 2023/06/16 18:54:41 UTC

[trafficserver] branch master updated: Add option to build regression tests (#9863)

This is an automated email from the ASF dual-hosted git repository.

bneradt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 0ed53e74ef Add option to build regression tests (#9863)
0ed53e74ef is described below

commit 0ed53e74ef0bba60c9efe18f63ce7b6d9e74602e
Author: JosiahWI <41...@users.noreply.github.com>
AuthorDate: Fri Jun 16 13:54:35 2023 -0500

    Add option to build regression tests (#9863)
    
    This adds a new option that defaults to ON: BUILD_REGRESSION_TESTING.
    Because the regression tests are part of the traffic_server binary,
    this is independent from the BUILD_TESTING option added by CTest,
    which builds separate test binaries.
---
 CMakeLists.txt                       | 2 ++
 include/tscore/ink_config.h.cmake.in | 1 +
 iocore/cache/CMakeLists.txt          | 3 +++
 iocore/net/CMakeLists.txt            | 3 +++
 proxy/CMakeLists.txt                 | 4 +++-
 proxy/http/CMakeLists.txt            | 6 +++++-
 6 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9f5d387b58..4040d781a1 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)")
@@ -208,6 +209,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 963e5aae60..472367b73a 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_HAS_SO_MARK
 #cmakedefine01 TS_HAS_SO_PEERCRED
diff --git a/iocore/cache/CMakeLists.txt b/iocore/cache/CMakeLists.txt
index 637bf599af..20e907834e 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 f5a97b3a66..d726cc9c3b 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 62083e5ee1..eb95e79723 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 9605c21bbd..35d20aed8f 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)