Makefile.test.include 3.7 KB
Newer Older
infernoman's avatar
infernoman committed
1
2
TESTS += test/test_crown test/bitcoin-util-test.py
bin_PROGRAMS += test/test_crown
3
TEST_SRCDIR = test
infernoman's avatar
infernoman committed
4
TEST_BINARY=test/test_crown$(EXEEXT)
5

6
7
8
9
10

EXTRA_DIST += \
	test/bctest.py \
	test/bitcoin-util-test.py \
	test/data/bitcoin-util-test.json \
Jeff Garzik's avatar
Jeff Garzik committed
11
12
13
14
15
	test/data/blanktx.hex \
	test/data/tt-delin1-out.hex \
	test/data/tt-delout1-out.hex \
	test/data/tt-locktime317000-out.hex \
	test/data/tx394b54bb.hex \
16
	test/data/txcreate1.hex \
17
18
	test/data/txcreate2.hex \
	test/data/txcreatesign.hex
19

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
JSON_TEST_FILES = \
  test/data/script_valid.json \
  test/data/base58_keys_valid.json \
  test/data/sig_canonical.json \
  test/data/sig_noncanonical.json \
  test/data/base58_encode_decode.json \
  test/data/base58_keys_invalid.json \
  test/data/script_invalid.json \
  test/data/tx_invalid.json \
  test/data/tx_valid.json \
  test/data/sighash.json

RAW_TEST_FILES = test/data/alertTests.raw

GENERATED_TEST_FILES = $(JSON_TEST_FILES:.json=.json.h) $(RAW_TEST_FILES:.raw=.raw.h)

BITCOIN_TESTS =\
37
  test/arith_uint256_tests.cpp \
38
39
40
41
42
43
44
45
46
  test/bignum.h \
  test/alert_tests.cpp \
  test/allocator_tests.cpp \
  test/base32_tests.cpp \
  test/base58_tests.cpp \
  test/base64_tests.cpp \
  test/bloom_tests.cpp \
  test/checkblock_tests.cpp \
  test/Checkpoints_tests.cpp \
47
  test/coins_tests.cpp \
48
  test/compress_tests.cpp \
49
  test/crypto_tests.cpp \
50
51
  test/DoS_tests.cpp \
  test/getarg_tests.cpp \
52
  test/hash_tests.cpp \
53
54
  test/key_tests.cpp \
  test/main_tests.cpp \
55
  test/mempool_tests.cpp \
56
57
58
59
60
  test/miner_tests.cpp \
  test/mruset_tests.cpp \
  test/multisig_tests.cpp \
  test/netbase_tests.cpp \
  test/pmt_tests.cpp \
Pieter Wuille's avatar
Pieter Wuille committed
61
  test/prevector_tests.cpp \
62
  test/rpc_tests.cpp \
63
  test/sanity_tests.cpp \
64
65
  test/script_P2SH_tests.cpp \
  test/script_tests.cpp \
66
  test/scriptnum_tests.cpp \
67
  test/serialize_tests.cpp \
68
  test/sighash_tests.cpp \
69
  test/sigopcount_tests.cpp \
Pieter Wuille's avatar
Pieter Wuille committed
70
  test/skiplist_tests.cpp \
infernoman's avatar
infernoman committed
71
  test/test_crown.cpp \
72
  test/timedata_tests.cpp \
73
  test/transaction_tests.cpp \
Jeff Garzik's avatar
Jeff Garzik committed
74
  test/univalue_tests.cpp \
75
  test/util_tests.cpp
76
77
78
79
80
81
82
83

if ENABLE_WALLET
BITCOIN_TESTS += \
  test/accounting_tests.cpp \
  test/wallet_tests.cpp \
  test/rpc_wallet_tests.cpp
endif

infernoman's avatar
infernoman committed
84
85
86
test_test_crown_SOURCES = $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES)
test_test_crown_CPPFLAGS = $(BITCOIN_INCLUDES) -I$(builddir)/test/ $(TESTDEFS)
test_test_crown_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \
87
  $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1)
88
if ENABLE_WALLET
infernoman's avatar
infernoman committed
89
test_test_crown_LDADD += $(LIBBITCOIN_WALLET)
90
endif
91

92
test_test_crown_LDADD += $(LIBBITCOIN_CONSENSUS) $(BDB_LIBS) $(SSL_LIBS) $(CURL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS)
infernoman's avatar
infernoman committed
93
test_test_crown_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) -static
94

infernoman's avatar
infernoman committed
95
nodist_test_test_crown_SOURCES = $(GENERATED_TEST_FILES)
96
97
98
99
100
101
102

$(BITCOIN_TESTS): $(GENERATED_TEST_FILES)

CLEAN_BITCOIN_TEST = test/*.gcda test/*.gcno $(GENERATED_TEST_FILES)

CLEANFILES += $(CLEAN_BITCOIN_TEST)

infernoman's avatar
infernoman committed
103
crown_test: $(TEST_BINARY)
104

infernoman's avatar
infernoman committed
105
crown_test_check: $(TEST_BINARY) FORCE
106
107
	$(MAKE) check-TESTS TESTS=$^

infernoman's avatar
infernoman committed
108
crown_test_clean : FORCE
infernoman's avatar
infernoman committed
109
	rm -f $(CLEAN_BITCOIN_TEST) $(test_test_crown_OBJECTS) $(TEST_BINARY)
110

111
112
113
check-local:
	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1 check

114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
%.json.h: %.json
	@$(MKDIR_P) $(@D)
	@echo "namespace json_tests{" > $@
	@echo "static unsigned const char $(*F)[] = {" >> $@
	@$(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x  ,//g' >> $@
	@echo "};};" >> $@
	@echo "Generated $@"

%.raw.h: %.raw
	@$(MKDIR_P) $(@D)
	@echo "namespace alert_tests{" > $@
	@echo "static unsigned const char $(*F)[] = {" >> $@
	@$(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x  ,//g' >> $@
	@echo "};};" >> $@
	@echo "Generated $@"