@@ -28,8 +28,6 @@ set(ICEBERG_TEST_RESOURCES "${CMAKE_SOURCE_DIR}/src/iceberg/test/resources")
2828
2929configure_file ("test_config.h.in" "test_config.h" )
3030
31- add_subdirectory (util)
32-
3331function (add_iceberg_test test_name)
3432 set (options USE_BUNDLE)
3533 set (oneValueArgs)
@@ -41,16 +39,15 @@ function(add_iceberg_test test_name)
4139 ${ARGN} )
4240
4341 add_executable (${test_name} )
44- target_include_directories (${test_name} PRIVATE "${CMAKE_BINARY_DIR} /iceberg/test/" )
42+ target_include_directories (${test_name} PRIVATE "${CMAKE_BINARY_DIR} /iceberg/test/"
43+ "${CMAKE_SOURCE_DIR} /src" )
4544
46- target_sources (${test_name} PRIVATE ${ARG_SOURCES} )
45+ target_sources (${test_name} PRIVATE ${ARG_SOURCES} util/common_util.cc )
4746
4847 if (ARG_USE_BUNDLE)
49- target_link_libraries (${test_name} PRIVATE iceberg_bundle_static GTest::gmock_main
50- iceberg_test_util)
48+ target_link_libraries (${test_name} PRIVATE iceberg_bundle_static GTest::gmock_main)
5149 else ()
52- target_link_libraries (${test_name} PRIVATE iceberg_static GTest::gmock_main
53- iceberg_test_util)
50+ target_link_libraries (${test_name} PRIVATE iceberg_static GTest::gmock_main)
5451 endif ()
5552
5653 add_test (NAME ${test_name} COMMAND ${test_name} )
@@ -161,10 +158,10 @@ if(ICEBERG_BUILD_REST)
161158 ${ARGN} )
162159
163160 add_executable (${test_name} )
164- target_include_directories (${test_name} PRIVATE "${CMAKE_BINARY_DIR} /iceberg/test/" )
165- target_sources ( ${test_name} PRIVATE ${ARG_SOURCES} )
166- target_link_libraries (${test_name} PRIVATE GTest::gmock_main iceberg_rest_static
167- iceberg_test_util )
161+ target_include_directories (${test_name} PRIVATE "${CMAKE_BINARY_DIR} /iceberg/test/"
162+ " ${CMAKE_SOURCE_DIR} /src" )
163+ target_sources (${test_name} PRIVATE ${ARG_SOURCES} util/common_util.cc)
164+ target_link_libraries ( ${test_name} PRIVATE GTest::gmock_main iceberg_rest_static )
168165 add_test (NAME ${test_name} COMMAND ${test_name} )
169166 endfunction ()
170167
0 commit comments