Skip to content

Commit 1eee66e

Browse files
committed
Remove 'add_ydb_multiple_tests' command
1 parent 0dba8f4 commit 1eee66e

File tree

2 files changed

+29
-75
lines changed

2 files changed

+29
-75
lines changed

cmake/testing.cmake

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -150,40 +150,3 @@ function(add_ydb_test)
150150

151151
vcs_info(${YDB_TEST_NAME})
152152
endfunction()
153-
154-
# This wrapper over `add_ydb_test` adds a separate test for each test file in
155-
# FILES list. Mandatory PREFIX will prepend the test name.
156-
function(add_ydb_multiple_tests)
157-
set(opts GTEST)
158-
set(oneval_args PREFIX)
159-
set(multival_args FILES INCLUDE_DIRS LINK_LIBRARIES LABELS)
160-
cmake_parse_arguments(ARGS
161-
"${opts}"
162-
"${oneval_args}"
163-
"${multival_args}"
164-
${ARGN}
165-
)
166-
167-
if (NOT ARGS_PREFIX)
168-
message(FATAL_ERROR "Missing the PREFIX parameter.")
169-
endif()
170-
171-
if (NOT ARGS_FILES)
172-
message(FATAL_ERROR "Missing the FILES list.")
173-
endif()
174-
175-
if (ARGS_GTEST)
176-
set(ARGS_GTEST "GTEST")
177-
endif()
178-
179-
foreach (testPath IN LISTS ARGS_FILES)
180-
get_filename_component(testSuffix "${testPath}" NAME_WLE)
181-
add_ydb_test(NAME "${ARGS_PREFIX}-${testSuffix}" ${ARGS_GTEST}
182-
SOURCES
183-
"${testPath}"
184-
INCLUDE_DIRS ${ARGS_INCLUDE_DIRS}
185-
LINK_LIBRARIES ${ARGS_LINK_LIBRARIES}
186-
LABELS ${ARGS_LABELS}
187-
)
188-
endforeach()
189-
endfunction()

util/CMakeLists.txt

Lines changed: 29 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ add_subdirectory(charset)
22
add_subdirectory(draft)
33

44
if (YDB_SDK_TESTS)
5-
add_ydb_multiple_tests(PREFIX util-datetime
6-
FILES
5+
add_ydb_test(NAME util-datetime-ut
6+
SOURCES
77
datetime/base_ut.cpp
88
datetime/cputimer_ut.cpp
99
datetime/parser_deprecated_ut.cpp
@@ -17,8 +17,8 @@ if (YDB_SDK_TESTS)
1717
unit
1818
)
1919

20-
add_ydb_multiple_tests(PREFIX util-digest
21-
FILES
20+
add_ydb_test(NAME util-digest-ut
21+
SOURCES
2222
digest/city_ut.cpp
2323
digest/fnv_ut.cpp
2424
digest/multi_ut.cpp
@@ -31,8 +31,8 @@ if (YDB_SDK_TESTS)
3131
unit
3232
)
3333

34-
add_ydb_multiple_tests(PREFIX util-folder
35-
FILES
34+
add_ydb_test(NAME util-folder-ut
35+
SOURCES
3636
folder/dirut_ut.cpp
3737
folder/filelist_ut.cpp
3838
folder/fts_ut.cpp
@@ -47,8 +47,8 @@ if (YDB_SDK_TESTS)
4747
unit
4848
)
4949

50-
add_ydb_multiple_tests(PREFIX util-generic
51-
FILES
50+
add_ydb_test(NAME util-generic-ut
51+
SOURCES
5252
generic/adaptor_ut.cpp
5353
generic/algorithm_ut.cpp
5454
generic/array_ref_ut.cpp
@@ -123,8 +123,8 @@ if (YDB_SDK_TESTS)
123123
)
124124
endif()
125125

126-
add_ydb_multiple_tests(PREFIX util-memory
127-
FILES
126+
add_ydb_test(NAME util-memory-ut
127+
SOURCES
128128
memory/addstorage_ut.cpp
129129
memory/blob_ut.cpp
130130
memory/pool_ut.cpp
@@ -137,8 +137,8 @@ if (YDB_SDK_TESTS)
137137
unit
138138
)
139139

140-
add_ydb_multiple_tests(PREFIX util-network
141-
FILES
140+
add_ydb_test(NAME util-network-ut
141+
SOURCES
142142
network/address_ut.cpp
143143
network/endpoint_ut.cpp
144144
network/ip_ut.cpp
@@ -153,8 +153,8 @@ if (YDB_SDK_TESTS)
153153
unit
154154
)
155155

156-
add_ydb_multiple_tests(PREFIX util-random
157-
FILES
156+
add_ydb_test(NAME util-random-ut
157+
SOURCES
158158
random/common_ops_ut.cpp
159159
random/easy_ut.cpp
160160
random/entropy_ut.cpp
@@ -170,8 +170,8 @@ if (YDB_SDK_TESTS)
170170
unit
171171
)
172172

173-
add_ydb_multiple_tests(PREFIX util-stream
174-
FILES
173+
add_ydb_test(NAME util-stream-ut
174+
SOURCES
175175
stream/aligned_ut.cpp
176176
stream/buffered_ut.cpp
177177
stream/buffer_ut.cpp
@@ -199,8 +199,8 @@ if (YDB_SDK_TESTS)
199199
unit
200200
)
201201

202-
add_ydb_multiple_tests(PREFIX util-string
203-
FILES
202+
add_ydb_test(NAME util-string-ut
203+
SOURCES
204204
string/ascii_ut.cpp
205205
string/builder_ut.cpp
206206
string/cast_ut.cpp
@@ -222,8 +222,8 @@ if (YDB_SDK_TESTS)
222222
unit
223223
)
224224

225-
add_ydb_multiple_tests(PREFIX util-system
226-
FILES
225+
add_ydb_test(NAME util-system-ut
226+
SOURCES
227227
system/align_ut.cpp
228228
system/atexit_ut.cpp
229229
system/backtrace_ut.cpp
@@ -258,6 +258,9 @@ if (YDB_SDK_TESTS)
258258
system/nice_ut.cpp
259259
system/pipe_ut.cpp
260260
system/platform_ut.cpp
261+
# NOTE: `progname_ut` checks if the executable file's name, aka the target's
262+
# name, is either "util-system-ut" or slightly different variations
263+
system/progname_ut.cpp
261264
system/rusage_ut.cpp
262265
system/rwlock_ut.cpp
263266
system/sanitizers_ut.cpp
@@ -269,6 +272,10 @@ if (YDB_SDK_TESTS)
269272
system/tempfile_ut.cpp
270273
system/tls_ut.cpp
271274
system/type_name_ut.cpp
275+
# NOTE: `thread_ut` compares the executable file's name and the current
276+
# thread name, whose length can't be more than 16 bytes in Linux,
277+
# so the test name shouldn't be longer than "util-system-ut"
278+
system/thread_ut.cpp
272279
system/types_ut.cpp
273280
# TODO: add library/cpp/testing/benchmark
274281
# depends only on NBench::Clobber, that's a memory optimization barrier
@@ -282,22 +289,6 @@ if (YDB_SDK_TESTS)
282289
unit
283290
)
284291

285-
# This test checks if the executable file's name (the same name as the target)
286-
# is either "util-system-ut" or slightly different variations.
287-
# It also compares the executable file's name and the current thread name,
288-
# whose length can't be more than 16 bytes in Linux, so "util-system-ut" is
289-
# a suitable name.
290-
add_ydb_test(NAME util-system-ut
291-
SOURCES
292-
system/progname_ut.cpp
293-
system/thread_ut.cpp
294-
LINK_LIBRARIES
295-
yutil
296-
cpp-testing-unittest_main
297-
LABELS
298-
unit
299-
)
300-
301292
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
302293
add_ydb_test(NAME util-system-fs_win_ut
303294
SOURCES
@@ -310,8 +301,8 @@ if (YDB_SDK_TESTS)
310301
)
311302
endif()
312303

313-
add_ydb_multiple_tests(PREFIX util-thread
314-
FILES
304+
add_ydb_test(NAME util-thread-ut
305+
SOURCES
315306
thread/factory_ut.cpp
316307
thread/lfqueue_ut.cpp
317308
thread/lfstack_ut.cpp

0 commit comments

Comments
 (0)