1 # Copyright (c) 2016-2019 The Zcash developers
2 # Copyright (c) 2013-2019 The Bitcoin Core developers
3 # Copyright (c) 2013-2019 Bitcoin Developers
4 # Distributed under the MIT software license, see the accompanying
5 # file COPYING or https://www.opensource.org/licenses/mit-license.php .
7 TESTS += test/test_bitcoin
8 noinst_PROGRAMS += test/test_bitcoin
10 TEST_BINARY=test/test_bitcoin$(EXEEXT)
15 test/bitcoin-util-test.py \
16 test/data/bitcoin-util-test.json \
17 test/data/blanktx.hex \
18 test/data/tt-delin1-out.hex \
19 test/data/tt-delout1-out.hex \
20 test/data/tt-locktime317000-out.hex \
21 test/data/tx394b54bb.hex \
22 test/data/txcreate1.hex \
23 test/data/txcreate2.hex \
24 test/data/txcreatesign.hex \
25 test/wallet-utility.py \
29 test/data/script_valid.json \
30 test/data/base58_keys_valid.json \
31 test/data/base58_encode_decode.json \
32 test/data/base58_keys_invalid.json \
33 test/data/script_invalid.json \
34 test/data/tx_invalid.json \
35 test/data/tx_valid.json \
36 test/data/sighash.json \
37 test/data/merkle_roots.json \
38 test/data/merkle_roots_empty.json \
39 test/data/merkle_serialization.json \
40 test/data/merkle_witness_serialization.json \
41 test/data/merkle_path.json \
42 test/data/merkle_commitments.json \
43 test/data/merkle_roots_sapling.json \
44 test/data/merkle_roots_empty_sapling.json \
45 test/data/merkle_serialization_sapling.json \
46 test/data/merkle_witness_serialization_sapling.json \
47 test/data/merkle_path_sapling.json \
48 test/data/merkle_commitments_sapling.json \
49 test/data/g1_compressed.json \
50 test/data/g2_compressed.json \
51 test/data/sapling_key_components.json
53 RAW_TEST_FILES = test/data/alertTests.raw
55 GENERATED_TEST_FILES = $(JSON_TEST_FILES:.json=.json.h) $(RAW_TEST_FILES:.raw=.raw.h)
58 test/arith_uint256_tests.cpp \
60 test/addrman_tests.cpp \
61 test/alert_tests.cpp \
62 test/allocator_tests.cpp \
63 test/base32_tests.cpp \
64 test/base58_tests.cpp \
65 test/base64_tests.cpp \
66 test/bech32_tests.cpp \
67 test/bip32_tests.cpp \
68 test/bloom_tests.cpp \
69 test/checkblock_tests.cpp \
70 test/Checkpoints_tests.cpp \
71 test/coins_tests.cpp \
72 test/compress_tests.cpp \
73 test/convertbits_tests.cpp \
74 test/crypto_tests.cpp \
76 test/equihash_tests.cpp \
77 test/getarg_tests.cpp \
80 test/dbwrapper_tests.cpp \
82 test/mempool_tests.cpp \
83 test/miner_tests.cpp \
84 test/mruset_tests.cpp \
85 test/multisig_tests.cpp \
86 test/netbase_tests.cpp \
88 test/policyestimator_tests.cpp \
90 test/prevector_tests.cpp \
91 test/raii_event_tests.cpp \
92 test/reverselock_tests.cpp \
94 test/sanity_tests.cpp \
95 test/scheduler_tests.cpp \
96 test/script_P2SH_tests.cpp \
97 test/script_P2PKH_tests.cpp \
98 test/script_tests.cpp \
99 test/scriptnum_tests.cpp \
100 test/serialize_tests.cpp \
101 test/sighash_tests.cpp \
102 test/sigopcount_tests.cpp \
103 test/skiplist_tests.cpp \
104 test/test_bitcoin.cpp \
105 test/test_bitcoin.h \
106 test/timedata_tests.cpp \
107 test/torcontrol_tests.cpp \
108 test/transaction_tests.cpp \
109 test/uint256_tests.cpp \
110 test/univalue_tests.cpp \
111 test/util_tests.cpp \
112 test/sha256compress_tests.cpp
116 test/accounting_tests.cpp \
117 wallet/test/wallet_tests.cpp \
118 test/rpc_wallet_tests.cpp
121 test_test_bitcoin_SOURCES = $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES)
122 test_test_bitcoin_CPPFLAGS = $(AM_CPPFLAGS) -fopenmp $(BITCOIN_INCLUDES) -I$(builddir)/test/ $(TESTDEFS) $(EVENT_CFLAGS)
123 test_test_bitcoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBVERUS_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \
124 $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS)
125 test_test_bitcoin_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
127 test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET)
129 test_test_bitcoin_LDADD += $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) \
130 $(LIBLEVELDB) $(LIBMEMENV) $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1) $(EVENT_LIBS) $(EVENT_PTHREADS_LIBS)
131 test_test_bitcoin_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
133 test_test_bitcoin_LDADD += $(LIBZCASH_CONSENSUS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(LIBZCASH) $(LIBSNARK) $(LIBZCASH_LIBS)
134 test_test_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) -static
137 test_test_bitcoin_LDADD += $(ZMQ_LIBS)
141 test_test_bitcoin_LDADD += $(PROTON_LIBS)
144 nodist_test_test_bitcoin_SOURCES = $(GENERATED_TEST_FILES)
146 $(BITCOIN_TESTS): $(GENERATED_TEST_FILES)
148 CLEAN_BITCOIN_TEST = test/*.gcda test/*.gcno $(GENERATED_TEST_FILES)
150 CLEANFILES += $(CLEAN_BITCOIN_TEST)
152 bitcoin_test: $(TEST_BINARY)
154 bitcoin_test_check: $(TEST_BINARY) FORCE
155 $(MAKE) check-TESTS TESTS=$^
157 bitcoin_test_clean : FORCE
158 rm -f $(CLEAN_BITCOIN_TEST) $(test_test_bitcoin_OBJECTS) $(TEST_BINARY)
161 @echo "Running test/bitcoin-util-test.py..."
162 $(AM_V_at)srcdir=$(srcdir) PYTHONPATH=$(builddir)/test $(srcdir)/test/bitcoin-util-test.py
164 @echo "Running test/wallet-utility.py..."
165 $(AM_V_at)srcdir=$(srcdir) PYTHONPATH=$(builddir)/test $(srcdir)/test/wallet-utility.py
167 $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1 check
168 $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C univalue check
172 @echo "namespace json_tests{" > $@
173 @echo "static unsigned const char $(*F)[] = {" >> $@
174 @$(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' >> $@
180 @echo "namespace alert_tests{" > $@
181 @echo "static unsigned const char $(*F)[] = {" >> $@
182 @$(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' >> $@