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