This is an automated email from the ASF dual-hosted git repository.
masaori335 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 104936ac42 Relocate HostDB tests and benchmark to standard directories
(#13115)
104936ac42 is described below
commit 104936ac425e8cda8ea8bd77ba28010b2e72f6bd
Author: Masaori Koshiba <[email protected]>
AuthorDate: Thu Apr 23 08:02:21 2026 +0900
Relocate HostDB tests and benchmark to standard directories (#13115)
* Move unit tests under unit_tests dir
* Cleanup HostDB unit tests and benchmark
---
src/iocore/hostdb/CMakeLists.txt | 22 ----------------------
src/iocore/hostdb/unit_tests/CMakeLists.txt | 20 ++++++++++++++++++--
.../hostdb/{ => unit_tests}/test_HostFile.cc | 0
.../hostdb/{ => unit_tests}/test_RefCountCache.cc | 0
tools/benchmark/CMakeLists.txt | 12 ++++++++++++
.../hostdb => tools/benchmark}/benchmark_HostDB.cc | 0
6 files changed, 30 insertions(+), 24 deletions(-)
diff --git a/src/iocore/hostdb/CMakeLists.txt b/src/iocore/hostdb/CMakeLists.txt
index 07360c8f2d..3920522bd6 100644
--- a/src/iocore/hostdb/CMakeLists.txt
+++ b/src/iocore/hostdb/CMakeLists.txt
@@ -23,27 +23,5 @@ target_link_libraries(inkhostdb PUBLIC ts::inkdns
ts::inkevent ts::tscore)
clang_tidy_check(inkhostdb)
if(BUILD_TESTING)
- add_executable(benchmark_HostDB benchmark_HostDB.cc)
- target_link_libraries(
- benchmark_HostDB
- PRIVATE ts::tscore
- ts::tsutil
- ts::inkevent
- ts::http
- ts::http_remap
- ts::inkcache
- ts::inkhostdb
- )
-
- add_executable(test_HostFile test_HostFile.cc HostFile.cc HostDBInfo.cc)
- target_link_libraries(test_HostFile PRIVATE ts::tscore ts::tsutil
ts::inkevent configmanager Catch2::Catch2WithMain)
- add_catch2_test(NAME test_hostdb_HostFile COMMAND
$<TARGET_FILE:test_HostFile>)
-
- add_executable(test_RefCountCache test_RefCountCache.cc)
- target_link_libraries(
- test_RefCountCache PRIVATE ts::tscore ts::tsutil ts::inkevent
configmanager Catch2::Catch2WithMain
- )
- add_catch2_test(NAME test_hostdb_RefCountCache COMMAND
$<TARGET_FILE:test_RefCountCache>)
-
add_subdirectory(unit_tests)
endif()
diff --git a/src/iocore/hostdb/unit_tests/CMakeLists.txt
b/src/iocore/hostdb/unit_tests/CMakeLists.txt
index 0354641423..bd38fc884e 100644
--- a/src/iocore/hostdb/unit_tests/CMakeLists.txt
+++ b/src/iocore/hostdb/unit_tests/CMakeLists.txt
@@ -15,8 +15,24 @@
#
######################
+# test_hostdb
add_executable(test_hostdb test_HostDBInfo.cc
"${CMAKE_CURRENT_SOURCE_DIR}/../HostDBInfo.cc")
-
target_link_libraries(test_hostdb PRIVATE Catch2::Catch2WithMain ts::tscore
ts::tsutil ts::inkevent configmanager)
-
add_catch2_test(NAME test_hostdb COMMAND $<TARGET_FILE:test_hostdb>)
+
+# test_HostFile
+add_executable(
+ test_HostFile test_HostFile.cc "${CMAKE_CURRENT_SOURCE_DIR}/../HostFile.cc"
+ "${CMAKE_CURRENT_SOURCE_DIR}/../HostDBInfo.cc"
+)
+target_include_directories(test_HostFile PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/..")
+target_link_libraries(test_HostFile PRIVATE ts::tscore ts::tsutil ts::inkevent
configmanager Catch2::Catch2WithMain)
+add_catch2_test(NAME test_hostdb_HostFile COMMAND $<TARGET_FILE:test_HostFile>)
+
+# test_RefCountCache
+add_executable(test_RefCountCache test_RefCountCache.cc)
+target_include_directories(test_RefCountCache PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/..")
+target_link_libraries(
+ test_RefCountCache PRIVATE ts::tscore ts::tsutil ts::inkevent configmanager
Catch2::Catch2WithMain
+)
+add_catch2_test(NAME test_hostdb_RefCountCache COMMAND
$<TARGET_FILE:test_RefCountCache>)
diff --git a/src/iocore/hostdb/test_HostFile.cc
b/src/iocore/hostdb/unit_tests/test_HostFile.cc
similarity index 100%
rename from src/iocore/hostdb/test_HostFile.cc
rename to src/iocore/hostdb/unit_tests/test_HostFile.cc
diff --git a/src/iocore/hostdb/test_RefCountCache.cc
b/src/iocore/hostdb/unit_tests/test_RefCountCache.cc
similarity index 100%
rename from src/iocore/hostdb/test_RefCountCache.cc
rename to src/iocore/hostdb/unit_tests/test_RefCountCache.cc
diff --git a/tools/benchmark/CMakeLists.txt b/tools/benchmark/CMakeLists.txt
index 6a062bfaad..49f25fad1c 100644
--- a/tools/benchmark/CMakeLists.txt
+++ b/tools/benchmark/CMakeLists.txt
@@ -35,3 +35,15 @@ target_link_libraries(benchmark_SharedMutex PRIVATE
Catch2::Catch2 ts::tscore li
add_executable(benchmark_Random benchmark_Random.cc)
target_link_libraries(benchmark_Random PRIVATE Catch2::Catch2WithMain
ts::tscore)
+
+add_executable(benchmark_HostDB benchmark_HostDB.cc)
+target_link_libraries(
+ benchmark_HostDB
+ PRIVATE ts::tscore
+ ts::tsutil
+ ts::inkevent
+ ts::http
+ ts::http_remap
+ ts::inkcache
+ ts::inkhostdb
+)
diff --git a/src/iocore/hostdb/benchmark_HostDB.cc
b/tools/benchmark/benchmark_HostDB.cc
similarity index 100%
rename from src/iocore/hostdb/benchmark_HostDB.cc
rename to tools/benchmark/benchmark_HostDB.cc