scripted-diff: rename assert_raises_jsonrpc to assert_raises_rpc error
[bitcoinplatinum.git] / src / Makefile.test.include
blobd3e7b5da125979c1ff5a035e0419380a2a231c6a
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)
11 JSON_TEST_FILES = \
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
20 RAW_TEST_FILES =
22 GENERATED_TEST_FILES = $(JSON_TEST_FILES:.json=.json.h) $(RAW_TEST_FILES:.raw=.raw.h)
24 # test_bitcoin binary #
25 BITCOIN_TESTS =\
26   test/arith_uint256_tests.cpp \
27   test/scriptnum10.h \
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 \
44   test/DoS_tests.cpp \
45   test/getarg_tests.cpp \
46   test/hash_tests.cpp \
47   test/key_tests.cpp \
48   test/limitedmap_tests.cpp \
49   test/dbwrapper_tests.cpp \
50   test/main_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 \
56   test/net_tests.cpp \
57   test/netbase_tests.cpp \
58   test/pmt_tests.cpp \
59   test/policyestimator_tests.cpp \
60   test/pow_tests.cpp \
61   test/prevector_tests.cpp \
62   test/raii_event_tests.cpp \
63   test/random_tests.cpp \
64   test/reverselock_tests.cpp \
65   test/rpc_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 \
78   test/test_bitcoin.h \
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 \
87   test/util_tests.cpp
89 if ENABLE_WALLET
90 BITCOIN_TESTS += \
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
96 endif
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 =
101 if ENABLE_WALLET
102 test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET)
103 endif
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
111 if ENABLE_ZMQ
112 test_test_bitcoin_LDADD += $(ZMQ_LIBS)
113 endif
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 = \
123   $(LIBUNIVALUE) \
124   $(LIBBITCOIN_SERVER) \
125   $(LIBBITCOIN_COMMON) \
126   $(LIBBITCOIN_UTIL) \
127   $(LIBBITCOIN_CONSENSUS) \
128   $(LIBBITCOIN_CRYPTO) \
129   $(LIBSECP256K1)
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)
150 check-local:
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
154 if EMBEDDED_UNIVALUE
155         $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C univalue check
156 endif
158 %.json.h: %.json
159         @$(MKDIR_P) $(@D)
160         @{ \
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' && \
164          echo "};};"; \
165         } > "$@.new" && mv -f "$@.new" "$@"
166         @echo "Generated $@"