Skip to content

Commit

Permalink
Simplify eden/common/utils/test CMake script
Browse files Browse the repository at this point in the history
Summary: Current script was built up from individual tests, but is tedious to maintain this way. Lets fix that by creating a single target and enumerating the files to be included.

Reviewed By: genevievehelsel

Differential Revision: D54554901

fbshipit-source-id: 31f0c93d8fb71de19543af168282399cdc3a511c
  • Loading branch information
jdelliot authored and facebook-github-bot committed Mar 7, 2024
1 parent bbb4f1f commit b16e58b
Showing 1 changed file with 18 additions and 220 deletions.
238 changes: 18 additions & 220 deletions eden/common/utils/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,234 +3,32 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.


add_executable(
process_info_cache_test
"ProcessInfoCacheTest.cpp"
)

target_link_libraries(
process_info_cache_test
PUBLIC
edencommon_utils
Folly::folly_test_util
${LIBGMOCK_LIBRARIES}
)

gtest_discover_tests(process_info_cache_test)

add_executable(
string_conv_test
"StringConvTest.cpp"
)

target_link_libraries(
string_conv_test
PUBLIC
edencommon_utils
Folly::folly_test_util
${LIBGMOCK_LIBRARIES}
)

gtest_discover_tests(string_conv_test)

add_executable(
option_set_test
"OptionSetTest.cpp"
)

target_link_libraries(
option_set_test
PUBLIC
edencommon_utils
Folly::folly_test_util
${LIBGMOCK_LIBRARIES}
)

gtest_discover_tests(option_set_test)

add_executable(
throw_test
"ThrowTest.cpp"
)

target_link_libraries(
throw_test
PUBLIC
edencommon_utils
Folly::folly_test_util
${LIBGMOCK_LIBRARIES}
)

gtest_discover_tests(throw_test)

add_executable(
immediate_future_test
"ImmediateFutureTest.cpp"
)

target_link_libraries(
immediate_future_test
PUBLIC
edencommon_utils
Folly::folly_test_util
${LIBGMOCK_LIBRARIES}
)

gtest_discover_tests(immediate_future_test)

add_executable(
memory_test
"MemoryTest.cpp"
)

target_link_libraries(
memory_test
PUBLIC
edencommon_utils
Folly::folly_test_util
${LIBGMOCK_LIBRARIES}
)

gtest_discover_tests(memory_test)

add_executable(
string_test
"StringTest.cpp"
)

target_link_libraries(
string_test
PUBLIC
edencommon_utils
Folly::folly_test_util
${LIBGMOCK_LIBRARIES}
)

gtest_discover_tests(string_test)

add_executable(
utf8_test
"Utf8Test.cpp"
)

target_link_libraries(
utf8_test
PUBLIC
edencommon_utils
Folly::folly_test_util
${LIBGMOCK_LIBRARIES}
)

gtest_discover_tests(utf8_test)

add_executable(
file_utils_test
"FileUtilsTest.cpp"
)

target_link_libraries(
file_utils_test
PUBLIC
edencommon_testharness
edencommon_utils
Folly::folly_test_util
${LIBGMOCK_LIBRARIES}
)

gtest_discover_tests(file_utils_test)

add_executable(
path_funcs_test
"PathFuncsTest.cpp"
)

target_link_libraries(
path_funcs_test
PUBLIC
edencommon_testharness
edencommon_utils
Folly::folly_test_util
${LIBGMOCK_LIBRARIES}
)

gtest_discover_tests(path_funcs_test)

add_executable(
file_descriptor_test
"FileDescriptorTest.cpp"
)

target_link_libraries(
file_descriptor_test
PUBLIC
edencommon_testharness
edencommon_utils
Folly::folly_test_util
${LIBGMOCK_LIBRARIES}
)

gtest_discover_tests(file_descriptor_test)

add_executable(
io_future_test
"IoFutureTest.cpp"
)

target_link_libraries(
io_future_test
PUBLIC
edencommon_utils
Folly::folly_test_util
${LIBGMOCK_LIBRARIES}
)

gtest_discover_tests(io_future_test)

add_executable(
unix_socket_test
"UnixSocketTest.cpp"
)

target_link_libraries(
unix_socket_test
PUBLIC
edencommon_testharness
edencommon_utils
Folly::folly_test_util
${LIBGMOCK_LIBRARIES}
)

gtest_discover_tests(io_future_test)

add_executable(
spawned_process_test
"SpawnedProcessTest.cpp"
utils_test
FileDescriptorTest.cpp
FileUtilsTest.cpp
OptionSetTest.cpp
ImmediateFutureTest.cpp
IoFutureTest.cpp
MemoryTest.cpp
PathFuncsTest.cpp
ProcessInfoCacheTest.cpp
RefPtrTest.cpp
SpawnedProcessTest.cpp
StringConvTest.cpp
StringTest.cpp
ThrowTest.cpp
UnixSocketTest.cpp
Utf8Test.cpp
)

target_link_libraries(
spawned_process_test
utils_test
PUBLIC
edencommon_testharness
edencommon_utils
Folly::folly_test_util
${LIBGMOCK_LIBRARIES}
)

gtest_discover_tests(spawned_process_test)

add_executable(
ref_ptr_test
"RefPtrTest.cpp"
)

target_link_libraries(
ref_ptr_test
PUBLIC
edencommon_testharness
edencommon_utils
Folly::folly_test_util
${LIBGMOCK_LIBRARIES}
)

gtest_discover_tests(ref_ptr_test)
gtest_discover_tests(utils_test)

0 comments on commit b16e58b

Please sign in to comment.