Makefile.test.include 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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.
  4. bin_PROGRAMS += test/test_litecoin
  5. noinst_PROGRAMS += test/test_litecoin_fuzzy
  6. TEST_SRCDIR = test
  7. TEST_BINARY=test/test_litecoin$(EXEEXT)
  8. JSON_TEST_FILES = \
  9. test/data/base58_encode_decode.json \
  10. test/data/key_io_valid.json \
  11. test/data/key_io_invalid.json \
  12. test/data/script_tests.json \
  13. test/data/sighash.json \
  14. test/data/tx_invalid.json \
  15. test/data/tx_valid.json
  16. RAW_TEST_FILES =
  17. GENERATED_TEST_FILES = $(JSON_TEST_FILES:.json=.json.h) $(RAW_TEST_FILES:.raw=.raw.h)
  18. BITCOIN_TEST_SUITE = \
  19. test/test_bitcoin_main.cpp \
  20. test/test_bitcoin.h \
  21. test/test_bitcoin.cpp
  22. # test_bitcoin binary #
  23. BITCOIN_TESTS =\
  24. test/arith_uint256_tests.cpp \
  25. test/scriptnum10.h \
  26. test/addrman_tests.cpp \
  27. test/amount_tests.cpp \
  28. test/allocator_tests.cpp \
  29. test/base32_tests.cpp \
  30. test/base58_tests.cpp \
  31. test/base64_tests.cpp \
  32. test/bech32_tests.cpp \
  33. test/bip32_tests.cpp \
  34. test/blockchain_tests.cpp \
  35. test/bloom_tests.cpp \
  36. test/bswap_tests.cpp \
  37. test/checkqueue_tests.cpp \
  38. test/coins_tests.cpp \
  39. test/compress_tests.cpp \
  40. test/crypto_tests.cpp \
  41. test/cuckoocache_tests.cpp \
  42. test/denialofservice_tests.cpp \
  43. test/descriptor_tests.cpp \
  44. test/getarg_tests.cpp \
  45. test/hash_tests.cpp \
  46. test/key_io_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/scrypt_tests.cpp \
  73. test/serialize_tests.cpp \
  74. test/sighash_tests.cpp \
  75. test/sigopcount_tests.cpp \
  76. test/skiplist_tests.cpp \
  77. test/streams_tests.cpp \
  78. test/timedata_tests.cpp \
  79. test/torcontrol_tests.cpp \
  80. test/transaction_tests.cpp \
  81. test/txindex_tests.cpp \
  82. test/txvalidation_tests.cpp \
  83. test/txvalidationcache_tests.cpp \
  84. test/uint256_tests.cpp \
  85. test/util_tests.cpp \
  86. test/validation_block_tests.cpp \
  87. test/versionbits_tests.cpp
  88. if ENABLE_WALLET
  89. BITCOIN_TESTS += \
  90. wallet/test/accounting_tests.cpp \
  91. wallet/test/psbt_wallet_tests.cpp \
  92. wallet/test/wallet_tests.cpp \
  93. wallet/test/wallet_crypto_tests.cpp \
  94. wallet/test/coinselector_tests.cpp
  95. BITCOIN_TEST_SUITE += \
  96. wallet/test/wallet_test_fixture.cpp \
  97. wallet/test/wallet_test_fixture.h
  98. endif
  99. test_test_litecoin_SOURCES = $(BITCOIN_TEST_SUITE) $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES)
  100. test_test_litecoin_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(TESTDEFS) $(EVENT_CFLAGS)
  101. test_test_litecoin_LDADD =
  102. if ENABLE_WALLET
  103. test_test_litecoin_LDADD += $(LIBBITCOIN_WALLET)
  104. endif
  105. test_test_litecoin_LDADD += $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) \
  106. $(LIBLEVELDB) $(LIBLEVELDB_SSE42) $(LIBMEMENV) $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1) $(EVENT_LIBS) $(EVENT_PTHREADS_LIBS)
  107. test_test_litecoin_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
  108. test_test_litecoin_LDADD += $(LIBBITCOIN_CONSENSUS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS)
  109. test_test_litecoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) -static
  110. if ENABLE_ZMQ
  111. test_test_litecoin_LDADD += $(ZMQ_LIBS)
  112. endif
  113. #
  114. # test_bitcoin_fuzzy binary #
  115. test_test_litecoin_fuzzy_SOURCES = test/test_bitcoin_fuzzy.cpp
  116. test_test_litecoin_fuzzy_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
  117. test_test_litecoin_fuzzy_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
  118. test_test_litecoin_fuzzy_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
  119. test_test_litecoin_fuzzy_LDADD = \
  120. $(LIBUNIVALUE) \
  121. $(LIBBITCOIN_SERVER) \
  122. $(LIBBITCOIN_COMMON) \
  123. $(LIBBITCOIN_UTIL) \
  124. $(LIBBITCOIN_CONSENSUS) \
  125. $(LIBBITCOIN_CRYPTO) \
  126. $(LIBBITCOIN_CRYPTO_SSE41) \
  127. $(LIBBITCOIN_CRYPTO_AVX2) \
  128. $(LIBBITCOIN_CRYPTO_SHANI) \
  129. $(LIBSECP256K1)
  130. test_test_litecoin_fuzzy_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS)
  131. #
  132. nodist_test_test_litecoin_SOURCES = $(GENERATED_TEST_FILES)
  133. $(BITCOIN_TESTS): $(GENERATED_TEST_FILES)
  134. CLEAN_BITCOIN_TEST = test/*.gcda test/*.gcno $(GENERATED_TEST_FILES)
  135. CLEANFILES += $(CLEAN_BITCOIN_TEST)
  136. bitcoin_test: $(TEST_BINARY)
  137. bitcoin_test_check: $(TEST_BINARY) FORCE
  138. $(MAKE) check-TESTS TESTS=$^
  139. bitcoin_test_clean : FORCE
  140. rm -f $(CLEAN_BITCOIN_TEST) $(test_test_bitcoin_OBJECTS) $(TEST_BINARY)
  141. check-local: $(BITCOIN_TESTS:.cpp=.cpp.test)
  142. @echo "Running test/util/bitcoin-util-test.py..."
  143. $(PYTHON) $(top_builddir)/test/util/bitcoin-util-test.py
  144. @echo "Running test/util/rpcauth-test.py..."
  145. $(PYTHON) $(top_builddir)/test/util/rpcauth-test.py
  146. $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1 check
  147. if EMBEDDED_UNIVALUE
  148. $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C univalue check
  149. endif
  150. %.cpp.test: %.cpp
  151. @echo Running tests: `cat $< | grep -E "(BOOST_FIXTURE_TEST_SUITE\\(|BOOST_AUTO_TEST_SUITE\\()" | cut -d '(' -f 2 | cut -d ',' -f 1 | cut -d ')' -f 1` from $<
  152. $(AM_V_at)$(TEST_BINARY) -l test_suite -t "`cat $< | grep -E "(BOOST_FIXTURE_TEST_SUITE\\(|BOOST_AUTO_TEST_SUITE\\()" | cut -d '(' -f 2 | cut -d ',' -f 1 | cut -d ')' -f 1`" > $<.log 2>&1 || (cat $<.log && false)
  153. %.json.h: %.json
  154. @$(MKDIR_P) $(@D)
  155. @{ \
  156. echo "namespace json_tests{" && \
  157. echo "static unsigned const char $(*F)[] = {" && \
  158. $(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' && \
  159. echo "};};"; \
  160. } > "$@.new" && mv -f "$@.new" "$@"
  161. @echo "Generated $@"