2014-01-03 01:27:19 +00:00
|
|
|
cmake_policy(SET CMP0015 NEW)
|
|
|
|
|
|
|
|
aux_source_directory(. SRC_LIST)
|
2015-04-20 20:48:53 +00:00
|
|
|
|
|
|
|
macro (add_sources)
|
|
|
|
file (RELATIVE_PATH _relPath "${CMAKE_SOURCE_DIR}/test" "${CMAKE_CURRENT_SOURCE_DIR}")
|
|
|
|
foreach (_src ${ARGN})
|
|
|
|
if (_relPath)
|
|
|
|
list (APPEND SRC "${_relPath}/${_src}")
|
|
|
|
else()
|
|
|
|
list (APPEND SRC "${_src}")
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
if (_relPath)
|
|
|
|
# propagate SRCS to parent directory
|
|
|
|
set (SRC ${SRC} PARENT_SCOPE)
|
|
|
|
endif()
|
|
|
|
endmacro()
|
|
|
|
|
|
|
|
add_subdirectory(fuzzTesting)
|
|
|
|
add_subdirectory(libdevcore)
|
|
|
|
add_subdirectory(libdevcrypto)
|
|
|
|
add_subdirectory(libethcore)
|
|
|
|
add_subdirectory(libethereum)
|
|
|
|
add_subdirectory(libevm)
|
|
|
|
add_subdirectory(libnatspec)
|
|
|
|
add_subdirectory(libp2p)
|
2015-06-01 09:09:38 +00:00
|
|
|
add_subdirectory(external-dependencies)
|
2015-04-30 11:27:55 +00:00
|
|
|
|
|
|
|
if (JSCONSOLE)
|
|
|
|
add_subdirectory(libjsengine)
|
|
|
|
endif()
|
2015-04-27 19:42:51 +00:00
|
|
|
|
2015-04-21 09:45:33 +00:00
|
|
|
if (SOLIDITY)
|
|
|
|
add_subdirectory(libsolidity)
|
|
|
|
endif ()
|
|
|
|
if (JSONRPC)
|
2015-04-20 20:48:53 +00:00
|
|
|
add_subdirectory(libweb3jsonrpc)
|
2015-04-21 09:45:33 +00:00
|
|
|
endif ()
|
2015-04-20 20:48:53 +00:00
|
|
|
add_subdirectory(libwhisper)
|
|
|
|
|
|
|
|
set(SRC_LIST ${SRC_LIST} ${SRC})
|
2014-01-07 21:51:19 +00:00
|
|
|
|
2015-02-23 11:26:31 +00:00
|
|
|
include_directories(BEFORE ${JSONCPP_INCLUDE_DIRS})
|
|
|
|
include_directories(BEFORE ..)
|
2014-12-17 15:47:22 +00:00
|
|
|
include_directories(${Boost_INCLUDE_DIRS})
|
2014-11-20 09:55:36 +00:00
|
|
|
include_directories(${CRYPTOPP_INCLUDE_DIRS})
|
2014-12-08 23:58:02 +00:00
|
|
|
include_directories(${JSON_RPC_CPP_INCLUDE_DIRS})
|
2015-04-30 11:27:55 +00:00
|
|
|
|
|
|
|
if (JSCONSOLE)
|
|
|
|
include_directories(${V8_INCLUDE_DIRS})
|
|
|
|
endif()
|
2015-02-23 11:26:31 +00:00
|
|
|
|
2015-03-27 12:11:24 +00:00
|
|
|
# search for test names and create ctest tests
|
2015-04-20 21:17:19 +00:00
|
|
|
enable_testing()
|
|
|
|
foreach(file ${SRC_LIST})
|
|
|
|
file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/${file} test_list_raw REGEX "BOOST_.*TEST_(SUITE|CASE)")
|
|
|
|
set(TestSuite "DEFAULT")
|
|
|
|
foreach(test_raw ${test_list_raw})
|
|
|
|
string(REGEX REPLACE ".*TEST_(SUITE|CASE)\\(([^ ,\\)]*).*" "\\1 \\2" test ${test_raw})
|
|
|
|
if(test MATCHES "^SUITE .*")
|
|
|
|
string(SUBSTRING ${test} 6 -1 TestSuite)
|
|
|
|
elseif(test MATCHES "^CASE .*")
|
|
|
|
string(SUBSTRING ${test} 5 -1 TestCase)
|
|
|
|
add_test(NAME ${TestSuite}/${TestCase} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/test COMMAND testeth -t ${TestSuite}/${TestCase})
|
|
|
|
endif(test MATCHES "^SUITE .*")
|
|
|
|
endforeach(test_raw)
|
|
|
|
endforeach(file)
|
2014-01-03 01:27:19 +00:00
|
|
|
|
2014-10-16 13:10:54 +00:00
|
|
|
file(GLOB HEADERS "*.h")
|
|
|
|
add_executable(testeth ${SRC_LIST} ${HEADERS})
|
2014-06-28 17:23:32 +00:00
|
|
|
|
2014-12-15 18:01:20 +00:00
|
|
|
target_link_libraries(testeth ${Boost_UNIT_TEST_FRAMEWORK_LIBRARIES})
|
2014-12-12 12:13:29 +00:00
|
|
|
target_link_libraries(testeth ${CURL_LIBRARIES})
|
2015-07-03 10:16:47 +00:00
|
|
|
target_link_libraries(testeth ${CRYPTOPP_LIBRARIES})
|
2014-07-03 13:00:22 +00:00
|
|
|
target_link_libraries(testeth ethereum)
|
|
|
|
target_link_libraries(testeth ethcore)
|
2015-07-16 07:52:04 +00:00
|
|
|
target_link_libraries(testeth secp256k1)
|
2015-04-30 11:27:55 +00:00
|
|
|
|
|
|
|
if (JSCONSOLE)
|
|
|
|
target_link_libraries(testeth jsengine)
|
|
|
|
endif()
|
|
|
|
|
2015-04-05 15:46:12 +00:00
|
|
|
if (SOLIDITY)
|
|
|
|
target_link_libraries(testeth solidity)
|
|
|
|
endif ()
|
2015-04-30 11:27:55 +00:00
|
|
|
|
2015-03-25 09:59:46 +00:00
|
|
|
target_link_libraries(testeth testutils)
|
2015-04-30 11:27:55 +00:00
|
|
|
|
2015-04-06 00:30:50 +00:00
|
|
|
if (GUI AND NOT JUSTTESTS)
|
2015-02-23 11:26:31 +00:00
|
|
|
target_link_libraries(testeth webthree)
|
|
|
|
target_link_libraries(testeth natspec)
|
|
|
|
endif()
|
2015-04-30 11:27:55 +00:00
|
|
|
|
2014-12-11 14:06:11 +00:00
|
|
|
if (JSONRPC)
|
2014-11-06 09:41:37 +00:00
|
|
|
target_link_libraries(testeth web3jsonrpc)
|
2014-12-12 12:13:29 +00:00
|
|
|
target_link_libraries(testeth ${JSON_RPC_CPP_CLIENT_LIBRARIES})
|
2014-10-24 12:21:20 +00:00
|
|
|
endif()
|
2014-01-03 01:27:19 +00:00
|
|
|
|
2015-03-25 09:59:46 +00:00
|
|
|
enable_testing()
|
|
|
|
set(CTEST_OUTPUT_ON_FAILURE TRUE)
|
|
|
|
|
|
|
|
include(EthUtils)
|
|
|
|
|
|
|
|
eth_add_test(ClientBase
|
|
|
|
ARGS --eth_testfile=BlockTests/bcJS_API_Test --eth_threads=1
|
|
|
|
ARGS --eth_testfile=BlockTests/bcJS_API_Test --eth_threads=3
|
|
|
|
ARGS --eth_testfile=BlockTests/bcJS_API_Test --eth_threads=10
|
|
|
|
ARGS --eth_testfile=BlockTests/bcValidBlockTest --eth_threads=1
|
|
|
|
ARGS --eth_testfile=BlockTests/bcValidBlockTest --eth_threads=3
|
|
|
|
ARGS --eth_testfile=BlockTests/bcValidBlockTest --eth_threads=10
|
|
|
|
)
|
|
|
|
|
|
|
|
eth_add_test(JsonRpc
|
2015-05-13 08:45:18 +00:00
|
|
|
ARGS --eth_testfile=BlockTests/bcJS_API_Test
|
2015-03-25 09:59:46 +00:00
|
|
|
ARGS --eth_testfile=BlockTests/bcValidBlockTest
|
|
|
|
)
|
2015-05-13 08:45:18 +00:00
|
|
|
|