2018-02-14 14:26:28 +01:00
|
|
|
# This file is part of the Flowee project
|
2021-06-20 22:44:44 +02:00
|
|
|
# Copyright (C) 2018 Tom Zander <tom@flowee.org>
|
2018-02-14 14:26:28 +01:00
|
|
|
#
|
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
# (at your option) any later version.
|
|
|
|
|
#
|
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
#
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
2018-02-10 14:59:45 +01:00
|
|
|
project (test)
|
|
|
|
|
|
2018-12-28 12:10:28 +01:00
|
|
|
# for some reason someone thought it was useful to compile the json files into the exe
|
|
|
|
|
# instead of just reading them at runtime.
|
|
|
|
|
# lets emulate that for now.
|
|
|
|
|
find_program(HEXDUMP "hexdump")
|
|
|
|
|
find_program(SED "sed")
|
|
|
|
|
foreach (JSON_FILE
|
|
|
|
|
data/sighash.json)
|
|
|
|
|
|
|
|
|
|
# generate 'sighash' array from 'data/sighash.json'
|
|
|
|
|
get_filename_component(JSON_NAME ${JSON_FILE} NAME_WE)
|
|
|
|
|
if (EXISTS "${CMAKE_CURRENT_BINARY_DIR}/${JSON_FILE}.h")
|
|
|
|
|
continue()
|
|
|
|
|
endif ()
|
|
|
|
|
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${JSON_FILE}.h "namespace json_tests{ static unsigned const char ${JSON_NAME}[] = {")
|
|
|
|
|
# generate a C++ compatible hex format of the input file.
|
|
|
|
|
execute_process(COMMAND ${HEXDUMP} -v -e "8/1 \"0x%02x, \"" -e "\"\n\"" ${CMAKE_CURRENT_SOURCE_DIR}/${JSON_FILE}
|
|
|
|
|
OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/${JSON_FILE}.hex
|
|
|
|
|
)
|
|
|
|
|
execute_process(COMMAND ${SED} -e "s/0x ,//g"
|
|
|
|
|
INPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/${JSON_FILE}.hex
|
|
|
|
|
OUTPUT_VARIABLE HEXDATA)
|
|
|
|
|
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/${JSON_FILE}.h "${HEXDATA}};};")
|
|
|
|
|
endforeach ()
|
|
|
|
|
|
|
|
|
|
|
2019-11-13 11:46:09 +01:00
|
|
|
include_directories(.. ${LIBAPI_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR}/include)
|
2018-02-10 14:59:45 +01:00
|
|
|
|
|
|
|
|
set (TEST_LIBS
|
2022-02-22 18:27:48 +01:00
|
|
|
hub_api
|
|
|
|
|
hub_server
|
2018-02-10 14:59:45 +01:00
|
|
|
flowee_utils
|
|
|
|
|
flowee_crypto
|
|
|
|
|
|
|
|
|
|
${OPENSSL_LIBRARIES}
|
|
|
|
|
${ZMQ_LIBRARIES}
|
|
|
|
|
${Event_LIBRARIES}
|
|
|
|
|
${BERKELEY_DB_LIBRARIES}
|
|
|
|
|
${MINIUPNP_LIBRARY}
|
|
|
|
|
Threads::Threads
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
set (TEST_SOURCES
|
2018-05-09 10:41:30 +02:00
|
|
|
../flowee_tests.cpp
|
2018-02-10 14:59:45 +01:00
|
|
|
Checkpoints_tests.cpp
|
|
|
|
|
compress_tests.cpp
|
2018-08-10 12:33:29 +03:00
|
|
|
cuckoocache_tests.cpp
|
2018-02-10 14:59:45 +01:00
|
|
|
dbwrapper_tests.cpp
|
|
|
|
|
DoS_tests.cpp
|
|
|
|
|
getarg_tests.cpp
|
|
|
|
|
hash_tests.cpp
|
|
|
|
|
key_tests.cpp
|
|
|
|
|
limitedmap_tests.cpp
|
|
|
|
|
main_tests.cpp
|
|
|
|
|
mempool_tests.cpp
|
|
|
|
|
miner_tests.cpp
|
|
|
|
|
netbase_tests.cpp
|
|
|
|
|
rpc_tests.cpp
|
|
|
|
|
sanity_tests.cpp
|
|
|
|
|
sighash_tests.cpp
|
|
|
|
|
skiplist_tests.cpp
|
|
|
|
|
test_bitcoin.cpp
|
|
|
|
|
thinblock_tests.cpp
|
|
|
|
|
timedata_tests.cpp
|
|
|
|
|
transaction_utils.cpp
|
|
|
|
|
txvalidationcache_tests.cpp
|
|
|
|
|
uahf_tests.cpp
|
|
|
|
|
util_tests.cpp
|
|
|
|
|
)
|
|
|
|
|
|
2020-08-16 11:10:43 +02:00
|
|
|
add_executable(test_hubOld ${TEST_SOURCES} ${TEST_SOURCES_WALLET})
|
2018-02-10 14:59:45 +01:00
|
|
|
|
2020-08-16 11:10:43 +02:00
|
|
|
target_link_libraries(test_hubOld ${TEST_LIBS})
|
2018-02-10 14:59:45 +01:00
|
|
|
|
2020-08-16 11:10:43 +02:00
|
|
|
add_test(NAME HUB_tests COMMAND test_hubOld)
|