@@ -150,12 +150,20 @@ if(UMF_POOL_JEMALLOC_ENABLED)
150150 set (LIB_JEMALLOC_POOL jemalloc_pool)
151151endif ()
152152
153+ if (UMF_BUILD_SHARED_LIBRARY)
154+ # if build as shared library, ba symbols won't be visible in tests
155+ set (BA_SOURCES_FOR_TEST ${BA_SOURCES} )
156+ endif ()
157+
153158add_umf_test(NAME base SRCS base.cpp)
154159add_umf_test(
155160 NAME memoryPool
156- SRCS memoryPoolAPI.cpp malloc_compliance_tests.cpp
161+ SRCS memoryPoolAPI.cpp malloc_compliance_tests.cpp ${BA_SOURCES_FOR_TEST}
162+ LIBS ${UMF_UTILS_FOR_TEST} )
163+ add_umf_test(
164+ NAME memoryProvider
165+ SRCS memoryProviderAPI.cpp ${BA_SOURCES_FOR_TEST}
157166 LIBS ${UMF_UTILS_FOR_TEST} )
158- add_umf_test(NAME memoryProvider SRCS memoryProviderAPI.cpp)
159167add_umf_test(
160168 NAME logger
161169 SRCS utils/utils_log.cpp ${UMF_UTILS_SOURCES}
@@ -173,7 +181,10 @@ if(LINUX)
173181 LIBS ${UMF_UTILS_FOR_TEST} )
174182endif ()
175183
176- add_umf_test(NAME provider_coarse SRCS provider_coarse.cpp)
184+ add_umf_test(
185+ NAME provider_coarse
186+ SRCS provider_coarse.cpp ${BA_SOURCES_FOR_TEST}
187+ LIBS ${UMF_UTILS_FOR_TEST} )
177188
178189if (UMF_BUILD_LIBUMF_POOL_DISJOINT)
179190 add_umf_test(
@@ -208,8 +219,11 @@ if(UMF_POOL_JEMALLOC_ENABLED AND (NOT UMF_DISABLE_HWLOC))
208219endif ()
209220
210221if (UMF_POOL_SCALABLE_ENABLED AND (NOT UMF_DISABLE_HWLOC))
211- add_umf_test(NAME scalable_pool SRCS pools/scalable_pool.cpp
212- malloc_compliance_tests.cpp)
222+ add_umf_test(
223+ NAME scalable_pool
224+ SRCS pools/scalable_pool.cpp malloc_compliance_tests.cpp
225+ ${BA_SOURCES_FOR_TEST}
226+ LIBS ${UMF_UTILS_FOR_TEST} )
213227endif ()
214228
215229if (LINUX AND (NOT UMF_DISABLE_HWLOC)) # OS-specific functions are implemented
@@ -299,11 +313,15 @@ if(LINUX AND (NOT UMF_DISABLE_HWLOC)) # OS-specific functions are implemented
299313 # This test requires Linux-only file memory provider
300314 if (UMF_POOL_SCALABLE_ENABLED)
301315 add_umf_test(
302- NAME scalable_coarse_file SRCS pools/scalable_coarse_file.cpp
303- malloc_compliance_tests.cpp)
316+ NAME scalable_coarse_file
317+ SRCS pools/scalable_coarse_file.cpp malloc_compliance_tests.cpp
318+ ${BA_SOURCES_FOR_TEST}
319+ LIBS ${UMF_UTILS_FOR_TEST} )
304320 add_umf_test(
305- NAME scalable_coarse_devdax SRCS pools/scalable_coarse_devdax.cpp
306- malloc_compliance_tests.cpp)
321+ NAME scalable_coarse_devdax
322+ SRCS pools/scalable_coarse_devdax.cpp malloc_compliance_tests.cpp
323+ ${BA_SOURCES_FOR_TEST}
324+ LIBS ${UMF_UTILS_FOR_TEST} )
307325 endif ()
308326
309327 if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND UMF_BUILD_FUZZTESTS)
@@ -362,11 +380,6 @@ if(UMF_BUILD_GPU_TESTS AND UMF_BUILD_CUDA_PROVIDER)
362380 endif ()
363381endif ()
364382
365- if (UMF_BUILD_SHARED_LIBRARY)
366- # if build as shared library, ba symbols won't be visible in tests
367- set (BA_SOURCES_FOR_TEST ${BA_SOURCES} )
368- endif ()
369-
370383add_umf_test(
371384 NAME base_alloc
372385 SRCS ${BA_SOURCES_FOR_TEST} test_base_alloc.cpp
@@ -402,7 +415,10 @@ if(UMF_PROXY_LIB_ENABLED
402415 PUBLIC UMF_PROXY_LIB_ENABLED=1)
403416endif ()
404417
405- add_umf_test(NAME ipc SRCS ipcAPI.cpp)
418+ add_umf_test(
419+ NAME ipc
420+ SRCS ipcAPI.cpp ${BA_SOURCES_FOR_TEST}
421+ LIBS ${UMF_UTILS_FOR_TEST} )
406422
407423function (add_umf_ipc_test)
408424 # Parameters: * TEST - a name of the test * SRC_DIR - source files directory
0 commit comments