2017-12-05 16:48:45 -06:00
|
|
|
set(MODULEPATH ${CMAKE_SOURCE_DIR}/libgnucash/core-utils)
|
2016-01-18 10:33:34 -06:00
|
|
|
|
2018-05-03 16:18:15 -05:00
|
|
|
set(CORE_UTILS_TEST_INCLUDE_DIRS
|
2017-08-10 06:56:00 -05:00
|
|
|
${CMAKE_BINARY_DIR}/common # for config.h
|
2017-12-05 16:48:45 -06:00
|
|
|
${MODULEPATH}
|
2017-08-10 06:56:00 -05:00
|
|
|
${CMAKE_SOURCE_DIR}/common/test-core
|
2019-09-21 17:28:09 -05:00
|
|
|
${GTK_MAC_INCLUDE_DIRS}
|
2016-01-18 10:33:34 -06:00
|
|
|
)
|
2018-05-03 16:18:15 -05:00
|
|
|
set(CORE_UTILS_TEST_LIBS gnc-core-utils test-core)
|
|
|
|
if (MAC_INTEGRATION)
|
|
|
|
list(APPEND CORE_UTILS_TEST_LIBS ${OSX_EXTRA_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
macro(add_core_utils_test _TARGET _SOURCE_FILES)
|
|
|
|
gnc_add_test(${_TARGET} "${_SOURCE_FILES}" CORE_UTILS_TEST_INCLUDE_DIRS CORE_UTILS_TEST_LIBS)
|
|
|
|
endmacro()
|
|
|
|
|
|
|
|
add_core_utils_test(test-gnc-glib-utils test-gnc-glib-utils.c)
|
|
|
|
add_core_utils_test(test-resolve-file-path test-resolve-file-path.c)
|
|
|
|
add_core_utils_test(test-userdata-dir test-userdata-dir.c)
|
|
|
|
if (NOT MAC_INTEGRATION AND NOT WIN32)
|
|
|
|
add_core_utils_test(test-userdata-dir-invalid-home test-userdata-dir-invalid-home.c)
|
|
|
|
endif()
|
|
|
|
if (MAC_INTEGRATION)
|
|
|
|
target_compile_options(test-userdata-dir PRIVATE ${OSX_EXTRA_COMPILE_FLAGS})
|
|
|
|
target_compile_definitions(test-userdata-dir PRIVATE ${GTK_MAC_CFLAGS_OTHER})
|
2020-01-30 05:20:25 -06:00
|
|
|
endif()
|
2017-02-01 21:48:46 -06:00
|
|
|
|
2017-12-05 16:48:45 -06:00
|
|
|
set(gtest_core_utils_INCLUDES
|
|
|
|
${MODULEPATH}
|
|
|
|
${CMAKE_BINARY_DIR}/common # for config.h
|
|
|
|
${CMAKE_SOURCE_DIR}/common # for platform.h
|
|
|
|
${CMAKE_BINARY_DIR}/libgnucash/core-utils # for gncla-dir.h
|
|
|
|
)
|
|
|
|
|
2018-05-03 16:18:15 -05:00
|
|
|
set(gtest_core_utils_LIBS
|
2023-02-21 05:22:55 -06:00
|
|
|
PkgConfig::GLIB2
|
2019-09-21 17:28:09 -05:00
|
|
|
${Boost_LIBRARIES}
|
|
|
|
${GTHREAD_LDFLAGS}
|
2019-08-17 17:30:42 -05:00
|
|
|
gtest)
|
2017-12-05 16:48:45 -06:00
|
|
|
|
|
|
|
set(test_gnc_path_util_SOURCES
|
|
|
|
${MODULEPATH}/gnc-path.c
|
|
|
|
${MODULEPATH}/binreloc.c
|
|
|
|
${MODULEPATH}/gnc-filepath-utils.cpp
|
2019-01-06 11:52:43 -06:00
|
|
|
${MODULEPATH}/gnc-locale-utils.cpp
|
2019-08-15 16:20:45 -05:00
|
|
|
gtest-path-utilities.cpp)
|
2017-12-05 16:48:45 -06:00
|
|
|
|
|
|
|
gnc_add_test(test-gnc-path-util "${test_gnc_path_util_SOURCES}"
|
|
|
|
gtest_core_utils_INCLUDES gtest_core_utils_LIBS "GNC_UNINSTALLED=yes")
|
|
|
|
|
2018-05-03 16:18:15 -05:00
|
|
|
set_dist_list(test_core_utils_DIST CMakeLists.txt
|
2017-12-05 16:48:45 -06:00
|
|
|
test-gnc-glib-utils.c test-resolve-file-path.c test-userdata-dir.c
|
|
|
|
test-userdata-dir-invalid-home.c gtest-path-utilities.cpp)
|