mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-23 11:23:26 +01:00
Merge pull request #1009
640a934
tests: cmake: fix building with system gtest (redfish)4a9e949
tests: cmake: use a list for enabled tests (redfish)dbd9a26
cmake: tests: gtest target is not always defined #983 (redfish)
This commit is contained in:
commit
e389a9cd8f
@ -79,7 +79,6 @@ Packaging for your favorite distribution would be a welcome contribution!
|
|||||||
* pkg-config
|
* pkg-config
|
||||||
* libunbound `>=1.4.16` (note: Unbound is not a dependency, libunbound is)
|
* libunbound `>=1.4.16` (note: Unbound is not a dependency, libunbound is)
|
||||||
* libevent `>=2.0`
|
* libevent `>=2.0`
|
||||||
* libgtest `>=1.5`
|
|
||||||
* Boost `>=1.58`
|
* Boost `>=1.58`
|
||||||
* BerkeleyDB `>=4.8` (note: on Ubuntu this means installing libdb-dev and libdb++-dev)
|
* BerkeleyDB `>=4.8` (note: on Ubuntu this means installing libdb-dev and libdb++-dev)
|
||||||
* libunwind (optional, for stack trace on exception)
|
* libunwind (optional, for stack trace on exception)
|
||||||
@ -87,6 +86,7 @@ Packaging for your favorite distribution would be a welcome contribution!
|
|||||||
* ldns `>=1.6.17` (optional, for statically-linked binaries)
|
* ldns `>=1.6.17` (optional, for statically-linked binaries)
|
||||||
* expat `>=1.1` (optional, for statically-linked binaries)
|
* expat `>=1.1` (optional, for statically-linked binaries)
|
||||||
* bison or yacc (optional, for statically-linked binaries)
|
* bison or yacc (optional, for statically-linked binaries)
|
||||||
|
* GTest `>=1.5` (optional, for running test suite) (NOTE: `libgtest-dev` package in Ubuntu ships without binaries and requires a manual build; `gtest` on Arch includes binaries)
|
||||||
* Doxygen (optional, for generating documentation)
|
* Doxygen (optional, for generating documentation)
|
||||||
* graphviz (optional, for generating documentation)
|
* graphviz (optional, for generating documentation)
|
||||||
|
|
||||||
|
@ -28,6 +28,9 @@
|
|||||||
#
|
#
|
||||||
# Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
|
# Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
|
||||||
|
|
||||||
|
# The docs say this only affects grouping in IDEs
|
||||||
|
set(folder "tests")
|
||||||
|
|
||||||
if (WIN32 AND STATIC)
|
if (WIN32 AND STATIC)
|
||||||
add_definitions(-DSTATICLIB)
|
add_definitions(-DSTATICLIB)
|
||||||
# miniupnp changed their static define
|
# miniupnp changed their static define
|
||||||
@ -39,19 +42,24 @@ find_package(GTest)
|
|||||||
if (GTest_FOUND)
|
if (GTest_FOUND)
|
||||||
include_directories(SYSTEM ${GTEST_INCLUDE_DIRS})
|
include_directories(SYSTEM ${GTEST_INCLUDE_DIRS})
|
||||||
else ()
|
else ()
|
||||||
|
message(STATUS "GTest not found on the system: will use GTest bundled with this source")
|
||||||
add_subdirectory(gtest)
|
add_subdirectory(gtest)
|
||||||
include_directories(SYSTEM "${gtest_SOURCE_DIR}/include" "${gtest_SOURCE_DIR}")
|
include_directories(SYSTEM "${gtest_SOURCE_DIR}/include" "${gtest_SOURCE_DIR}")
|
||||||
|
|
||||||
# Emulate the FindGTest module's variable.
|
# Emulate the FindGTest module's variable.
|
||||||
set(GTEST_MAIN_LIBRARIES gtest_main)
|
set(GTEST_LIBRARIES gtest)
|
||||||
|
|
||||||
# Ignore some warnings when building gtest binaries.
|
# Ignore some warnings when building gtest binaries.
|
||||||
if(NOT MSVC)
|
if(NOT MSVC)
|
||||||
set_property(TARGET gtest gtest_main
|
set_property(TARGET gtest
|
||||||
APPEND_STRING
|
APPEND_STRING
|
||||||
PROPERTY
|
PROPERTY
|
||||||
COMPILE_FLAGS " -Wno-undef -Wno-sign-compare")
|
COMPILE_FLAGS " -Wno-undef -Wno-sign-compare")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set_property(TARGET gtest
|
||||||
|
PROPERTY
|
||||||
|
FOLDER "${folder}")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (NOT DEFINED ENV{TRAVIS})
|
if (NOT DEFINED ENV{TRAVIS})
|
||||||
@ -84,17 +92,23 @@ target_link_libraries(hash-target-tests
|
|||||||
cryptonote_core)
|
cryptonote_core)
|
||||||
set_property(TARGET hash-target-tests
|
set_property(TARGET hash-target-tests
|
||||||
PROPERTY
|
PROPERTY
|
||||||
FOLDER "tests")
|
FOLDER "${folder}")
|
||||||
|
|
||||||
add_test(
|
add_test(
|
||||||
NAME hash-target
|
NAME hash-target
|
||||||
COMMAND hash-target-tests)
|
COMMAND hash-target-tests)
|
||||||
|
|
||||||
# Skip the core_tests if we are running in Travis-CI because they will take too long
|
set(enabled_tests
|
||||||
if (DEFINED ENV{TRAVIS})
|
difficulty
|
||||||
add_custom_target(tests DEPENDS difficulty hash performance_tests core_proxy unit_tests)
|
hash
|
||||||
else ()
|
performance_tests
|
||||||
add_custom_target(tests DEPENDS coretests difficulty hash performance_tests core_proxy unit_tests)
|
core_proxy
|
||||||
endif ()
|
unit_tests)
|
||||||
|
|
||||||
set_property(TARGET gtest gtest_main hash-target-tests tests PROPERTY FOLDER "tests")
|
# Skip the core_tests in Travis-CI because they will take too long
|
||||||
|
if (NOT DEFINED ENV{TRAVIS})
|
||||||
|
list(APPEND enabled_tests coretests)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_custom_target(tests DEPENDS enabled_tests)
|
||||||
|
set_property(TARGET tests PROPERTY FOLDER "${folder}")
|
||||||
|
@ -42,7 +42,7 @@ target_link_libraries(transfers
|
|||||||
crypto
|
crypto
|
||||||
common
|
common
|
||||||
epee
|
epee
|
||||||
${GTEST_MAIN_LIBRARIES}
|
${GTEST_LIBRARIES}
|
||||||
${Boost_LIBRARIES})
|
${Boost_LIBRARIES})
|
||||||
|
|
||||||
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/test_transfers")
|
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/test_transfers")
|
||||||
|
@ -40,7 +40,7 @@ add_executable(libwallet_api_tests
|
|||||||
target_link_libraries(libwallet_api_tests
|
target_link_libraries(libwallet_api_tests
|
||||||
LINK_PRIVATE
|
LINK_PRIVATE
|
||||||
wallet
|
wallet
|
||||||
${GTEST_MAIN_LIBRARIES}
|
${GTEST_LIBRARIES}
|
||||||
${EXTRA_LIBRARIES})
|
${EXTRA_LIBRARIES})
|
||||||
|
|
||||||
set_property(TARGET libwallet_api_tests
|
set_property(TARGET libwallet_api_tests
|
||||||
|
@ -40,7 +40,7 @@ target_link_libraries(net_load_tests_clt
|
|||||||
otshell_utils
|
otshell_utils
|
||||||
p2p
|
p2p
|
||||||
cryptonote_core
|
cryptonote_core
|
||||||
${GTEST_MAIN_LIBRARIES}
|
${GTEST_LIBRARIES}
|
||||||
${Boost_CHRONO_LIBRARY}
|
${Boost_CHRONO_LIBRARY}
|
||||||
${Boost_DATE_TIME_LIBRARY}
|
${Boost_DATE_TIME_LIBRARY}
|
||||||
${Boost_FILESYSTEM_LIBRARY}
|
${Boost_FILESYSTEM_LIBRARY}
|
||||||
@ -62,7 +62,7 @@ target_link_libraries(net_load_tests_srv
|
|||||||
otshell_utils
|
otshell_utils
|
||||||
p2p
|
p2p
|
||||||
cryptonote_core
|
cryptonote_core
|
||||||
${GTEST_MAIN_LIBRARIES}
|
${GTEST_LIBRARIES}
|
||||||
${Boost_CHRONO_LIBRARY}
|
${Boost_CHRONO_LIBRARY}
|
||||||
${Boost_DATE_TIME_LIBRARY}
|
${Boost_DATE_TIME_LIBRARY}
|
||||||
${Boost_FILESYSTEM_LIBRARY}
|
${Boost_FILESYSTEM_LIBRARY}
|
||||||
|
@ -69,7 +69,7 @@ target_link_libraries(unit_tests
|
|||||||
rpc
|
rpc
|
||||||
wallet
|
wallet
|
||||||
p2p
|
p2p
|
||||||
${GTEST_MAIN_LIBRARIES}
|
${GTEST_LIBRARIES}
|
||||||
${Boost_CHRONO_LIBRARY}
|
${Boost_CHRONO_LIBRARY}
|
||||||
${Boost_REGEX_LIBRARY}
|
${Boost_REGEX_LIBRARY}
|
||||||
${Boost_SYSTEM_LIBRARY}
|
${Boost_SYSTEM_LIBRARY}
|
||||||
|
Loading…
Reference in New Issue
Block a user