Fix parameter naming inconsistencies between .h and .cpp files
[bitcoinplatinum.git] / src / Makefile.test.include
blobcfd08b8238046d4f14901b822eee9c8a361e89c4
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/checkqueue_tests.cpp \
93   test/coins_tests.cpp \
94   test/compress_tests.cpp \
95   test/crypto_tests.cpp \
96   test/cuckoocache_tests.cpp \
97   test/DoS_tests.cpp \
98   test/getarg_tests.cpp \
99   test/hash_tests.cpp \
100   test/key_tests.cpp \
101   test/limitedmap_tests.cpp \
102   test/dbwrapper_tests.cpp \
103   test/main_tests.cpp \
104   test/mempool_tests.cpp \
105   test/merkle_tests.cpp \
106   test/miner_tests.cpp \
107   test/multisig_tests.cpp \
108   test/net_tests.cpp \
109   test/netbase_tests.cpp \
110   test/pmt_tests.cpp \
111   test/policyestimator_tests.cpp \
112   test/pow_tests.cpp \
113   test/prevector_tests.cpp \
114   test/random_tests.cpp \
115   test/raii_event_tests.cpp \
116   test/reverselock_tests.cpp \
117   test/rpc_tests.cpp \
118   test/sanity_tests.cpp \
119   test/scheduler_tests.cpp \
120   test/script_P2SH_tests.cpp \
121   test/script_tests.cpp \
122   test/scriptnum_tests.cpp \
123   test/serialize_tests.cpp \
124   test/sighash_tests.cpp \
125   test/sigopcount_tests.cpp \
126   test/skiplist_tests.cpp \
127   test/streams_tests.cpp \
128   test/test_bitcoin.cpp \
129   test/test_bitcoin.h \
130   test/test_bitcoin_main.cpp \
131   test/test_random.h \
132   test/testutil.cpp \
133   test/testutil.h \
134   test/timedata_tests.cpp \
135   test/transaction_tests.cpp \
136   test/txvalidationcache_tests.cpp \
137   test/versionbits_tests.cpp \
138   test/uint256_tests.cpp \
139   test/univalue_tests.cpp \
140   test/util_tests.cpp
142 if ENABLE_WALLET
143 BITCOIN_TESTS += \
144   wallet/test/wallet_test_fixture.cpp \
145   wallet/test/wallet_test_fixture.h \
146   wallet/test/accounting_tests.cpp \
147   wallet/test/wallet_tests.cpp \
148   wallet/test/crypto_tests.cpp
149 endif
151 test_test_bitcoin_SOURCES = $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES)
152 test_test_bitcoin_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -I$(builddir)/test/ $(TESTDEFS) $(EVENT_CFLAGS)
153 test_test_bitcoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \
154   $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1) $(EVENT_LIBS)
155 test_test_bitcoin_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
156 if ENABLE_WALLET
157 test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET)
158 endif
160 test_test_bitcoin_LDADD += $(LIBBITCOIN_CONSENSUS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS)
161 test_test_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) -static
163 if ENABLE_ZMQ
164 test_test_bitcoin_LDADD += $(ZMQ_LIBS)
165 endif
168 # test_bitcoin_fuzzy binary #
169 test_test_bitcoin_fuzzy_SOURCES = test/test_bitcoin_fuzzy.cpp
170 test_test_bitcoin_fuzzy_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
171 test_test_bitcoin_fuzzy_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
172 test_test_bitcoin_fuzzy_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
174 test_test_bitcoin_fuzzy_LDADD = \
175   $(LIBUNIVALUE) \
176   $(LIBBITCOIN_SERVER) \
177   $(LIBBITCOIN_COMMON) \
178   $(LIBBITCOIN_UTIL) \
179   $(LIBBITCOIN_CONSENSUS) \
180   $(LIBBITCOIN_CRYPTO) \
181   $(LIBSECP256K1)
183 test_test_bitcoin_fuzzy_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS)
186 nodist_test_test_bitcoin_SOURCES = $(GENERATED_TEST_FILES)
188 $(BITCOIN_TESTS): $(GENERATED_TEST_FILES)
190 CLEAN_BITCOIN_TEST = test/*.gcda test/*.gcno $(GENERATED_TEST_FILES)
192 CLEANFILES += $(CLEAN_BITCOIN_TEST)
194 # This file is problematic for out-of-tree builds if it exists.
195 DISTCLEANFILES += test/buildenv.pyc
197 bitcoin_test: $(TEST_BINARY)
199 bitcoin_test_check: $(TEST_BINARY) FORCE
200         $(MAKE) check-TESTS TESTS=$^
202 bitcoin_test_clean : FORCE
203         rm -f $(CLEAN_BITCOIN_TEST) $(test_test_bitcoin_OBJECTS) $(TEST_BINARY)
205 check-local:
206         @echo "Running test/bitcoin-util-test.py..."
207         $(AM_V_at)srcdir=$(srcdir) PYTHONPATH=$(builddir)/test $(PYTHON) $(srcdir)/test/bitcoin-util-test.py
208         $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1 check
209 if EMBEDDED_UNIVALUE
210         $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C univalue check
211 endif
213 %.json.h: %.json
214         @$(MKDIR_P) $(@D)
215         @{ \
216          echo "namespace json_tests{" && \
217          echo "static unsigned const char $(*F)[] = {" && \
218          $(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x  ,//g' && \
219          echo "};};"; \
220         } > "$@.new" && mv -f "$@.new" "$@"
221         @echo "Generated $@"