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/bip32_tests.cpp \
35 test/blockencodings_tests.cpp \
36 test/bloom_tests.cpp \
37 test/bswap_tests.cpp \
38 test/checkqueue_tests.cpp \
39 test/coins_tests.cpp \
40 test/compress_tests.cpp \
41 test/crypto_tests.cpp \
42 test/cuckoocache_tests.cpp \
44 test/getarg_tests.cpp \
47 test/limitedmap_tests.cpp \
48 test/dbwrapper_tests.cpp \
50 test/mempool_tests.cpp \
51 test/merkle_tests.cpp \
52 test/miner_tests.cpp \
53 test/multisig_tests.cpp \
55 test/netbase_tests.cpp \
57 test/policyestimator_tests.cpp \
59 test/prevector_tests.cpp \
60 test/raii_event_tests.cpp \
61 test/random_tests.cpp \
62 test/reverselock_tests.cpp \
64 test/sanity_tests.cpp \
65 test/scheduler_tests.cpp \
66 test/script_P2SH_tests.cpp \
67 test/script_tests.cpp \
68 test/scriptnum_tests.cpp \
69 test/serialize_tests.cpp \
70 test/sighash_tests.cpp \
71 test/sigopcount_tests.cpp \
72 test/skiplist_tests.cpp \
73 test/streams_tests.cpp \
74 test/test_bitcoin.cpp \
76 test/test_bitcoin_main.cpp \
77 test/timedata_tests.cpp \
78 test/torcontrol_tests.cpp \
79 test/transaction_tests.cpp \
80 test/txvalidationcache_tests.cpp \
81 test/versionbits_tests.cpp \
82 test/uint256_tests.cpp \
83 test/univalue_tests.cpp \
88 wallet/test/wallet_test_fixture.cpp \
89 wallet/test/wallet_test_fixture.h \
90 wallet/test/accounting_tests.cpp \
91 wallet/test/wallet_tests.cpp \
92 wallet/test/crypto_tests.cpp
95 test_test_bitcoin_SOURCES = $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES)
96 test_test_bitcoin_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -I$(builddir)/test/ $(TESTDEFS) $(EVENT_CFLAGS)
97 test_test_bitcoin_LDADD =
99 test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET)
101 test_test_bitcoin_LDADD += $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) \
102 $(LIBLEVELDB) $(LIBLEVELDB_SSE42) $(LIBMEMENV) $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1) $(EVENT_LIBS) $(EVENT_PTHREADS_LIBS)
103 test_test_bitcoin_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
105 test_test_bitcoin_LDADD += $(LIBBITCOIN_CONSENSUS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS)
106 test_test_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) -static
109 test_test_bitcoin_LDADD += $(ZMQ_LIBS)
113 # test_bitcoin_fuzzy binary #
114 test_test_bitcoin_fuzzy_SOURCES = test/test_bitcoin_fuzzy.cpp
115 test_test_bitcoin_fuzzy_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
116 test_test_bitcoin_fuzzy_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
117 test_test_bitcoin_fuzzy_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
119 test_test_bitcoin_fuzzy_LDADD = \
121 $(LIBBITCOIN_SERVER) \
122 $(LIBBITCOIN_COMMON) \
124 $(LIBBITCOIN_CONSENSUS) \
125 $(LIBBITCOIN_CRYPTO) \
128 test_test_bitcoin_fuzzy_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS)
131 nodist_test_test_bitcoin_SOURCES = $(GENERATED_TEST_FILES)
133 $(BITCOIN_TESTS): $(GENERATED_TEST_FILES)
135 CLEAN_BITCOIN_TEST = test/*.gcda test/*.gcno $(GENERATED_TEST_FILES)
137 CLEANFILES += $(CLEAN_BITCOIN_TEST)
139 bitcoin_test: $(TEST_BINARY)
141 bitcoin_test_check: $(TEST_BINARY) FORCE
142 $(MAKE) check-TESTS TESTS=$^
144 bitcoin_test_clean : FORCE
145 rm -f $(CLEAN_BITCOIN_TEST) $(test_test_bitcoin_OBJECTS) $(TEST_BINARY)
148 @echo "Running test/util/bitcoin-util-test.py..."
149 $(top_builddir)/test/util/bitcoin-util-test.py
150 $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1 check
152 $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C univalue check
158 echo "namespace json_tests{" && \
159 echo "static unsigned const char $(*F)[] = {" && \
160 $(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' && \
162 } > "$@.new" && mv -f "$@.new" "$@"