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-05-27 12:08:46 +00:00
|
|
|
file(GLOB_RECURSE CoreTests core_tests/*)
|
|
|
|
file(GLOB_RECURSE CryptoTests crypto/*)
|
|
|
|
file(GLOB_RECURSE FunctionalTests functional_tests/*)
|
|
|
|
file(GLOB_RECURSE IntegrationTestLibrary integration_test_lib/*)
|
|
|
|
file(GLOB_RECURSE IntegrationTests integration_tests/*)
|
|
|
|
file(GLOB_RECURSE NodeRpcProxyTests node_rpc_proxy_test/*)
|
|
|
|
file(GLOB_RECURSE PerformanceTests performance_tests/*)
|
|
|
|
file(GLOB_RECURSE SystemTests System/*)
|
|
|
|
file(GLOB_RECURSE TestGenerator TestGenerator/*)
|
|
|
|
file(GLOB_RECURSE TransfersTests transfers_tests/*)
|
|
|
|
file(GLOB_RECURSE UnitTests unit_tests/*)
|
|
|
|
|
|
|
|
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})
|
|
|
|
|
|
|
|
add_executable(DifficultyTests difficulty/difficulty.cpp)
|
|
|
|
add_executable(HashTargetTests hash-target.cpp)
|
|
|
|
add_executable(HashTests hash/main.cpp)
|
|
|
|
|
2015-07-15 12:23:00 +00:00
|
|
|
target_link_libraries(CoreTests TestGenerator CryptoNoteCore Serialization Logging Common Crypto ${Boost_LIBRARIES})
|
|
|
|
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)
|
|
|
|
endif ()
|
|
|
|
|
2015-07-15 12:23:00 +00:00
|
|
|
target_link_libraries(TransfersTests IntegrationTestLibrary Wallet gtest_main CryptoNoteCore InProcessNode NodeRpcProxy P2P Rpc Http Serialization System Transfers Logging Common Crypto BlockchainExplorer upnpc-static ${Boost_LIBRARIES})
|
|
|
|
target_link_libraries(UnitTests gtest_main Wallet TestGenerator CryptoNoteCore InProcessNode Transfers Serialization System Logging Common Crypto BlockchainExplorer ${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-05-27 12:08:46 +00:00
|
|
|
set_property(TARGET gtest gtest_main IntegrationTestLibrary IntegrationTests TestGenerator UnitTests 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)
|
|
|
|
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-05-27 12:08:46 +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)
|