Add Pieter's old signed commits to revsig-commits
[bitcoinplatinum.git] / src / Makefile.test.include
blob4d44b35bb618434174a8f7846287808eefcb8712
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
8 TEST_SRCDIR = test
9 TEST_BINARY=test/test_bitcoin$(EXEEXT)
12 EXTRA_DIST += \
13         test/bctest.py \
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
65 JSON_TEST_FILES = \
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
74 RAW_TEST_FILES =
76 GENERATED_TEST_FILES = $(JSON_TEST_FILES:.json=.json.h) $(RAW_TEST_FILES:.raw=.raw.h)
78 # test_bitcoin binary #
79 BITCOIN_TESTS =\
80   test/arith_uint256_tests.cpp \
81   test/scriptnum10.h \
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 \
96   test/DoS_tests.cpp \
97   test/getarg_tests.cpp \
98   test/hash_tests.cpp \
99   test/key_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 \
107   test/net_tests.cpp \
108   test/netbase_tests.cpp \
109   test/pmt_tests.cpp \
110   test/policyestimator_tests.cpp \
111   test/pow_tests.cpp \
112   test/prevector_tests.cpp \
113   test/raii_event_tests.cpp \
114   test/reverselock_tests.cpp \
115   test/rpc_tests.cpp \
116   test/sanity_tests.cpp \
117   test/scheduler_tests.cpp \
118   test/script_P2SH_tests.cpp \
119   test/script_tests.cpp \
120   test/scriptnum_tests.cpp \
121   test/serialize_tests.cpp \
122   test/sighash_tests.cpp \
123   test/sigopcount_tests.cpp \
124   test/skiplist_tests.cpp \
125   test/streams_tests.cpp \
126   test/test_bitcoin.cpp \
127   test/test_bitcoin.h \
128   test/test_random.h \
129   test/testutil.cpp \
130   test/testutil.h \
131   test/timedata_tests.cpp \
132   test/transaction_tests.cpp \
133   test/txvalidationcache_tests.cpp \
134   test/versionbits_tests.cpp \
135   test/uint256_tests.cpp \
136   test/univalue_tests.cpp \
137   test/util_tests.cpp
139 if ENABLE_WALLET
140 BITCOIN_TESTS += \
141   wallet/test/wallet_test_fixture.cpp \
142   wallet/test/wallet_test_fixture.h \
143   wallet/test/accounting_tests.cpp \
144   wallet/test/wallet_tests.cpp \
145   wallet/test/crypto_tests.cpp
146 endif
148 test_test_bitcoin_SOURCES = $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES)
149 test_test_bitcoin_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -I$(builddir)/test/ $(TESTDEFS) $(EVENT_CFLAGS)
150 test_test_bitcoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \
151   $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1) $(EVENT_LIBS)
152 test_test_bitcoin_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
153 if ENABLE_WALLET
154 test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET)
155 endif
157 test_test_bitcoin_LDADD += $(LIBBITCOIN_CONSENSUS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS)
158 test_test_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) -static
160 if ENABLE_ZMQ
161 test_test_bitcoin_LDADD += $(ZMQ_LIBS)
162 endif
165 # test_bitcoin_fuzzy binary #
166 test_test_bitcoin_fuzzy_SOURCES = test/test_bitcoin_fuzzy.cpp
167 test_test_bitcoin_fuzzy_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
168 test_test_bitcoin_fuzzy_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
169 test_test_bitcoin_fuzzy_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
171 test_test_bitcoin_fuzzy_LDADD = \
172   $(LIBUNIVALUE) \
173   $(LIBBITCOIN_SERVER) \
174   $(LIBBITCOIN_COMMON) \
175   $(LIBBITCOIN_UTIL) \
176   $(LIBBITCOIN_CONSENSUS) \
177   $(LIBBITCOIN_CRYPTO) \
178   $(LIBSECP256K1)
180 test_test_bitcoin_fuzzy_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS)
183 nodist_test_test_bitcoin_SOURCES = $(GENERATED_TEST_FILES)
185 $(BITCOIN_TESTS): $(GENERATED_TEST_FILES)
187 CLEAN_BITCOIN_TEST = test/*.gcda test/*.gcno $(GENERATED_TEST_FILES)
189 CLEANFILES += $(CLEAN_BITCOIN_TEST)
191 # This file is problematic for out-of-tree builds if it exists.
192 DISTCLEANFILES += test/buildenv.pyc
194 bitcoin_test: $(TEST_BINARY)
196 bitcoin_test_check: $(TEST_BINARY) FORCE
197         $(MAKE) check-TESTS TESTS=$^
199 bitcoin_test_clean : FORCE
200         rm -f $(CLEAN_BITCOIN_TEST) $(test_test_bitcoin_OBJECTS) $(TEST_BINARY)
202 check-local:
203         @echo "Running test/bitcoin-util-test.py..."
204         $(AM_V_at)srcdir=$(srcdir) PYTHONPATH=$(builddir)/test $(PYTHON) $(srcdir)/test/bitcoin-util-test.py
205         $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1 check
206 if EMBEDDED_UNIVALUE
207         $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C univalue check
208 endif
210 %.json.h: %.json
211         @$(MKDIR_P) $(@D)
212         @{ \
213          echo "namespace json_tests{" && \
214          echo "static unsigned const char $(*F)[] = {" && \
215          $(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x  ,//g' && \
216          echo "};};"; \
217         } > "$@.new" && mv -f "$@.new" "$@"
218         @echo "Generated $@"