Skip to content

Commit 104936a

Browse files
authored
Relocate HostDB tests and benchmark to standard directories (#13115)
* Move unit tests under unit_tests dir * Cleanup HostDB unit tests and benchmark
1 parent 02af451 commit 104936a

6 files changed

Lines changed: 30 additions & 24 deletions

File tree

src/iocore/hostdb/CMakeLists.txt

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,5 @@ target_link_libraries(inkhostdb PUBLIC ts::inkdns ts::inkevent ts::tscore)
2323
clang_tidy_check(inkhostdb)
2424

2525
if(BUILD_TESTING)
26-
add_executable(benchmark_HostDB benchmark_HostDB.cc)
27-
target_link_libraries(
28-
benchmark_HostDB
29-
PRIVATE ts::tscore
30-
ts::tsutil
31-
ts::inkevent
32-
ts::http
33-
ts::http_remap
34-
ts::inkcache
35-
ts::inkhostdb
36-
)
37-
38-
add_executable(test_HostFile test_HostFile.cc HostFile.cc HostDBInfo.cc)
39-
target_link_libraries(test_HostFile PRIVATE ts::tscore ts::tsutil ts::inkevent configmanager Catch2::Catch2WithMain)
40-
add_catch2_test(NAME test_hostdb_HostFile COMMAND $<TARGET_FILE:test_HostFile>)
41-
42-
add_executable(test_RefCountCache test_RefCountCache.cc)
43-
target_link_libraries(
44-
test_RefCountCache PRIVATE ts::tscore ts::tsutil ts::inkevent configmanager Catch2::Catch2WithMain
45-
)
46-
add_catch2_test(NAME test_hostdb_RefCountCache COMMAND $<TARGET_FILE:test_RefCountCache>)
47-
4826
add_subdirectory(unit_tests)
4927
endif()

src/iocore/hostdb/unit_tests/CMakeLists.txt

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,24 @@
1515
#
1616
######################
1717

18+
# test_hostdb
1819
add_executable(test_hostdb test_HostDBInfo.cc "${CMAKE_CURRENT_SOURCE_DIR}/../HostDBInfo.cc")
19-
2020
target_link_libraries(test_hostdb PRIVATE Catch2::Catch2WithMain ts::tscore ts::tsutil ts::inkevent configmanager)
21-
2221
add_catch2_test(NAME test_hostdb COMMAND $<TARGET_FILE:test_hostdb>)
22+
23+
# test_HostFile
24+
add_executable(
25+
test_HostFile test_HostFile.cc "${CMAKE_CURRENT_SOURCE_DIR}/../HostFile.cc"
26+
"${CMAKE_CURRENT_SOURCE_DIR}/../HostDBInfo.cc"
27+
)
28+
target_include_directories(test_HostFile PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/..")
29+
target_link_libraries(test_HostFile PRIVATE ts::tscore ts::tsutil ts::inkevent configmanager Catch2::Catch2WithMain)
30+
add_catch2_test(NAME test_hostdb_HostFile COMMAND $<TARGET_FILE:test_HostFile>)
31+
32+
# test_RefCountCache
33+
add_executable(test_RefCountCache test_RefCountCache.cc)
34+
target_include_directories(test_RefCountCache PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/..")
35+
target_link_libraries(
36+
test_RefCountCache PRIVATE ts::tscore ts::tsutil ts::inkevent configmanager Catch2::Catch2WithMain
37+
)
38+
add_catch2_test(NAME test_hostdb_RefCountCache COMMAND $<TARGET_FILE:test_RefCountCache>)
File renamed without changes.
File renamed without changes.

tools/benchmark/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,15 @@ target_link_libraries(benchmark_SharedMutex PRIVATE Catch2::Catch2 ts::tscore li
3535

3636
add_executable(benchmark_Random benchmark_Random.cc)
3737
target_link_libraries(benchmark_Random PRIVATE Catch2::Catch2WithMain ts::tscore)
38+
39+
add_executable(benchmark_HostDB benchmark_HostDB.cc)
40+
target_link_libraries(
41+
benchmark_HostDB
42+
PRIVATE ts::tscore
43+
ts::tsutil
44+
ts::inkevent
45+
ts::http
46+
ts::http_remap
47+
ts::inkcache
48+
ts::inkhostdb
49+
)

0 commit comments

Comments
 (0)