mirror of
https://github.com/dogecoin/dogecoin.git
synced 2026-02-14 09:18:37 +00:00
b5ffa9f3dbff7dd008d4d00a88590d411ef991f2 tests: Add Parse(...) (descriptor) fuzzing harness (practicalswift) fdef8bbf2f824a87f70b755155e9e1a8cd19fdcb tests: Allow for using non-default fuzzing initialization (practicalswift) Pull request description: Add `Parse(...)` (descriptor) fuzzing harness. To test this PR: We can run `test_fuzzing_harnesses.sh` (#17000) during ten seconds to quickly verify that the newly added fuzz harness seem to hit relevant code regions, that the fuzzing throughput seems reasonable, etc. `test_fuzzing_harnesses.sh descriptor 10` runs all fuzzers matching the regexp `descriptor` giving them ten seconds of runtime each. ``` $ CC=clang CXX=clang++ ./configure --enable-fuzz --with-sanitizers=address,fuzzer,undefined $ make $ contrib/devtools/test_fuzzing_harnesses.sh descriptor 10 Testing fuzzer descriptor_parse during 10 second(s) A subset of reached functions: NEW_FUNC[0/17]: 0x55ec8a240c90 in tinyformat::detail::formatImpl(std::ostream&, char const*, tinyformat::detail::FormatArg const*, int) src/./tinyformat.h:791 NEW_FUNC[4/17]: 0x55ec8a2435f0 in tinyformat::detail::printFormatStringLiteral(std::ostream&, char const*) src/./tinyformat.h:564 NEW_FUNC[5/17]: 0x55ec8a2439d0 in tinyformat::detail::streamStateFromFormat(std::ostream&, bool&, int&, char const*, tinyformat::detail::FormatArg const*, int&, int) src/./tinyformat.h:601 NEW_FUNC[6/17]: 0x55ec8a24a3d0 in tinyformat::detail::FormatArg::format(std::ostream&, char const*, char const*, int) const src/./tinyformat.h:513 NEW_FUNC[12/17]: 0x55ec8a29cd70 in void tinyformat::detail::FormatArg::formatImpl<long>(std::ostream&, char const*, char const*, int, void const*) src/./tinyformat.h:530 NEW_FUNC[13/17]: 0x55ec8a29cf50 in void tinyformat::formatValue<long>(std::ostream&, char const*, char const*, int, long const&) src/./tinyformat.h:317 NEW_FUNC[14/17]: 0x55ec8a2ea450 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > tinyformat::format<long>(char const*, long const&) src/./tinyformat.h:976 NEW_FUNC[15/17]: 0x55ec8a346ac0 in void tinyformat::format<long>(std::ostream&, char const*, long const&) src/./tinyformat.h:968 NEW_FUNC[16/17]: 0x55ec8a346d80 in tinyformat::detail::FormatListN<1>::FormatListN<long>(long const&) src/./tinyformat.h:885 NEW_FUNC[0/16]: 0x55ec8a210c90 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > tinyformat::format<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) src/./tinyformat.h:976 NEW_FUNC[2/16]: 0x55ec8a25c3e0 in void tinyformat::format<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::ostream&, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) src/./tinyformat.h:968 NEW_FUNC[3/16]: 0x55ec8a25c6a0 in tinyformat::detail::FormatListN<1>::FormatListN<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) src/./tinyformat.h:885 NEW_FUNC[4/16]: 0x55ec8a25c980 in void tinyformat::detail::FormatArg::formatImpl<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::ostream&, char const*, char const*, int, void const*) src/./tinyformat.h:530 NEW_FUNC[6/16]: 0x55ec8b29cc60 in (anonymous namespace)::ParseScript(Span<char const>&, (anonymous namespace)::ParseScriptContext, FlatSigningProvider&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) src/script/descriptor.cpp:810 NEW_FUNC[8/16]: 0x55ec8b2a4710 in (anonymous namespace)::Expr(Span<char const>&) src/script/descriptor.cpp:657 NEW_FUNC[9/16]: 0x55ec8b2a4d40 in (anonymous namespace)::Func(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Span<char const>&) src/script/descriptor.cpp:647 NEW_FUNC[15/16]: 0x55ec8b2d7dd0 in Span<char const>::subspan(long) const src/./span.h:33 NEW_FUNC[0/1]: 0x55ec8b2d7830 in Span<char const>::operator[](long) const src/./span.h:31 NEW_FUNC[0/10]: 0x55ec8a2ea090 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > tinyformat::format<char const*>(char const*, char const* const&) src/./tinyformat.h:976 NEW_FUNC[1/10]: 0x55ec8a345d40 in void tinyformat::format<char const*>(std::ostream&, char const*, char const* const&) src/./tinyformat.h:968 NEW_FUNC[2/10]: 0x55ec8a346000 in tinyformat::detail::FormatListN<1>::FormatListN<char const*>(char const* const&) src/./tinyformat.h:885 NEW_FUNC[3/10]: 0x55ec8a3462e0 in void tinyformat::detail::FormatArg::formatImpl<char const*>(std::ostream&, char const*, char const*, int, void const*) src/./tinyformat.h:530 NEW_FUNC[4/10]: 0x55ec8a3464b0 in void tinyformat::formatValue<char const*>(std::ostream&, char const*, char const*, int, char const* const&) src/./tinyformat.h:317 NEW_FUNC[8/10]: 0x55ec8b438ef0 in ParsePrechecks(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) src/util/strencodings.cpp:267 NEW_FUNC[9/10]: 0x55ec8b4398b0 in ParseUInt32(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int*) src/util/strencodings.cpp:309 NEW_FUNC[0/3]: 0x55ec8a2e9430 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > tinyformat::format<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) src/./tinyformat.h:976 NEW_FUNC[1/3]: 0x55ec8a33a6f0 in void tinyformat::format<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::ostream&, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) src/./tinyformat.h:968 NEW_FUNC[2/3]: 0x55ec8a33aa40 in tinyformat::detail::FormatListN<2>::FormatListN<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) src/./tinyformat.h:885 NEW_FUNC[1/2]: 0x55ec8b4331b0 in IsHex(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) src/util/strencodings.cpp:61 NEW_FUNC[13/24]: 0x55ec8b126eb0 in Params() src/chainparams.cpp:384 NEW_FUNC[14/24]: 0x55ec8b19a500 in DecodeDestination(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) src/key_io.cpp:217 NEW_FUNC[15/24]: 0x55ec8b19a610 in (anonymous namespace)::DecodeDestination(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, CChainParams const&) src/key_io.cpp:74 NEW_FUNC[18/24]: 0x55ec8b357160 in IsValidDestination(boost::variant<CNoDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessUnknown> const&) src/script/standard.cpp:325 NEW_FUNC[19/24]: 0x55ec8b36fe40 in DecodeBase58(char const*, std::vector<unsigned char, std::allocator<unsigned char> >&) src/base58.cpp:36 stat::number_of_executed_units: 54900 stat::average_exec_per_sec: 4990 stat::new_units_added: 421 stat::slowest_unit_time_sec: 0 stat::peak_rss_mb: 412 Number of unique code paths taken during fuzzing round: 93 Tested fuzz harnesses seem to work as expected. ``` Top commit has no ACKs. Tree-SHA512: f18d0a6798c55d2c85ef9e604af2c1d626da2b81c01ea3f77c5cecd4ce35b197030778b3cfebab4869dab84a022325dba94fd83290026bfbc59814938e1daa02
407 lines
17 KiB
Makefile
407 lines
17 KiB
Makefile
# Copyright (c) 2013-2016 The Bitcoin Core developers
|
|
# Distributed under the MIT software license, see the accompanying
|
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
|
FUZZ_TARGETS = \
|
|
test/fuzz/address_deserialize \
|
|
test/fuzz/addrman_deserialize \
|
|
test/fuzz/banentry_deserialize \
|
|
test/fuzz/block_deserialize \
|
|
test/fuzz/blockheader_deserialize \
|
|
test/fuzz/blocklocator_deserialize \
|
|
test/fuzz/blockmerkleroot \
|
|
test/fuzz/blocktransactions_deserialize \
|
|
test/fuzz/blocktransactionsrequest_deserialize \
|
|
test/fuzz/blockundo_deserialize \
|
|
test/fuzz/bloomfilter_deserialize \
|
|
test/fuzz/coins_deserialize \
|
|
test/fuzz/descriptor_parse \
|
|
test/fuzz/diskblockindex_deserialize \
|
|
test/fuzz/eval_script \
|
|
test/fuzz/inv_deserialize \
|
|
test/fuzz/messageheader_deserialize \
|
|
test/fuzz/netaddr_deserialize \
|
|
test/fuzz/script_flags \
|
|
test/fuzz/service_deserialize \
|
|
test/fuzz/spanparsing \
|
|
test/fuzz/transaction \
|
|
test/fuzz/txoutcompressor_deserialize \
|
|
test/fuzz/txundo_deserialize
|
|
|
|
if ENABLE_FUZZ
|
|
noinst_PROGRAMS += $(FUZZ_TARGETS:=)
|
|
else
|
|
bin_PROGRAMS += test/test_bitcoin
|
|
endif
|
|
|
|
TEST_SRCDIR = test
|
|
TEST_BINARY=test/test_bitcoin$(EXEEXT)
|
|
|
|
JSON_TEST_FILES = \
|
|
test/data/script_tests.json \
|
|
test/data/base58_encode_decode.json \
|
|
test/data/blockfilters.json \
|
|
test/data/key_io_valid.json \
|
|
test/data/key_io_invalid.json \
|
|
test/data/script_tests.json \
|
|
test/data/sighash.json \
|
|
test/data/tx_invalid.json \
|
|
test/data/tx_valid.json
|
|
|
|
RAW_TEST_FILES =
|
|
|
|
GENERATED_TEST_FILES = $(JSON_TEST_FILES:.json=.json.h) $(RAW_TEST_FILES:.raw=.raw.h)
|
|
|
|
BITCOIN_TEST_SUITE = \
|
|
test/lib/transaction_utils.h \
|
|
test/lib/transaction_utils.cpp \
|
|
test/main.cpp \
|
|
test/setup_common.h \
|
|
test/setup_common.cpp
|
|
|
|
FUZZ_SUITE = \
|
|
test/setup_common.h \
|
|
test/setup_common.cpp \
|
|
test/fuzz/fuzz.cpp \
|
|
test/fuzz/fuzz.h \
|
|
test/fuzz/FuzzedDataProvider.h
|
|
|
|
FUZZ_SUITE_LD_COMMON = \
|
|
$(LIBBITCOIN_SERVER) \
|
|
$(LIBBITCOIN_COMMON) \
|
|
$(LIBBITCOIN_UTIL) \
|
|
$(LIBBITCOIN_CONSENSUS) \
|
|
$(LIBBITCOIN_CRYPTO) \
|
|
$(LIBUNIVALUE) \
|
|
$(LIBLEVELDB) \
|
|
$(LIBLEVELDB_SSE42) \
|
|
$(BOOST_LIBS) \
|
|
$(LIBMEMENV) \
|
|
$(LIBSECP256K1) \
|
|
$(EVENT_LIBS) \
|
|
$(CRYPTO_LIBS) \
|
|
$(EVENT_PTHREADS_LIBS)
|
|
|
|
# test_bitcoin binary #
|
|
BITCOIN_TESTS =\
|
|
test/arith_uint256_tests.cpp \
|
|
test/scriptnum10.h \
|
|
test/addrman_tests.cpp \
|
|
test/amount_tests.cpp \
|
|
test/allocator_tests.cpp \
|
|
test/base32_tests.cpp \
|
|
test/base58_tests.cpp \
|
|
test/base64_tests.cpp \
|
|
test/bech32_tests.cpp \
|
|
test/bip32_tests.cpp \
|
|
test/blockchain_tests.cpp \
|
|
test/blockencodings_tests.cpp \
|
|
test/blockfilter_tests.cpp \
|
|
test/blockfilter_index_tests.cpp \
|
|
test/bloom_tests.cpp \
|
|
test/bswap_tests.cpp \
|
|
test/checkqueue_tests.cpp \
|
|
test/coins_tests.cpp \
|
|
test/compilerbug_tests.cpp \
|
|
test/compress_tests.cpp \
|
|
test/crypto_tests.cpp \
|
|
test/cuckoocache_tests.cpp \
|
|
test/denialofservice_tests.cpp \
|
|
test/descriptor_tests.cpp \
|
|
test/flatfile_tests.cpp \
|
|
test/fs_tests.cpp \
|
|
test/getarg_tests.cpp \
|
|
test/hash_tests.cpp \
|
|
test/key_io_tests.cpp \
|
|
test/key_tests.cpp \
|
|
test/limitedmap_tests.cpp \
|
|
test/dbwrapper_tests.cpp \
|
|
test/validation_tests.cpp \
|
|
test/mempool_tests.cpp \
|
|
test/merkle_tests.cpp \
|
|
test/merkleblock_tests.cpp \
|
|
test/miner_tests.cpp \
|
|
test/multisig_tests.cpp \
|
|
test/net_tests.cpp \
|
|
test/netbase_tests.cpp \
|
|
test/pmt_tests.cpp \
|
|
test/policyestimator_tests.cpp \
|
|
test/pow_tests.cpp \
|
|
test/prevector_tests.cpp \
|
|
test/raii_event_tests.cpp \
|
|
test/random_tests.cpp \
|
|
test/reverselock_tests.cpp \
|
|
test/rpc_tests.cpp \
|
|
test/sanity_tests.cpp \
|
|
test/scheduler_tests.cpp \
|
|
test/script_p2sh_tests.cpp \
|
|
test/script_tests.cpp \
|
|
test/script_standard_tests.cpp \
|
|
test/scriptnum_tests.cpp \
|
|
test/serialize_tests.cpp \
|
|
test/sighash_tests.cpp \
|
|
test/sigopcount_tests.cpp \
|
|
test/skiplist_tests.cpp \
|
|
test/streams_tests.cpp \
|
|
test/sync_tests.cpp \
|
|
test/util_threadnames_tests.cpp \
|
|
test/timedata_tests.cpp \
|
|
test/torcontrol_tests.cpp \
|
|
test/transaction_tests.cpp \
|
|
test/txindex_tests.cpp \
|
|
test/txvalidation_tests.cpp \
|
|
test/txvalidationcache_tests.cpp \
|
|
test/uint256_tests.cpp \
|
|
test/util_tests.cpp \
|
|
test/validation_block_tests.cpp \
|
|
test/versionbits_tests.cpp
|
|
|
|
if ENABLE_PROPERTY_TESTS
|
|
BITCOIN_TESTS += \
|
|
test/key_properties.cpp
|
|
|
|
BITCOIN_TEST_SUITE += \
|
|
test/gen/crypto_gen.cpp \
|
|
test/gen/crypto_gen.h
|
|
endif
|
|
|
|
if ENABLE_WALLET
|
|
BITCOIN_TESTS += \
|
|
wallet/test/db_tests.cpp \
|
|
wallet/test/psbt_wallet_tests.cpp \
|
|
wallet/test/wallet_tests.cpp \
|
|
wallet/test/wallet_crypto_tests.cpp \
|
|
wallet/test/coinselector_tests.cpp \
|
|
wallet/test/init_tests.cpp \
|
|
wallet/test/ismine_tests.cpp
|
|
|
|
BITCOIN_TEST_SUITE += \
|
|
wallet/test/wallet_test_fixture.cpp \
|
|
wallet/test/wallet_test_fixture.h \
|
|
wallet/test/init_test_fixture.cpp \
|
|
wallet/test/init_test_fixture.h
|
|
endif
|
|
|
|
test_test_bitcoin_SOURCES = $(BITCOIN_TEST_SUITE) $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES)
|
|
test_test_bitcoin_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(TESTDEFS) $(EVENT_CFLAGS)
|
|
test_test_bitcoin_LDADD =
|
|
if ENABLE_WALLET
|
|
test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET)
|
|
endif
|
|
|
|
test_test_bitcoin_LDADD += $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) \
|
|
$(LIBLEVELDB) $(LIBLEVELDB_SSE42) $(LIBMEMENV) $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1) $(EVENT_LIBS) $(EVENT_PTHREADS_LIBS)
|
|
test_test_bitcoin_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
|
|
|
test_test_bitcoin_LDADD += $(BDB_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(RAPIDCHECK_LIBS)
|
|
test_test_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) -static
|
|
|
|
if ENABLE_ZMQ
|
|
test_test_bitcoin_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS)
|
|
endif
|
|
|
|
if ENABLE_FUZZ
|
|
test_fuzz_block_deserialize_SOURCES = $(FUZZ_SUITE) test/fuzz/deserialize.cpp
|
|
test_fuzz_block_deserialize_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -DBLOCK_DESERIALIZE=1
|
|
test_fuzz_block_deserialize_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
|
test_fuzz_block_deserialize_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
|
test_fuzz_block_deserialize_LDADD = $(FUZZ_SUITE_LD_COMMON)
|
|
|
|
test_fuzz_blocklocator_deserialize_SOURCES = $(FUZZ_SUITE) test/fuzz/deserialize.cpp
|
|
test_fuzz_blocklocator_deserialize_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -DBLOCKLOCATOR_DESERIALIZE=1
|
|
test_fuzz_blocklocator_deserialize_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
|
test_fuzz_blocklocator_deserialize_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
|
test_fuzz_blocklocator_deserialize_LDADD = $(FUZZ_SUITE_LD_COMMON)
|
|
|
|
test_fuzz_blockmerkleroot_SOURCES = $(FUZZ_SUITE) test/fuzz/deserialize.cpp
|
|
test_fuzz_blockmerkleroot_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -DBLOCKMERKLEROOT=1
|
|
test_fuzz_blockmerkleroot_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
|
test_fuzz_blockmerkleroot_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
|
test_fuzz_blockmerkleroot_LDADD = $(FUZZ_SUITE_LD_COMMON)
|
|
|
|
test_fuzz_addrman_deserialize_SOURCES = $(FUZZ_SUITE) test/fuzz/deserialize.cpp
|
|
test_fuzz_addrman_deserialize_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -DADDRMAN_DESERIALIZE=1
|
|
test_fuzz_addrman_deserialize_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
|
test_fuzz_addrman_deserialize_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
|
test_fuzz_addrman_deserialize_LDADD = $(FUZZ_SUITE_LD_COMMON)
|
|
|
|
test_fuzz_blockheader_deserialize_SOURCES = $(FUZZ_SUITE) test/fuzz/deserialize.cpp
|
|
test_fuzz_blockheader_deserialize_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -DBLOCKHEADER_DESERIALIZE=1
|
|
test_fuzz_blockheader_deserialize_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
|
test_fuzz_blockheader_deserialize_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
|
test_fuzz_blockheader_deserialize_LDADD = $(FUZZ_SUITE_LD_COMMON)
|
|
|
|
test_fuzz_banentry_deserialize_SOURCES = $(FUZZ_SUITE) test/fuzz/deserialize.cpp
|
|
test_fuzz_banentry_deserialize_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -DBANENTRY_DESERIALIZE=1
|
|
test_fuzz_banentry_deserialize_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
|
test_fuzz_banentry_deserialize_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
|
test_fuzz_banentry_deserialize_LDADD = $(FUZZ_SUITE_LD_COMMON)
|
|
|
|
test_fuzz_txundo_deserialize_SOURCES = $(FUZZ_SUITE) test/fuzz/deserialize.cpp
|
|
test_fuzz_txundo_deserialize_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -DTXUNDO_DESERIALIZE=1
|
|
test_fuzz_txundo_deserialize_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
|
test_fuzz_txundo_deserialize_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
|
test_fuzz_txundo_deserialize_LDADD = $(FUZZ_SUITE_LD_COMMON)
|
|
|
|
test_fuzz_blockundo_deserialize_SOURCES = $(FUZZ_SUITE) test/fuzz/deserialize.cpp
|
|
test_fuzz_blockundo_deserialize_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -DBLOCKUNDO_DESERIALIZE=1
|
|
test_fuzz_blockundo_deserialize_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
|
test_fuzz_blockundo_deserialize_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
|
test_fuzz_blockundo_deserialize_LDADD = $(FUZZ_SUITE_LD_COMMON)
|
|
|
|
test_fuzz_coins_deserialize_SOURCES = $(FUZZ_SUITE) test/fuzz/deserialize.cpp
|
|
test_fuzz_coins_deserialize_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -DCOINS_DESERIALIZE=1
|
|
test_fuzz_coins_deserialize_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
|
test_fuzz_coins_deserialize_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
|
test_fuzz_coins_deserialize_LDADD = $(FUZZ_SUITE_LD_COMMON)
|
|
|
|
test_fuzz_descriptor_parse_SOURCES = $(FUZZ_SUITE) test/fuzz/descriptor_parse.cpp
|
|
test_fuzz_descriptor_parse_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
|
|
test_fuzz_descriptor_parse_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
|
test_fuzz_descriptor_parse_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
|
test_fuzz_descriptor_parse_LDADD = $(FUZZ_SUITE_LD_COMMON)
|
|
|
|
test_fuzz_netaddr_deserialize_SOURCES = $(FUZZ_SUITE) test/fuzz/deserialize.cpp
|
|
test_fuzz_netaddr_deserialize_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -DNETADDR_DESERIALIZE=1
|
|
test_fuzz_netaddr_deserialize_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
|
test_fuzz_netaddr_deserialize_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
|
test_fuzz_netaddr_deserialize_LDADD = $(FUZZ_SUITE_LD_COMMON)
|
|
|
|
test_fuzz_script_flags_SOURCES = $(FUZZ_SUITE) test/fuzz/script_flags.cpp
|
|
test_fuzz_script_flags_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
|
|
test_fuzz_script_flags_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
|
test_fuzz_script_flags_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
|
test_fuzz_script_flags_LDADD = $(FUZZ_SUITE_LD_COMMON)
|
|
|
|
test_fuzz_service_deserialize_SOURCES = $(FUZZ_SUITE) test/fuzz/deserialize.cpp
|
|
test_fuzz_service_deserialize_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -DSERVICE_DESERIALIZE=1
|
|
test_fuzz_service_deserialize_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
|
test_fuzz_service_deserialize_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
|
test_fuzz_service_deserialize_LDADD = $(FUZZ_SUITE_LD_COMMON)
|
|
|
|
test_fuzz_spanparsing_SOURCES = $(FUZZ_SUITE) test/fuzz/spanparsing.cpp
|
|
test_fuzz_spanparsing_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
|
|
test_fuzz_spanparsing_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
|
test_fuzz_spanparsing_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
|
test_fuzz_spanparsing_LDADD = $(FUZZ_SUITE_LD_COMMON)
|
|
|
|
test_fuzz_messageheader_deserialize_SOURCES = $(FUZZ_SUITE) test/fuzz/deserialize.cpp
|
|
test_fuzz_messageheader_deserialize_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -DMESSAGEHEADER_DESERIALIZE=1
|
|
test_fuzz_messageheader_deserialize_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
|
test_fuzz_messageheader_deserialize_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
|
test_fuzz_messageheader_deserialize_LDADD = $(FUZZ_SUITE_LD_COMMON)
|
|
|
|
test_fuzz_address_deserialize_SOURCES = $(FUZZ_SUITE) test/fuzz/deserialize.cpp
|
|
test_fuzz_address_deserialize_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -DADDRESS_DESERIALIZE=1
|
|
test_fuzz_address_deserialize_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
|
test_fuzz_address_deserialize_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
|
test_fuzz_address_deserialize_LDADD = $(FUZZ_SUITE_LD_COMMON)
|
|
|
|
test_fuzz_inv_deserialize_SOURCES = $(FUZZ_SUITE) test/fuzz/deserialize.cpp
|
|
test_fuzz_inv_deserialize_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -DINV_DESERIALIZE=1
|
|
test_fuzz_inv_deserialize_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
|
test_fuzz_inv_deserialize_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
|
test_fuzz_inv_deserialize_LDADD = $(FUZZ_SUITE_LD_COMMON)
|
|
|
|
test_fuzz_bloomfilter_deserialize_SOURCES = $(FUZZ_SUITE) test/fuzz/deserialize.cpp
|
|
test_fuzz_bloomfilter_deserialize_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -DBLOOMFILTER_DESERIALIZE=1
|
|
test_fuzz_bloomfilter_deserialize_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
|
test_fuzz_bloomfilter_deserialize_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
|
test_fuzz_bloomfilter_deserialize_LDADD = $(FUZZ_SUITE_LD_COMMON)
|
|
|
|
test_fuzz_diskblockindex_deserialize_SOURCES = $(FUZZ_SUITE) test/fuzz/deserialize.cpp
|
|
test_fuzz_diskblockindex_deserialize_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -DDISKBLOCKINDEX_DESERIALIZE=1
|
|
test_fuzz_diskblockindex_deserialize_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
|
test_fuzz_diskblockindex_deserialize_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
|
test_fuzz_diskblockindex_deserialize_LDADD = $(FUZZ_SUITE_LD_COMMON)
|
|
|
|
test_fuzz_eval_script_SOURCES = $(FUZZ_SUITE) test/fuzz/eval_script.cpp
|
|
test_fuzz_eval_script_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
|
|
test_fuzz_eval_script_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
|
test_fuzz_eval_script_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
|
test_fuzz_eval_script_LDADD = $(FUZZ_SUITE_LD_COMMON)
|
|
|
|
test_fuzz_txoutcompressor_deserialize_SOURCES = $(FUZZ_SUITE) test/fuzz/deserialize.cpp
|
|
test_fuzz_txoutcompressor_deserialize_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -DTXOUTCOMPRESSOR_DESERIALIZE=1
|
|
test_fuzz_txoutcompressor_deserialize_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
|
test_fuzz_txoutcompressor_deserialize_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
|
test_fuzz_txoutcompressor_deserialize_LDADD = $(FUZZ_SUITE_LD_COMMON)
|
|
|
|
test_fuzz_blocktransactions_deserialize_SOURCES = $(FUZZ_SUITE) test/fuzz/deserialize.cpp
|
|
test_fuzz_blocktransactions_deserialize_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -DBLOCKTRANSACTIONS_DESERIALIZE=1
|
|
test_fuzz_blocktransactions_deserialize_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
|
test_fuzz_blocktransactions_deserialize_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
|
test_fuzz_blocktransactions_deserialize_LDADD = $(FUZZ_SUITE_LD_COMMON)
|
|
|
|
test_fuzz_blocktransactionsrequest_deserialize_SOURCES = $(FUZZ_SUITE) test/fuzz/deserialize.cpp
|
|
test_fuzz_blocktransactionsrequest_deserialize_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -DBLOCKTRANSACTIONSREQUEST_DESERIALIZE=1
|
|
test_fuzz_blocktransactionsrequest_deserialize_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
|
test_fuzz_blocktransactionsrequest_deserialize_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
|
test_fuzz_blocktransactionsrequest_deserialize_LDADD = $(FUZZ_SUITE_LD_COMMON)
|
|
|
|
test_fuzz_transaction_SOURCES = $(FUZZ_SUITE) test/fuzz/transaction.cpp
|
|
test_fuzz_transaction_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
|
|
test_fuzz_transaction_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
|
test_fuzz_transaction_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
|
test_fuzz_transaction_LDADD = $(FUZZ_SUITE_LD_COMMON)
|
|
|
|
endif # ENABLE_FUZZ
|
|
|
|
nodist_test_test_bitcoin_SOURCES = $(GENERATED_TEST_FILES)
|
|
|
|
$(BITCOIN_TESTS): $(GENERATED_TEST_FILES)
|
|
|
|
CLEAN_BITCOIN_TEST = test/*.gcda test/*.gcno $(GENERATED_TEST_FILES) $(BITCOIN_TESTS:=.log)
|
|
|
|
CLEANFILES += $(CLEAN_BITCOIN_TEST)
|
|
|
|
if TARGET_WINDOWS
|
|
bitcoin_test: $(TEST_BINARY)
|
|
else
|
|
if ENABLE_BENCH
|
|
bitcoin_test: $(TEST_BINARY) $(BENCH_BINARY)
|
|
else
|
|
bitcoin_test: $(TEST_BINARY)
|
|
endif
|
|
endif
|
|
|
|
bitcoin_test_check: $(TEST_BINARY) FORCE
|
|
$(MAKE) check-TESTS TESTS=$^
|
|
|
|
bitcoin_test_clean : FORCE
|
|
rm -f $(CLEAN_BITCOIN_TEST) $(test_test_bitcoin_OBJECTS) $(TEST_BINARY)
|
|
|
|
check-local: $(BITCOIN_TESTS:.cpp=.cpp.test)
|
|
if BUILD_BITCOIN_TX
|
|
@echo "Running test/util/bitcoin-util-test.py..."
|
|
$(PYTHON) $(top_builddir)/test/util/bitcoin-util-test.py
|
|
endif
|
|
@echo "Running test/util/rpcauth-test.py..."
|
|
$(PYTHON) $(top_builddir)/test/util/rpcauth-test.py
|
|
if TARGET_WINDOWS
|
|
else
|
|
if ENABLE_BENCH
|
|
@echo "Running bench/bench_bitcoin -evals=1 -scaling=0..."
|
|
$(BENCH_BINARY) -evals=1 -scaling=0 > /dev/null
|
|
endif
|
|
endif
|
|
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1 check
|
|
if EMBEDDED_UNIVALUE
|
|
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C univalue check
|
|
endif
|
|
|
|
%.cpp.test: %.cpp
|
|
@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 $<
|
|
$(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)
|
|
|
|
%.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 "};};"; \
|
|
} > "$@.new" && mv -f "$@.new" "$@"
|
|
@echo "Generated $@"
|