tests: dumping and minimizing of script assets data

This adds a --dumptests flag to the feature_taproot.py test, to dump all its
generated test cases to files, in a format compatible with the
script_assets_test unit test. A fuzzer for said format is added as well, whose
primary purpose is coverage-based minimization of those dumps.
This commit is contained in:
Pieter Wuille
2020-10-01 23:24:00 -07:00
parent 4567ba034c
commit 0e2a5e448f
4 changed files with 258 additions and 1 deletions

View File

@@ -1715,6 +1715,9 @@ static void AssetTest(const UniValue& test)
BOOST_AUTO_TEST_CASE(script_assets_test)
{
// See src/test/fuzz/script_assets_test_minimizer.cpp for information on how to generate
// the script_assets_test.json file used by this test.
const char* dir = std::getenv("DIR_UNIT_TEST_DATA");
BOOST_WARN_MESSAGE(dir != nullptr, "Variable DIR_UNIT_TEST_DATA unset, skipping script_assets_test");
if (dir == nullptr) return;