Skip to content

Commit e54b23e

Browse files
committed
Add tests for util/datetime into listfile (#155)
1 parent d47c399 commit e54b23e

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

util/CMakeLists.txt

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,43 @@
11
add_subdirectory(charset)
22
add_subdirectory(draft)
33

4+
function(add_ydb_util_tests)
5+
set(opts "")
6+
set(oneval_args FOLDER)
7+
set(multival_args TESTS LINK_LIBRARIES)
8+
cmake_parse_arguments(ARGS
9+
"${opts}"
10+
"${oneval_args}"
11+
"${multival_args}"
12+
${ARGN}
13+
)
14+
list(PREPEND ARGS_LINK_LIBRARIES
15+
yutil
16+
cpp-testing-unittest_main
17+
)
18+
foreach (__test_name_suffix IN LISTS ARGS_TESTS)
19+
add_ydb_test(NAME "util-${ARGS_FOLDER}-${__test_name_suffix}"
20+
SOURCES
21+
"${ARGS_FOLDER}/${__test_name_suffix}.cpp"
22+
LINK_LIBRARIES
23+
${ARGS_LINK_LIBRARIES}
24+
LABELS
25+
unit
26+
)
27+
endforeach()
28+
endfunction()
29+
430
if (YDB_SDK_TESTS)
31+
add_ydb_util_tests(FOLDER datetime
32+
TESTS
33+
base_ut
34+
cputimer_ut
35+
parser_deprecated_ut
36+
parser_ut
37+
process_uptime_ut
38+
uptime_ut
39+
)
40+
541
add_ydb_test(NAME util-digest-ut
642
SOURCES
743
digest/city_ut.cpp
@@ -70,6 +106,7 @@ target_joined_source(yutil
70106
${YDB_SDK_SOURCE_DIR}/util/datetime/base.cpp
71107
${YDB_SDK_SOURCE_DIR}/util/datetime/constants.cpp
72108
${YDB_SDK_SOURCE_DIR}/util/datetime/cputimer.cpp
109+
${YDB_SDK_SOURCE_DIR}/util/datetime/process_uptime.cpp
73110
${YDB_SDK_SOURCE_DIR}/util/datetime/systime.cpp
74111
${YDB_SDK_SOURCE_DIR}/util/datetime/uptime.cpp
75112
)

0 commit comments

Comments
 (0)