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)
12 test/data/script_tests.json \
13 test/data/base58_keys_valid.json \
14 test/data/base58_encode_decode.json \
15 test/data/base58_keys_invalid.json \
16 test/data/tx_invalid.json \
17 test/data/tx_valid.json \
18 test/data/sighash.json
22 GENERATED_TEST_FILES = $(JSON_TEST_FILES:.json=.json.h) $(RAW_TEST_FILES:.raw=.raw.h)
24 # test_bitcoin binary #
26 test/arith_uint256_tests.cpp \
28 test/addrman_tests.cpp \
29 test/amount_tests.cpp \
30 test/allocator_tests.cpp \
31 test/base32_tests.cpp \
32 test/base58_tests.cpp \
33 test/base64_tests.cpp \
34 test/bech32_tests.cpp \
35 test/bip32_tests.cpp \
36 test/blockencodings_tests.cpp \
37 test/bloom_tests.cpp \
38 test/bswap_tests.cpp \
39 test/checkqueue_tests.cpp \
40 test/coins_tests.cpp \
41 test/compress_tests.cpp \
42 test/crypto_tests.cpp \
43 test/cuckoocache_tests.cpp \
45 test/getarg_tests.cpp \
48 test/limitedmap_tests.cpp \
49 test/dbwrapper_tests.cpp \
51 test/mempool_tests.cpp \
52 test/merkle_tests.cpp \
53 test/merkleblock_tests.cpp \
54 test/miner_tests.cpp \
55 test/multisig_tests.cpp \
57 test/netbase_tests.cpp \
59 test/policyestimator_tests.cpp \
61 test/prevector_tests.cpp \
62 test/raii_event_tests.cpp \
63 test/random_tests.cpp \
64 test/reverselock_tests.cpp \
66 test/sanity_tests.cpp \
67 test/scheduler_tests.cpp \
68 test/script_P2SH_tests.cpp \
69 test/script_tests.cpp \
70 test/script_standard_tests.cpp \
71 test/scriptnum_tests.cpp \
72 test/serialize_tests.cpp \
73 test/sighash_tests.cpp \
74 test/sigopcount_tests.cpp \
75 test/skiplist_tests.cpp \
76 test/streams_tests.cpp \
77 test/test_bitcoin.cpp \
79 test/test_bitcoin_main.cpp \
80 test/timedata_tests.cpp \
81 test/torcontrol_tests.cpp \
82 test/transaction_tests.cpp \
83 test/txvalidationcache_tests.cpp \
84 test/versionbits_tests.cpp \
85 test/uint256_tests.cpp \
86 test/univalue_tests.cpp \
91 wallet/test/wallet_test_fixture.cpp \
92 wallet/test/wallet_test_fixture.h \
93 wallet/test/accounting_tests.cpp \
94 wallet/test/wallet_tests.cpp \
95 wallet/test/crypto_tests.cpp
98 test_test_bitcoin_SOURCES = $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES)
99 test_test_bitcoin_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -I$(builddir)/test/ $(TESTDEFS) $(EVENT_CFLAGS)
100 test_test_bitcoin_LDADD =
102 test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET)
104 test_test_bitcoin_LDADD += $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) \
105 $(LIBLEVELDB) $(LIBLEVELDB_SSE42) $(LIBMEMENV) $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1) $(EVENT_LIBS) $(EVENT_PTHREADS_LIBS)
106 test_test_bitcoin_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
108 test_test_bitcoin_LDADD += $(LIBBITCOIN_CONSENSUS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS)
109 test_test_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) -static
112 test_test_bitcoin_LDADD += $(ZMQ_LIBS)
116 # test_bitcoin_fuzzy binary #
117 test_test_bitcoin_fuzzy_SOURCES = test/test_bitcoin_fuzzy.cpp
118 test_test_bitcoin_fuzzy_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
119 test_test_bitcoin_fuzzy_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
120 test_test_bitcoin_fuzzy_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
122 test_test_bitcoin_fuzzy_LDADD = \
124 $(LIBBITCOIN_SERVER) \
125 $(LIBBITCOIN_COMMON) \
127 $(LIBBITCOIN_CONSENSUS) \
128 $(LIBBITCOIN_CRYPTO) \
131 test_test_bitcoin_fuzzy_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS)
134 nodist_test_test_bitcoin_SOURCES = $(GENERATED_TEST_FILES)
136 $(BITCOIN_TESTS): $(GENERATED_TEST_FILES)
138 CLEAN_BITCOIN_TEST = test/*.gcda test/*.gcno $(GENERATED_TEST_FILES)
140 CLEANFILES += $(CLEAN_BITCOIN_TEST)
142 bitcoin_test: $(TEST_BINARY)
144 bitcoin_test_check: $(TEST_BINARY) FORCE
145 $(MAKE) check-TESTS TESTS=$^
147 bitcoin_test_clean : FORCE
148 rm -f $(CLEAN_BITCOIN_TEST) $(test_test_bitcoin_OBJECTS) $(TEST_BINARY)
151 @echo "Running test/util/bitcoin-util-test.py..."
152 $(PYTHON) $(top_builddir)/test/util/bitcoin-util-test.py
153 $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1 check
155 $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C univalue check
161 echo "namespace json_tests{" && \
162 echo "static unsigned const char $(*F)[] = {" && \
163 $(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' && \
165 } > "$@.new" && mv -f "$@.new" "$@"