]>
Commit | Line | Data |
---|---|---|
65e8ba4d CF |
1 | TESTS += test/test_bitcoin |
2 | bin_PROGRAMS += test/test_bitcoin | |
3 | TEST_SRCDIR = test | |
4 | TEST_BINARY=test/test_bitcoin$(EXEEXT) | |
5 | ||
6 | JSON_TEST_FILES = \ | |
7 | test/data/script_valid.json \ | |
8 | test/data/base58_keys_valid.json \ | |
9 | test/data/sig_canonical.json \ | |
10 | test/data/sig_noncanonical.json \ | |
11 | test/data/base58_encode_decode.json \ | |
12 | test/data/base58_keys_invalid.json \ | |
13 | test/data/script_invalid.json \ | |
14 | test/data/tx_invalid.json \ | |
15 | test/data/tx_valid.json \ | |
16 | test/data/sighash.json | |
17 | ||
18 | RAW_TEST_FILES = test/data/alertTests.raw | |
19 | ||
20 | GENERATED_TEST_FILES = $(JSON_TEST_FILES:.json=.json.h) $(RAW_TEST_FILES:.raw=.raw.h) | |
21 | ||
22 | BITCOIN_TESTS =\ | |
23 | test/bignum.h \ | |
24 | test/alert_tests.cpp \ | |
25 | test/allocator_tests.cpp \ | |
26 | test/base32_tests.cpp \ | |
27 | test/base58_tests.cpp \ | |
28 | test/base64_tests.cpp \ | |
29 | test/bloom_tests.cpp \ | |
30 | test/canonical_tests.cpp \ | |
31 | test/checkblock_tests.cpp \ | |
32 | test/Checkpoints_tests.cpp \ | |
33 | test/compress_tests.cpp \ | |
3820e01e | 34 | test/crypto_tests.cpp \ |
65e8ba4d CF |
35 | test/DoS_tests.cpp \ |
36 | test/getarg_tests.cpp \ | |
977cdade | 37 | test/hash_tests.cpp \ |
65e8ba4d CF |
38 | test/key_tests.cpp \ |
39 | test/main_tests.cpp \ | |
40 | test/miner_tests.cpp \ | |
41 | test/mruset_tests.cpp \ | |
42 | test/multisig_tests.cpp \ | |
43 | test/netbase_tests.cpp \ | |
44 | test/pmt_tests.cpp \ | |
45 | test/rpc_tests.cpp \ | |
46 | test/script_P2SH_tests.cpp \ | |
47 | test/script_tests.cpp \ | |
48 | test/serialize_tests.cpp \ | |
49 | test/sigopcount_tests.cpp \ | |
236982c2 | 50 | test/skiplist_tests.cpp \ |
65e8ba4d CF |
51 | test/test_bitcoin.cpp \ |
52 | test/transaction_tests.cpp \ | |
53 | test/uint256_tests.cpp \ | |
54 | test/util_tests.cpp \ | |
55 | test/scriptnum_tests.cpp \ | |
56 | test/sighash_tests.cpp | |
57 | ||
58 | if ENABLE_WALLET | |
59 | BITCOIN_TESTS += \ | |
60 | test/accounting_tests.cpp \ | |
61 | test/wallet_tests.cpp \ | |
62 | test/rpc_wallet_tests.cpp | |
63 | endif | |
64 | ||
65 | test_test_bitcoin_SOURCES = $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES) | |
f4d81129 | 66 | test_test_bitcoin_CPPFLAGS = $(BITCOIN_INCLUDES) -I$(builddir)/test/ $(TESTDEFS) |
84ce18ca | 67 | test_test_bitcoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBLEVELDB) $(LIBMEMENV) \ |
65e8ba4d CF |
68 | $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) |
69 | if ENABLE_WALLET | |
70 | test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET) | |
71 | endif | |
55668266 CF |
72 | |
73 | if USE_LIBSECP256K1 | |
74 | test_test_bitcoin_LDADD += secp256k1/libsecp256k1.la | |
75 | endif | |
76 | ||
65e8ba4d CF |
77 | test_test_bitcoin_LDADD += $(BDB_LIBS) |
78 | ||
79 | nodist_test_test_bitcoin_SOURCES = $(GENERATED_TEST_FILES) | |
80 | ||
81 | $(BITCOIN_TESTS): $(GENERATED_TEST_FILES) | |
82 | ||
83 | CLEAN_BITCOIN_TEST = test/*.gcda test/*.gcno $(GENERATED_TEST_FILES) | |
84 | ||
85 | CLEANFILES += $(CLEAN_BITCOIN_TEST) | |
86 | ||
87 | bitcoin_test: $(TEST_BINARY) | |
88 | ||
89 | bitcoin_test_check: $(TEST_BINARY) FORCE | |
90 | $(MAKE) check-TESTS TESTS=$^ | |
91 | ||
92 | bitcoin_test_clean : FORCE | |
93 | rm -f $(CLEAN_BITCOIN_TEST) $(test_test_bitcoin_OBJECTS) $(TEST_BINARY) | |
6b9f0d55 CF |
94 | |
95 | %.json.h: %.json | |
96 | @$(MKDIR_P) $(@D) | |
97 | @echo "namespace json_tests{" > $@ | |
98 | @echo "static unsigned const char $(*F)[] = {" >> $@ | |
99 | @$(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' >> $@ | |
100 | @echo "};};" >> $@ | |
101 | @echo "Generated $@" | |
102 | ||
103 | %.raw.h: %.raw | |
104 | @$(MKDIR_P) $(@D) | |
105 | @echo "namespace alert_tests{" > $@ | |
106 | @echo "static unsigned const char $(*F)[] = {" >> $@ | |
107 | @$(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' >> $@ | |
108 | @echo "};};" >> $@ | |
109 | @echo "Generated $@" |