danicoin/tests/CMakeLists.txt

106 lines
5.1 KiB
Text
Raw Normal View History

2014-04-09 12:14:35 +00:00
add_definitions(-DSTATICLIB)
2014-06-25 17:21:42 +00:00
include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR} ../version)
2014-03-03 22:07:58 +00:00
2015-07-30 15:22:07 +00:00
file(GLOB_RECURSE CoreTests CoreTests/*)
2015-05-27 12:08:46 +00:00
file(GLOB_RECURSE CryptoTests crypto/*)
2015-07-30 15:22:07 +00:00
file(GLOB_RECURSE FunctionalTests FunctionalTests/*)
file(GLOB_RECURSE IntegrationTestLibrary IntegrationTestLib/*)
file(GLOB_RECURSE IntegrationTests IntegrationTests/*)
file(GLOB_RECURSE NodeRpcProxyTests NodeRpcProxyTests/*)
file(GLOB_RECURSE PerformanceTests PerformanceTests/*)
2015-05-27 12:08:46 +00:00
file(GLOB_RECURSE SystemTests System/*)
file(GLOB_RECURSE TestGenerator TestGenerator/*)
2015-07-30 15:22:07 +00:00
file(GLOB_RECURSE TransfersTests TransfersTests/*)
file(GLOB_RECURSE UnitTests UnitTests/*)
file(GLOB_RECURSE CryptoNoteProtocol ../src/CryptoNoteProtocol/*)
file(GLOB_RECURSE P2p ../src/P2p/*)
2015-05-27 12:08:46 +00:00
source_group("" FILES ${CoreTests} ${CryptoTests} ${FunctionalTests} ${IntegrationTestLibrary} ${IntegrationTests} ${NodeRpcProxyTests} ${PerformanceTests} ${SystemTests} ${TestGenerator} ${TransfersTests} ${UnitTests})
source_group("" FILES ${CryptoNoteProtocol} ${P2p})
add_library(IntegrationTestLibrary ${IntegrationTestLibrary})
add_library(TestGenerator ${TestGenerator})
add_executable(CoreTests ${CoreTests})
add_executable(CryptoTests ${CryptoTests})
add_executable(IntegrationTests ${IntegrationTests})
add_executable(NodeRpcProxyTests ${NodeRpcProxyTests})
add_executable(PerformanceTests ${PerformanceTests})
add_executable(SystemTests ${SystemTests})
add_executable(TransfersTests ${TransfersTests})
add_executable(UnitTests ${UnitTests})
2015-07-30 15:22:07 +00:00
add_executable(DifficultyTests Difficulty/Difficulty.cpp)
add_executable(HashTargetTests HashTarget.cpp)
add_executable(HashTests Hash/main.cpp)
2015-05-27 12:08:46 +00:00
2015-07-30 15:22:07 +00:00
target_link_libraries(CoreTests TestGenerator CryptoNoteCore Serialization System Logging Common Crypto BlockchainExplorer ${Boost_LIBRARIES})
2015-07-15 12:23:00 +00:00
target_link_libraries(IntegrationTests IntegrationTestLibrary Wallet NodeRpcProxy InProcessNode P2P Rpc Http Transfers Serialization System CryptoNoteCore Logging Common Crypto BlockchainExplorer gtest upnpc-static ${Boost_LIBRARIES})
target_link_libraries(NodeRpcProxyTests NodeRpcProxy CryptoNoteCore Rpc Http Serialization System Logging Common Crypto ${Boost_LIBRARIES})
target_link_libraries(PerformanceTests CryptoNoteCore Serialization Logging Common Crypto ${Boost_LIBRARIES})
2015-05-27 12:08:46 +00:00
target_link_libraries(SystemTests System gtest_main)
if (MSVC)
target_link_libraries(SystemTests ws2_32)
2015-07-30 15:22:07 +00:00
target_link_libraries(NodeRpcProxyTests ws2_32)
target_link_libraries(CoreTests ws2_32)
2015-05-27 12:08:46 +00:00
endif ()
2015-07-30 15:22:07 +00:00
target_link_libraries(TransfersTests IntegrationTestLibrary Wallet gtest_main InProcessNode NodeRpcProxy P2P Rpc Http BlockchainExplorer CryptoNoteCore Serialization System Logging Transfers Common Crypto upnpc-static ${Boost_LIBRARIES})
target_link_libraries(UnitTests gtest_main PaymentGate Wallet TestGenerator InProcessNode NodeRpcProxy Rpc Http Transfers Serialization System Logging BlockchainExplorer Common CryptoNoteCore Crypto ${Boost_LIBRARIES})
2015-05-27 12:08:46 +00:00
2015-07-15 12:23:00 +00:00
target_link_libraries(DifficultyTests CryptoNoteCore Serialization Crypto Logging Common ${Boost_LIBRARIES})
target_link_libraries(HashTargetTests CryptoNoteCore Crypto)
2015-05-27 12:08:46 +00:00
target_link_libraries(HashTests Crypto)
2014-06-25 17:21:42 +00:00
2014-03-03 22:07:58 +00:00
if(NOT MSVC)
2015-07-30 15:22:07 +00:00
set_property(TARGET gtest gtest_main IntegrationTestLibrary IntegrationTests TestGenerator UnitTests SystemTests HashTargetTests TransfersTests APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-sign-compare")
2014-03-03 22:07:58 +00:00
endif()
2015-05-27 12:08:46 +00:00
add_custom_target(tests DEPENDS CoreTests IntegrationTests NodeRpcProxyTests PerformanceTests SystemTests TransfersTests UnitTests DifficultyTests HashTargetTests)
set_property(TARGET
tests
IntegrationTestLibrary
TestGenerator
CoreTests
CryptoTests
IntegrationTests
NodeRpcProxyTests
PerformanceTests
SystemTests
TransfersTests
UnitTests
DifficultyTests
HashTargetTests
HashTests
PROPERTY FOLDER "tests")
add_dependencies(IntegrationTestLibrary version)
set_property(TARGET CoreTests PROPERTY OUTPUT_NAME "core_tests")
set_property(TARGET CryptoTests PROPERTY OUTPUT_NAME "crypto_tests")
set_property(TARGET IntegrationTests PROPERTY OUTPUT_NAME "integration_tests")
set_property(TARGET NodeRpcProxyTests PROPERTY OUTPUT_NAME "node_rpc_proxy_tests")
set_property(TARGET PerformanceTests PROPERTY OUTPUT_NAME "performance_tests")
set_property(TARGET SystemTests PROPERTY OUTPUT_NAME "system_tests")
set_property(TARGET TransfersTests PROPERTY OUTPUT_NAME "transfers_tests")
set_property(TARGET UnitTests PROPERTY OUTPUT_NAME "unit_tests")
set_property(TARGET DifficultyTests PROPERTY OUTPUT_NAME "difficulty_tests")
set_property(TARGET HashTargetTests PROPERTY OUTPUT_NAME "hash_target_tests")
set_property(TARGET HashTests PROPERTY OUTPUT_NAME "hash_tests")
add_test(CoreTests core_tests --generate_and_play_test_data)
add_test(CryptoTests crypto_tests ${CMAKE_CURRENT_SOURCE_DIR}/crypto/tests.txt)
2015-07-30 15:22:07 +00:00
add_test(DifficultyTests difficulty_tests ${CMAKE_CURRENT_SOURCE_DIR}/Difficulty/data.txt)
2014-03-20 11:46:11 +00:00
foreach(hash IN ITEMS fast slow tree extra-blake extra-groestl extra-jh extra-skein)
2015-07-30 15:22:07 +00:00
add_test(hash-${hash} hash_tests ${hash} ${CMAKE_CURRENT_SOURCE_DIR}/Hash/tests-${hash}.txt)
2014-03-03 22:07:58 +00:00
endforeach(hash)
2015-05-27 12:08:46 +00:00
add_test(HashTargetTests hash_target_tests)
add_test(SystemTests system_tests)
add_test(UnitTests unit_tests)