Skip to content

Commit 01697eb

Browse files
committed
Add OUTPUT_DIRECTORY parameter to testing command
1 parent 4821446 commit 01697eb

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

cmake/testing.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ endfunction()
6969

7070
function(add_ydb_test)
7171
set(opts GTEST)
72-
set(oneval_args NAME WORKING_DIRECTORY)
72+
set(oneval_args NAME WORKING_DIRECTORY OUTPUT_DIRECTORY)
7373
set(multival_args INCLUDE_DIRS SOURCES LINK_LIBRARIES LABELS)
7474
cmake_parse_arguments(YDB_TEST
7575
"${opts}"
@@ -82,6 +82,10 @@ function(add_ydb_test)
8282
file(MAKE_DIRECTORY "${YDB_TEST_WORKING_DIRECTORY}")
8383
endif()
8484

85+
if (YDB_TEST_OUTPUT_DIRECTORY AND NOT EXISTS "${YDB_TEST_OUTPUT_DIRECTORY}")
86+
file(MAKE_DIRECTORY "${YDB_TEST_OUTPUT_DIRECTORY}")
87+
endif()
88+
8589
add_executable(${YDB_TEST_NAME})
8690
target_include_directories(${YDB_TEST_NAME} PRIVATE ${YDB_TEST_INCLUDE_DIRS})
8791
target_link_libraries(${YDB_TEST_NAME} PRIVATE ${YDB_TEST_LINK_LIBRARIES})

util/CMakeLists.txt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,6 @@ if (YDB_SDK_TESTS)
265265
system/filemap_ut.cpp
266266
system/file_ut.cpp
267267
system/flock_ut.cpp
268-
system/fstat_ut.cpp
269268
system/fs_ut.cpp
270269
system/getpid_ut.cpp
271270
system/guard_ut.cpp
@@ -311,6 +310,20 @@ if (YDB_SDK_TESTS)
311310
unit
312311
)
313312

313+
add_ydb_test(NAME util-system-fstat_ut
314+
WORKING_DIRECTORY
315+
${CMAKE_CURRENT_BINARY_DIR}/system
316+
OUTPUT_DIRECTORY
317+
${CMAKE_CURRENT_BINARY_DIR}/system/testing_out_stuff
318+
SOURCES
319+
system/fstat_ut.cpp
320+
LINK_LIBRARIES
321+
yutil
322+
cpp-testing-unittest_main
323+
LABELS
324+
unit
325+
)
326+
314327
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
315328
add_ydb_test(NAME util-system-fs_win_ut
316329
WORKING_DIRECTORY

0 commit comments

Comments
 (0)