Merge Christian Gruber's 'rework_gtest_src' into maint.

This commit is contained in:
John Ralls 2019-08-15 15:18:07 -07:00
commit 8eb3819a3c
5 changed files with 19 additions and 28 deletions

View File

@ -129,7 +129,10 @@ function(gnc_gtest_configure)
set(GTEST_LIB "${GTEST_MAIN_LIB};${GTEST_SHARED_LIB}" PARENT_SCOPE)
unset(GTEST_SRC_DIR CACHE)
else()
set(GTEST_SRC "${GTEST_SRC_DIR}/src/gtest_main.cc" PARENT_SCOPE)
set(lib_gtest_SOURCES
"${GTEST_SRC_DIR}/src/gtest_main.cc"
"${GTEST_SRC_DIR}/src/gtest-all.cc"
PARENT_SCOPE)
set(GTEST_LIB "${CMAKE_BINARY_DIR}/common/test-core/libgtest.a" PARENT_SCOPE)
endif()
else()

View File

@ -69,7 +69,8 @@ gnc_add_scheme_targets(scm-test-core
add_dependencies(check scm-test-core)
if(NOT GTEST_SHARED_LIB)
set (lib_gtest_SOURCES ${GTEST_SRC_DIR}/src/gtest-all.cc)
# in contrast to GoogleTest build system libraries libgtest.a and libgtest_main.a
# are combined to one library libtest.a here
add_library(gtest STATIC ${lib_gtest_SOURCES})
if(APPLE)
target_compile_options(gtest PRIVATE -Wno-missing-prototypes)

View File

@ -19,15 +19,13 @@ if (NOT WIN32)
${GTEST_INCLUDE_DIR})
set(test_tokenizer_SOURCES
test-tokenizer.cpp
${GTEST_SRC})
test-tokenizer.cpp)
gnc_add_test(test-tokenizer "${test_tokenizer_SOURCES}"
gtest_csv_imp_INCLUDES gtest_csv_imp_LIBS
SRCDIR=${CMAKE_SOURCE_DIR}/gnucash/import-export/csv-imp/test)
set(test_tx_import_SOURCES
test-tx-import.cpp
${GTEST_SRC})
test-tx-import.cpp)
gnc_add_test(test-tx_import "${test_tx_import_SOURCES}"
gtest_csv_imp_INCLUDES gtest_csv_imp_LIBS)
endif()

View File

@ -47,8 +47,7 @@ set(test_gnc_path_util_SOURCES
${MODULEPATH}/binreloc.c
${MODULEPATH}/gnc-filepath-utils.cpp
${MODULEPATH}/gnc-locale-utils.cpp
gtest-path-utilities.cpp
${GTEST_SRC})
gtest-path-utilities.cpp)
gnc_add_test(test-gnc-path-util "${test_gnc_path_util_SOURCES}"
gtest_core_utils_INCLUDES gtest_core_utils_LIBS "GNC_UNINSTALLED=yes")

View File

@ -123,30 +123,26 @@ endif (WIN32)
set(test_gnc_guid_SOURCES
${MODULEPATH}/guid.cpp
test-gnc-guid.cpp
${GTEST_SRC})
test-gnc-guid.cpp)
gnc_add_test(test-gnc-guid "${test_gnc_guid_SOURCES}"
gtest_engine_INCLUDES gtest_old_engine_LIBS)
set(test_kvp_value_SOURCES
${MODULEPATH}/kvp-value.cpp
test-kvp-value.cpp
test-kvp-frame.cpp
${GTEST_SRC})
test-kvp-frame.cpp)
gnc_add_test(test-kvp-value "${test_kvp_value_SOURCES}"
gtest_engine_INCLUDES gtest_old_engine_LIBS)
set(test_qofsession_SOURCES
${MODULEPATH}/qofsession.cpp
test-qofsession.cpp
${GTEST_SRC})
test-qofsession.cpp)
gnc_add_test(test-qofsession "${test_qofsession_SOURCES}"
gtest_engine_INCLUDES gtest_old_engine_LIBS)
set(test_gnc_int128_SOURCES
${MODULEPATH}/gnc-int128.cpp
gtest-gnc-int128.cpp
${GTEST_SRC})
gtest-gnc-int128.cpp)
gnc_add_test(test-gnc-int128 "${test_gnc_int128_SOURCES}"
gtest_engine_INCLUDES gtest_qof_LIBS)
@ -160,8 +156,7 @@ set(test_gnc_rational_SOURCES
${MODULEPATH}/qoflog.cpp
${CMAKE_SOURCE_DIR}/libgnucash/core-utils/gnc-locale-utils.cpp
${gtest_engine_win32_SOURCES}
gtest-gnc-rational.cpp
${GTEST_SRC})
gtest-gnc-rational.cpp)
gnc_add_test(test-gnc-rational "${test_gnc_rational_SOURCES}"
gtest_engine_INCLUDES gtest_qof_LIBS)
@ -176,15 +171,13 @@ set(test_gnc_numeric_SOURCES
${MODULEPATH}/qoflog.cpp
${CMAKE_SOURCE_DIR}/libgnucash/core-utils/gnc-locale-utils.cpp
${gtest_engine_win32_SOURCES}
gtest-gnc-numeric.cpp
${GTEST_SRC})
gtest-gnc-numeric.cpp)
gnc_add_test(test-gnc-numeric "${test_gnc_numeric_SOURCES}"
gtest_engine_INCLUDES gtest_qof_LIBS)
set(test_gnc_timezone_SOURCES
${MODULEPATH}/gnc-timezone.cpp
gtest-gnc-timezone.cpp
${GTEST_SRC})
gtest-gnc-timezone.cpp)
gnc_add_test(test-gnc-timezone "${test_gnc_timezone_SOURCES}"
gtest_engine_INCLUDES gtest_old_engine_LIBS)
@ -195,20 +188,17 @@ set(test_gnc_datetime_SOURCES
${MODULEPATH}/qoflog.cpp
${CMAKE_SOURCE_DIR}/libgnucash/core-utils/gnc-locale-utils.cpp
${gtest_engine_win32_SOURCES}
gtest-gnc-datetime.cpp
${GTEST_SRC})
gtest-gnc-datetime.cpp)
gnc_add_test(test-gnc-datetime "${test_gnc_datetime_SOURCES}"
gtest_engine_INCLUDES gtest_qof_LIBS)
set(test_import_map_SOURCES
gtest-import-map.cpp
${GTEST_SRC})
gtest-import-map.cpp)
gnc_add_test(test-import-map "${test_import_map_SOURCES}"
gtest_engine_INCLUDES gtest_old_engine_LIBS)
set(test_qofquerycore_SOURCES
gtest-qofquerycore.cpp
${GTEST_SRC})
gtest-qofquerycore.cpp)
gnc_add_test(test-qofquerycore "${test_qofquerycore_SOURCES}"
gtest_engine_INCLUDES gtest_old_engine_LIBS)