1 # Copyright (c) 2013-2016 The Bitcoin Core developers
2 # Distributed under the MIT software license, see the accompanying
3 # file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 TESTS += test/test_bitcoin
6 bin_PROGRAMS += test/test_bitcoin
7 noinst_PROGRAMS += test/test_bitcoin_fuzzy
9 TEST_BINARY=test/test_bitcoin$(EXEEXT)
14 test/bitcoin-util-test.py \
15 test/data/bitcoin-util-test.json \
16 test/data/blanktxv1.hex \
17 test/data/blanktxv1.json \
18 test/data/blanktxv2.hex \
19 test/data/blanktxv2.json \
20 test/data/tt-delin1-out.hex \
21 test/data/tt-delin1-out.json \
22 test/data/tt-delout1-out.hex \
23 test/data/tt-delout1-out.json \
24 test/data/tt-locktime317000-out.hex \
25 test/data/tt-locktime317000-out.json \
26 test/data/tx394b54bb.hex \
27 test/data/txcreate1.hex \
28 test/data/txcreate1.json \
29 test/data/txcreate2.hex \
30 test/data/txcreate2.json \
31 test/data/txcreatedata1.hex \
32 test/data/txcreatedata1.json \
33 test/data/txcreatedata2.hex \
34 test/data/txcreatedata2.json \
35 test/data/txcreatedata_seq0.hex \
36 test/data/txcreatedata_seq0.json \
37 test/data/txcreatedata_seq1.hex \
38 test/data/txcreatedata_seq1.json \
39 test/data/txcreatemultisig1.hex \
40 test/data/txcreatemultisig1.json \
41 test/data/txcreatemultisig2.hex \
42 test/data/txcreatemultisig2.json \
43 test/data/txcreatemultisig3.hex \
44 test/data/txcreatemultisig3.json \
45 test/data/txcreatemultisig4.hex \
46 test/data/txcreatemultisig4.json \
47 test/data/txcreateoutpubkey1.hex \
48 test/data/txcreateoutpubkey1.json \
49 test/data/txcreateoutpubkey2.hex \
50 test/data/txcreateoutpubkey2.json \
51 test/data/txcreateoutpubkey3.hex \
52 test/data/txcreateoutpubkey3.json \
53 test/data/txcreatescript1.hex \
54 test/data/txcreatescript1.json \
55 test/data/txcreatescript2.hex \
56 test/data/txcreatescript2.json \
57 test/data/txcreatescript3.hex \
58 test/data/txcreatescript3.json \
59 test/data/txcreatescript4.hex \
60 test/data/txcreatescript4.json \
61 test/data/txcreatesignv1.hex \
62 test/data/txcreatesignv1.json \
63 test/data/txcreatesignv2.hex
66 test/data/script_tests.json \
67 test/data/base58_keys_valid.json \
68 test/data/base58_encode_decode.json \
69 test/data/base58_keys_invalid.json \
70 test/data/tx_invalid.json \
71 test/data/tx_valid.json \
72 test/data/sighash.json
76 GENERATED_TEST_FILES = $(JSON_TEST_FILES:.json=.json.h) $(RAW_TEST_FILES:.raw=.raw.h)
78 # test_bitcoin binary #
80 test/arith_uint256_tests.cpp \
82 test/addrman_tests.cpp \
83 test/amount_tests.cpp \
84 test/allocator_tests.cpp \
85 test/base32_tests.cpp \
86 test/base58_tests.cpp \
87 test/base64_tests.cpp \
88 test/bip32_tests.cpp \
89 test/blockencodings_tests.cpp \
90 test/bloom_tests.cpp \
91 test/bswap_tests.cpp \
92 test/coins_tests.cpp \
93 test/compress_tests.cpp \
94 test/crypto_tests.cpp \
95 test/cuckoocache_tests.cpp \
97 test/getarg_tests.cpp \
100 test/limitedmap_tests.cpp \
101 test/dbwrapper_tests.cpp \
102 test/main_tests.cpp \
103 test/mempool_tests.cpp \
104 test/merkle_tests.cpp \
105 test/miner_tests.cpp \
106 test/multisig_tests.cpp \
108 test/netbase_tests.cpp \
110 test/policyestimator_tests.cpp \
112 test/prevector_tests.cpp \
113 test/random_tests.cpp \
114 test/raii_event_tests.cpp \
115 test/reverselock_tests.cpp \
117 test/sanity_tests.cpp \
118 test/scheduler_tests.cpp \
119 test/script_P2SH_tests.cpp \
120 test/script_tests.cpp \
121 test/scriptnum_tests.cpp \
122 test/serialize_tests.cpp \
123 test/sighash_tests.cpp \
124 test/sigopcount_tests.cpp \
125 test/skiplist_tests.cpp \
126 test/streams_tests.cpp \
127 test/test_bitcoin.cpp \
128 test/test_bitcoin.h \
132 test/timedata_tests.cpp \
133 test/transaction_tests.cpp \
134 test/txvalidationcache_tests.cpp \
135 test/versionbits_tests.cpp \
136 test/uint256_tests.cpp \
137 test/univalue_tests.cpp \
142 wallet/test/wallet_test_fixture.cpp \
143 wallet/test/wallet_test_fixture.h \
144 wallet/test/accounting_tests.cpp \
145 wallet/test/wallet_tests.cpp \
146 wallet/test/crypto_tests.cpp
149 test_test_bitcoin_SOURCES = $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES)
150 test_test_bitcoin_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -I$(builddir)/test/ $(TESTDEFS) $(EVENT_CFLAGS)
151 test_test_bitcoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \
152 $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1) $(EVENT_LIBS)
153 test_test_bitcoin_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
155 test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET)
158 test_test_bitcoin_LDADD += $(LIBBITCOIN_CONSENSUS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS)
159 test_test_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) -static
162 test_test_bitcoin_LDADD += $(ZMQ_LIBS)
166 # test_bitcoin_fuzzy binary #
167 test_test_bitcoin_fuzzy_SOURCES = test/test_bitcoin_fuzzy.cpp
168 test_test_bitcoin_fuzzy_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
169 test_test_bitcoin_fuzzy_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
170 test_test_bitcoin_fuzzy_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
172 test_test_bitcoin_fuzzy_LDADD = \
174 $(LIBBITCOIN_SERVER) \
175 $(LIBBITCOIN_COMMON) \
177 $(LIBBITCOIN_CONSENSUS) \
178 $(LIBBITCOIN_CRYPTO) \
181 test_test_bitcoin_fuzzy_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS)
184 nodist_test_test_bitcoin_SOURCES = $(GENERATED_TEST_FILES)
186 $(BITCOIN_TESTS): $(GENERATED_TEST_FILES)
188 CLEAN_BITCOIN_TEST = test/*.gcda test/*.gcno $(GENERATED_TEST_FILES)
190 CLEANFILES += $(CLEAN_BITCOIN_TEST)
192 # This file is problematic for out-of-tree builds if it exists.
193 DISTCLEANFILES += test/buildenv.pyc
195 bitcoin_test: $(TEST_BINARY)
197 bitcoin_test_check: $(TEST_BINARY) FORCE
198 $(MAKE) check-TESTS TESTS=$^
200 bitcoin_test_clean : FORCE
201 rm -f $(CLEAN_BITCOIN_TEST) $(test_test_bitcoin_OBJECTS) $(TEST_BINARY)
204 @echo "Running test/bitcoin-util-test.py..."
205 $(AM_V_at)srcdir=$(srcdir) PYTHONPATH=$(builddir)/test $(PYTHON) $(srcdir)/test/bitcoin-util-test.py
206 $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1 check
208 $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C univalue check
214 echo "namespace json_tests{" && \
215 echo "static unsigned const char $(*F)[] = {" && \
216 $(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' && \
218 } > "$@.new" && mv -f "$@.new" "$@"