From 00902c48cdc5d6a531abfd279fd8e7779cf0a0b8 Mon Sep 17 00:00:00 2001 From: John Newbery Date: Wed, 8 Mar 2017 15:56:30 -0500 Subject: [PATCH 1/5] Rename qa directory to test --- Makefile.am | 8 ++++---- README.md | 4 ++-- configure.ac | 8 ++++---- contrib/devtools/copyright_header.py | 2 +- contrib/rpm/bitcoin.spec | 2 +- doc/developer-notes.md | 4 ++-- {qa => test}/README.md | 16 ++++++++-------- {qa => test}/pull-tester/rpc-tests.py | 14 +++++++------- {qa => test}/pull-tester/tests_config.ini.in | 0 {qa => test}/rpc-tests/.gitignore | 0 {qa => test}/rpc-tests/README.md | 0 {qa => test}/rpc-tests/abandonconflict.py | 0 {qa => test}/rpc-tests/assumevalid.py | 0 {qa => test}/rpc-tests/bip65-cltv-p2p.py | 0 {qa => test}/rpc-tests/bip65-cltv.py | 0 {qa => test}/rpc-tests/bip68-112-113-p2p.py | 0 {qa => test}/rpc-tests/bip68-sequence.py | 0 {qa => test}/rpc-tests/bip9-softforks.py | 0 {qa => test}/rpc-tests/bipdersig-p2p.py | 0 {qa => test}/rpc-tests/bipdersig.py | 0 {qa => test}/rpc-tests/blockchain.py | 0 {qa => test}/rpc-tests/bumpfee.py | 0 {qa => test}/rpc-tests/create_cache.py | 0 {qa => test}/rpc-tests/decodescript.py | 0 {qa => test}/rpc-tests/disablewallet.py | 0 {qa => test}/rpc-tests/forknotify.py | 0 {qa => test}/rpc-tests/fundrawtransaction.py | 0 .../rpc-tests/getblocktemplate_longpoll.py | 0 .../rpc-tests/getblocktemplate_proposals.py | 0 {qa => test}/rpc-tests/getchaintips.py | 0 {qa => test}/rpc-tests/httpbasics.py | 0 {qa => test}/rpc-tests/import-rescan.py | 0 {qa => test}/rpc-tests/importmulti.py | 0 {qa => test}/rpc-tests/importprunedfunds.py | 0 {qa => test}/rpc-tests/invalidateblock.py | 0 {qa => test}/rpc-tests/invalidblockrequest.py | 0 {qa => test}/rpc-tests/invalidtxrequest.py | 0 {qa => test}/rpc-tests/keypool.py | 0 {qa => test}/rpc-tests/listsinceblock.py | 0 {qa => test}/rpc-tests/listtransactions.py | 0 {qa => test}/rpc-tests/maxblocksinflight.py | 0 {qa => test}/rpc-tests/maxuploadtarget.py | 0 {qa => test}/rpc-tests/mempool_limit.py | 0 {qa => test}/rpc-tests/mempool_packages.py | 0 {qa => test}/rpc-tests/mempool_reorg.py | 0 {qa => test}/rpc-tests/mempool_resurrect_test.py | 0 {qa => test}/rpc-tests/mempool_spendcoinbase.py | 0 {qa => test}/rpc-tests/merkle_blocks.py | 0 {qa => test}/rpc-tests/multi_rpc.py | 0 {qa => test}/rpc-tests/nodehandling.py | 0 {qa => test}/rpc-tests/nulldummy.py | 0 {qa => test}/rpc-tests/p2p-acceptblock.py | 0 {qa => test}/rpc-tests/p2p-compactblocks.py | 0 {qa => test}/rpc-tests/p2p-feefilter.py | 0 {qa => test}/rpc-tests/p2p-fullblocktest.py | 0 {qa => test}/rpc-tests/p2p-leaktests.py | 0 {qa => test}/rpc-tests/p2p-mempool.py | 0 {qa => test}/rpc-tests/p2p-segwit.py | 0 {qa => test}/rpc-tests/p2p-timeouts.py | 0 .../rpc-tests/p2p-versionbits-warning.py | 0 {qa => test}/rpc-tests/preciousblock.py | 0 {qa => test}/rpc-tests/prioritise_transaction.py | 0 {qa => test}/rpc-tests/proxy_test.py | 0 {qa => test}/rpc-tests/pruning.py | 0 {qa => test}/rpc-tests/rawtransactions.py | 0 {qa => test}/rpc-tests/receivedby.py | 0 {qa => test}/rpc-tests/reindex.py | 0 {qa => test}/rpc-tests/replace-by-fee.py | 0 {qa => test}/rpc-tests/rest.py | 0 {qa => test}/rpc-tests/rpcbind_test.py | 0 {qa => test}/rpc-tests/rpcnamedargs.py | 0 {qa => test}/rpc-tests/segwit.py | 0 {qa => test}/rpc-tests/sendheaders.py | 0 {qa => test}/rpc-tests/signmessages.py | 0 {qa => test}/rpc-tests/signrawtransactions.py | 0 {qa => test}/rpc-tests/smartfees.py | 0 .../rpc-tests/test_framework/__init__.py | 0 {qa => test}/rpc-tests/test_framework/address.py | 0 .../rpc-tests/test_framework/authproxy.py | 0 {qa => test}/rpc-tests/test_framework/bignum.py | 0 .../rpc-tests/test_framework/blockstore.py | 0 .../rpc-tests/test_framework/blocktools.py | 0 .../rpc-tests/test_framework/comptool.py | 0 .../rpc-tests/test_framework/coverage.py | 0 {qa => test}/rpc-tests/test_framework/key.py | 0 .../rpc-tests/test_framework/mininode.py | 0 {qa => test}/rpc-tests/test_framework/netutil.py | 0 {qa => test}/rpc-tests/test_framework/script.py | 0 {qa => test}/rpc-tests/test_framework/siphash.py | 0 {qa => test}/rpc-tests/test_framework/socks5.py | 0 .../rpc-tests/test_framework/test_framework.py | 0 {qa => test}/rpc-tests/test_framework/util.py | 0 {qa => test}/rpc-tests/txn_clone.py | 0 {qa => test}/rpc-tests/txn_doublespend.py | 0 {qa => test}/rpc-tests/wallet-accounts.py | 0 {qa => test}/rpc-tests/wallet-dump.py | 0 {qa => test}/rpc-tests/wallet-hd.py | 0 {qa => test}/rpc-tests/wallet.py | 0 {qa => test}/rpc-tests/walletbackup.py | 0 {qa => test}/rpc-tests/zapwallettxes.py | 0 {qa => test}/rpc-tests/zmq_test.py | 0 101 files changed, 29 insertions(+), 29 deletions(-) rename {qa => test}/README.md (82%) rename {qa => test}/pull-tester/rpc-tests.py (97%) rename {qa => test}/pull-tester/tests_config.ini.in (100%) rename {qa => test}/rpc-tests/.gitignore (100%) rename {qa => test}/rpc-tests/README.md (100%) rename {qa => test}/rpc-tests/abandonconflict.py (100%) rename {qa => test}/rpc-tests/assumevalid.py (100%) rename {qa => test}/rpc-tests/bip65-cltv-p2p.py (100%) rename {qa => test}/rpc-tests/bip65-cltv.py (100%) rename {qa => test}/rpc-tests/bip68-112-113-p2p.py (100%) rename {qa => test}/rpc-tests/bip68-sequence.py (100%) rename {qa => test}/rpc-tests/bip9-softforks.py (100%) rename {qa => test}/rpc-tests/bipdersig-p2p.py (100%) rename {qa => test}/rpc-tests/bipdersig.py (100%) rename {qa => test}/rpc-tests/blockchain.py (100%) rename {qa => test}/rpc-tests/bumpfee.py (100%) rename {qa => test}/rpc-tests/create_cache.py (100%) rename {qa => test}/rpc-tests/decodescript.py (100%) rename {qa => test}/rpc-tests/disablewallet.py (100%) rename {qa => test}/rpc-tests/forknotify.py (100%) rename {qa => test}/rpc-tests/fundrawtransaction.py (100%) rename {qa => test}/rpc-tests/getblocktemplate_longpoll.py (100%) rename {qa => test}/rpc-tests/getblocktemplate_proposals.py (100%) rename {qa => test}/rpc-tests/getchaintips.py (100%) rename {qa => test}/rpc-tests/httpbasics.py (100%) rename {qa => test}/rpc-tests/import-rescan.py (100%) rename {qa => test}/rpc-tests/importmulti.py (100%) rename {qa => test}/rpc-tests/importprunedfunds.py (100%) rename {qa => test}/rpc-tests/invalidateblock.py (100%) rename {qa => test}/rpc-tests/invalidblockrequest.py (100%) rename {qa => test}/rpc-tests/invalidtxrequest.py (100%) rename {qa => test}/rpc-tests/keypool.py (100%) rename {qa => test}/rpc-tests/listsinceblock.py (100%) rename {qa => test}/rpc-tests/listtransactions.py (100%) rename {qa => test}/rpc-tests/maxblocksinflight.py (100%) rename {qa => test}/rpc-tests/maxuploadtarget.py (100%) rename {qa => test}/rpc-tests/mempool_limit.py (100%) rename {qa => test}/rpc-tests/mempool_packages.py (100%) rename {qa => test}/rpc-tests/mempool_reorg.py (100%) rename {qa => test}/rpc-tests/mempool_resurrect_test.py (100%) rename {qa => test}/rpc-tests/mempool_spendcoinbase.py (100%) rename {qa => test}/rpc-tests/merkle_blocks.py (100%) rename {qa => test}/rpc-tests/multi_rpc.py (100%) rename {qa => test}/rpc-tests/nodehandling.py (100%) rename {qa => test}/rpc-tests/nulldummy.py (100%) rename {qa => test}/rpc-tests/p2p-acceptblock.py (100%) rename {qa => test}/rpc-tests/p2p-compactblocks.py (100%) rename {qa => test}/rpc-tests/p2p-feefilter.py (100%) rename {qa => test}/rpc-tests/p2p-fullblocktest.py (100%) rename {qa => test}/rpc-tests/p2p-leaktests.py (100%) rename {qa => test}/rpc-tests/p2p-mempool.py (100%) rename {qa => test}/rpc-tests/p2p-segwit.py (100%) rename {qa => test}/rpc-tests/p2p-timeouts.py (100%) rename {qa => test}/rpc-tests/p2p-versionbits-warning.py (100%) rename {qa => test}/rpc-tests/preciousblock.py (100%) rename {qa => test}/rpc-tests/prioritise_transaction.py (100%) rename {qa => test}/rpc-tests/proxy_test.py (100%) rename {qa => test}/rpc-tests/pruning.py (100%) rename {qa => test}/rpc-tests/rawtransactions.py (100%) rename {qa => test}/rpc-tests/receivedby.py (100%) rename {qa => test}/rpc-tests/reindex.py (100%) rename {qa => test}/rpc-tests/replace-by-fee.py (100%) rename {qa => test}/rpc-tests/rest.py (100%) rename {qa => test}/rpc-tests/rpcbind_test.py (100%) rename {qa => test}/rpc-tests/rpcnamedargs.py (100%) rename {qa => test}/rpc-tests/segwit.py (100%) rename {qa => test}/rpc-tests/sendheaders.py (100%) rename {qa => test}/rpc-tests/signmessages.py (100%) rename {qa => test}/rpc-tests/signrawtransactions.py (100%) rename {qa => test}/rpc-tests/smartfees.py (100%) rename {qa => test}/rpc-tests/test_framework/__init__.py (100%) rename {qa => test}/rpc-tests/test_framework/address.py (100%) rename {qa => test}/rpc-tests/test_framework/authproxy.py (100%) rename {qa => test}/rpc-tests/test_framework/bignum.py (100%) rename {qa => test}/rpc-tests/test_framework/blockstore.py (100%) rename {qa => test}/rpc-tests/test_framework/blocktools.py (100%) rename {qa => test}/rpc-tests/test_framework/comptool.py (100%) rename {qa => test}/rpc-tests/test_framework/coverage.py (100%) rename {qa => test}/rpc-tests/test_framework/key.py (100%) rename {qa => test}/rpc-tests/test_framework/mininode.py (100%) rename {qa => test}/rpc-tests/test_framework/netutil.py (100%) rename {qa => test}/rpc-tests/test_framework/script.py (100%) rename {qa => test}/rpc-tests/test_framework/siphash.py (100%) rename {qa => test}/rpc-tests/test_framework/socks5.py (100%) rename {qa => test}/rpc-tests/test_framework/test_framework.py (100%) rename {qa => test}/rpc-tests/test_framework/util.py (100%) rename {qa => test}/rpc-tests/txn_clone.py (100%) rename {qa => test}/rpc-tests/txn_doublespend.py (100%) rename {qa => test}/rpc-tests/wallet-accounts.py (100%) rename {qa => test}/rpc-tests/wallet-dump.py (100%) rename {qa => test}/rpc-tests/wallet-hd.py (100%) rename {qa => test}/rpc-tests/wallet.py (100%) rename {qa => test}/rpc-tests/walletbackup.py (100%) rename {qa => test}/rpc-tests/zapwallettxes.py (100%) rename {qa => test}/rpc-tests/zmq_test.py (100%) diff --git a/Makefile.am b/Makefile.am index 1ee2dfb73..a8fa1d6c3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -195,7 +195,7 @@ test_bitcoin_filtered.info: test_bitcoin.info $(LCOV) -r $< "/usr/include/*" -o $@ rpc_test.info: test_bitcoin_filtered.info - -@TIMEOUT=15 python qa/pull-tester/rpc-tests.py $(EXTENDED_RPC_TESTS) + -@TIMEOUT=15 python test/pull-tester/rpc-tests.py $(EXTENDED_RPC_TESTS) $(LCOV) -c -d $(abs_builddir)/src --t rpc-tests -o $@ $(LCOV) -z -d $(abs_builddir)/src $(LCOV) -z -d $(abs_builddir)/src/leveldb @@ -223,7 +223,7 @@ endif dist_noinst_SCRIPTS = autogen.sh -EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/rpc-tests.py qa/rpc-tests $(DIST_CONTRIB) $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS) +EXTRA_DIST = $(top_srcdir)/share/genbuild.sh test/pull-tester/rpc-tests.py test/rpc-tests $(DIST_CONTRIB) $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS) CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER) @@ -232,5 +232,5 @@ CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER) DISTCHECK_CONFIGURE_FLAGS = --enable-man clean-local: - rm -rf coverage_percent.txt test_bitcoin.coverage/ total.coverage/ qa/tmp/ cache/ $(OSX_APP) - rm -rf qa/pull-tester/__pycache__ + rm -rf coverage_percent.txt test_bitcoin.coverage/ total.coverage/ test/tmp/ cache/ $(OSX_APP) + rm -rf test/pull-tester/__pycache__ diff --git a/README.md b/README.md index 38a90dde4..4de30e0df 100644 --- a/README.md +++ b/README.md @@ -54,9 +54,9 @@ submit new unit tests for old code. Unit tests can be compiled and run (assuming they weren't disabled in configure) with: `make check`. Further details on running and extending unit tests can be found in [/src/test/README.md](/src/test/README.md). -There are also [regression and integration tests](/qa) of the RPC interface, written +There are also [regression and integration tests](/test) of the RPC interface, written in Python, that are run automatically on the build server. -These tests can be run (if the [test dependencies](/qa) are installed) with: `qa/pull-tester/rpc-tests.py` +These tests can be run (if the [test dependencies](/test) are installed) with: `test/pull-tester/rpc-tests.py` The Travis CI system makes sure that every pull request is built for Windows, Linux, and OS X, and that unit/sanity tests are run automatically. diff --git a/configure.ac b/configure.ac index 41634e035..b32daf0a2 100644 --- a/configure.ac +++ b/configure.ac @@ -1148,9 +1148,9 @@ AC_SUBST(ZMQ_LIBS) AC_SUBST(PROTOBUF_LIBS) AC_SUBST(QR_LIBS) AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist src/test/buildenv.py]) -AC_CONFIG_FILES([qa/pull-tester/tests_config.ini],[chmod +x qa/pull-tester/tests_config.ini]) +AC_CONFIG_FILES([test/pull-tester/tests_config.ini],[chmod +x test/pull-tester/tests_config.ini]) AC_CONFIG_FILES([contrib/devtools/split-debug.sh],[chmod +x contrib/devtools/split-debug.sh]) -AC_CONFIG_LINKS([qa/pull-tester/rpc-tests.py:qa/pull-tester/rpc-tests.py]) +AC_CONFIG_LINKS([test/pull-tester/rpc-tests.py:test/pull-tester/rpc-tests.py]) dnl boost's m4 checks do something really nasty: they export these vars. As a dnl result, they leak into secp256k1's configure and crazy things happen. @@ -1198,8 +1198,8 @@ esac dnl Replace the BUILDDIR path with the correct Windows path if compiling on Native Windows case ${OS} in *Windows*) - sed 's/BUILDDIR="\/\([[a-z]]\)/BUILDDIR="\1:/' qa/pull-tester/tests_config.py > qa/pull-tester/tests_config-2.py - mv qa/pull-tester/tests_config-2.py qa/pull-tester/tests_config.py + sed 's/BUILDDIR="\/\([[a-z]]\)/BUILDDIR="\1:/' test/pull-tester/tests_config.py > test/pull-tester/tests_config-2.py + mv test/pull-tester/tests_config-2.py test/pull-tester/tests_config.py ;; esac diff --git a/contrib/devtools/copyright_header.py b/contrib/devtools/copyright_header.py index 9f35c378b..1b7087934 100755 --- a/contrib/devtools/copyright_header.py +++ b/contrib/devtools/copyright_header.py @@ -32,7 +32,7 @@ EXCLUDE = [ 'src/tinyformat.h', 'src/leveldb/util/env_win.cc', 'src/crypto/ctaes/bench.c', - 'qa/rpc-tests/test_framework/bignum.py', + 'test/rpc-tests/test_framework/bignum.py', # python init: '*__init__.py', ] diff --git a/contrib/rpm/bitcoin.spec b/contrib/rpm/bitcoin.spec index 516f42334..f7796efc0 100644 --- a/contrib/rpm/bitcoin.spec +++ b/contrib/rpm/bitcoin.spec @@ -314,7 +314,7 @@ make check pushd src srcdir=. test/bitcoin-util-test.py popd -qa/pull-tester/rpc-tests.py -extended +test/pull-tester/rpc-tests.py -extended %post libs -p /sbin/ldconfig diff --git a/doc/developer-notes.md b/doc/developer-notes.md index 3a7e4f73b..ec608cfbd 100644 --- a/doc/developer-notes.md +++ b/doc/developer-notes.md @@ -132,7 +132,7 @@ Run with the -testnet option to run with "play bitcoins" on the test network, if are testing multi-machine code that needs to operate across the internet. If you are testing something that can run on one machine, run with the -regtest option. -In regression test mode, blocks can be created on-demand; see qa/rpc-tests/ for tests +In regression test mode, blocks can be created on-demand; see test/rpc-tests/ for tests that run in -regtest mode. **DEBUG_LOCKORDER** @@ -252,7 +252,7 @@ Wallet - *Rationale*: In RPC code that conditionally uses the wallet (such as `validateaddress`) it is easy to forget that global pointer `pwalletMain` - can be NULL. See `qa/rpc-tests/disablewallet.py` for functional tests + can be NULL. See `test/rpc-tests/disablewallet.py` for functional tests exercising the API with `-disablewallet` - Include `db_cxx.h` (BerkeleyDB header) only when `ENABLE_WALLET` is set diff --git a/qa/README.md b/test/README.md similarity index 82% rename from qa/README.md rename to test/README.md index f4dce7af5..d71030df5 100644 --- a/qa/README.md +++ b/test/README.md @@ -1,5 +1,5 @@ -The [pull-tester](/qa/pull-tester/) folder contains a script to call -multiple tests from the [rpc-tests](/qa/rpc-tests/) folder. +The [pull-tester](/test/pull-tester/) folder contains a script to call +multiple tests from the [rpc-tests](/test/rpc-tests/) folder. Every pull request to the bitcoin repository is built and run through the regression test suite. You can also run all or only individual @@ -27,19 +27,19 @@ Running tests You can run any single test by calling - qa/pull-tester/rpc-tests.py + test/pull-tester/rpc-tests.py Or you can run any combination of tests by calling - qa/pull-tester/rpc-tests.py ... + test/pull-tester/rpc-tests.py ... Run the regression test suite with - qa/pull-tester/rpc-tests.py + test/pull-tester/rpc-tests.py Run all possible tests with - qa/pull-tester/rpc-tests.py --extended + test/pull-tester/rpc-tests.py --extended By default, tests will be run in parallel. To specify how many jobs to run, append `--jobs=n` (default n=4). @@ -61,7 +61,7 @@ Possible options, which apply to each individual test run: ``` If you set the environment variable `PYTHON_DEBUG=1` you will get some debug -output (example: `PYTHON_DEBUG=1 qa/pull-tester/rpc-tests.py wallet`). +output (example: `PYTHON_DEBUG=1 test/pull-tester/rpc-tests.py wallet`). A 200-block -regtest blockchain and wallets for four nodes is created the first time a regression test is run and @@ -84,4 +84,4 @@ Writing tests ============= You are encouraged to write tests for new or existing features. Further information about the test framework and individual RPC -tests is found in [qa/rpc-tests](/qa/rpc-tests). +tests is found in [test/rpc-tests](/test/rpc-tests). diff --git a/qa/pull-tester/rpc-tests.py b/test/pull-tester/rpc-tests.py similarity index 97% rename from qa/pull-tester/rpc-tests.py rename to test/pull-tester/rpc-tests.py index 68e11b4c2..925e19f09 100755 --- a/qa/pull-tester/rpc-tests.py +++ b/test/pull-tester/rpc-tests.py @@ -11,7 +11,7 @@ forward all unrecognized arguments onto the individual test scripts. RPC tests are disabled on Windows by default. Use --force to run them anyway. For a description of arguments recognized by test scripts, see -`qa/pull-tester/test_framework/test_framework.py:BitcoinTestFramework.main`. +`test/pull-tester/test_framework/test_framework.py:BitcoinTestFramework.main`. """ @@ -171,7 +171,7 @@ def main(): import zmq except ImportError: print("ERROR: \"import zmq\" failed. Use -nozmq to run without the ZMQ tests." - "To run zmq tests, see dependency info in /qa/README.md.") + "To run zmq tests, see dependency info in /test/README.md.") raise # Build list of tests @@ -206,7 +206,7 @@ def main(): if args.help: # Print help for rpc-tests.py, then print help of the first script and exit. parser.print_help() - subprocess.check_call((config["environment"]["SRCDIR"] + '/qa/rpc-tests/' + test_list[0]).split() + ['-h']) + subprocess.check_call((config["environment"]["SRCDIR"] + '/test/rpc-tests/' + test_list[0]).split() + ['-h']) sys.exit(0) run_tests(test_list, config["environment"]["SRCDIR"], config["environment"]["BUILDDIR"], config["environment"]["EXEEXT"], args.jobs, args.coverage, passon_args) @@ -222,10 +222,10 @@ def run_tests(test_list, src_dir, build_dir, exeext, jobs=1, enable_coverage=Fal if "BITCOIND" not in os.environ: os.environ["BITCOIND"] = build_dir + '/src/bitcoind' + exeext - tests_dir = src_dir + '/qa/rpc-tests/' + tests_dir = src_dir + '/test/rpc-tests/' flags = ["--srcdir={}/src".format(build_dir)] + args - flags.append("--cachedir=%s/qa/cache" % build_dir) + flags.append("--cachedir=%s/test/cache" % build_dir) if enable_coverage: coverage = RPCCoverage() @@ -335,7 +335,7 @@ class RPCCoverage(object): After all tests complete, the commands run are combined and diff'd against the complete list to calculate uncovered RPC commands. - See also: qa/rpc-tests/test_framework/coverage.py + See also: test/rpc-tests/test_framework/coverage.py """ def __init__(self): @@ -363,7 +363,7 @@ class RPCCoverage(object): Return a set of currently untested RPC commands. """ - # This is shared from `qa/rpc-tests/test-framework/coverage.py` + # This is shared from `test/rpc-tests/test-framework/coverage.py` reference_filename = 'rpc_interface.txt' coverage_file_prefix = 'coverage.' diff --git a/qa/pull-tester/tests_config.ini.in b/test/pull-tester/tests_config.ini.in similarity index 100% rename from qa/pull-tester/tests_config.ini.in rename to test/pull-tester/tests_config.ini.in diff --git a/qa/rpc-tests/.gitignore b/test/rpc-tests/.gitignore similarity index 100% rename from qa/rpc-tests/.gitignore rename to test/rpc-tests/.gitignore diff --git a/qa/rpc-tests/README.md b/test/rpc-tests/README.md similarity index 100% rename from qa/rpc-tests/README.md rename to test/rpc-tests/README.md diff --git a/qa/rpc-tests/abandonconflict.py b/test/rpc-tests/abandonconflict.py similarity index 100% rename from qa/rpc-tests/abandonconflict.py rename to test/rpc-tests/abandonconflict.py diff --git a/qa/rpc-tests/assumevalid.py b/test/rpc-tests/assumevalid.py similarity index 100% rename from qa/rpc-tests/assumevalid.py rename to test/rpc-tests/assumevalid.py diff --git a/qa/rpc-tests/bip65-cltv-p2p.py b/test/rpc-tests/bip65-cltv-p2p.py similarity index 100% rename from qa/rpc-tests/bip65-cltv-p2p.py rename to test/rpc-tests/bip65-cltv-p2p.py diff --git a/qa/rpc-tests/bip65-cltv.py b/test/rpc-tests/bip65-cltv.py similarity index 100% rename from qa/rpc-tests/bip65-cltv.py rename to test/rpc-tests/bip65-cltv.py diff --git a/qa/rpc-tests/bip68-112-113-p2p.py b/test/rpc-tests/bip68-112-113-p2p.py similarity index 100% rename from qa/rpc-tests/bip68-112-113-p2p.py rename to test/rpc-tests/bip68-112-113-p2p.py diff --git a/qa/rpc-tests/bip68-sequence.py b/test/rpc-tests/bip68-sequence.py similarity index 100% rename from qa/rpc-tests/bip68-sequence.py rename to test/rpc-tests/bip68-sequence.py diff --git a/qa/rpc-tests/bip9-softforks.py b/test/rpc-tests/bip9-softforks.py similarity index 100% rename from qa/rpc-tests/bip9-softforks.py rename to test/rpc-tests/bip9-softforks.py diff --git a/qa/rpc-tests/bipdersig-p2p.py b/test/rpc-tests/bipdersig-p2p.py similarity index 100% rename from qa/rpc-tests/bipdersig-p2p.py rename to test/rpc-tests/bipdersig-p2p.py diff --git a/qa/rpc-tests/bipdersig.py b/test/rpc-tests/bipdersig.py similarity index 100% rename from qa/rpc-tests/bipdersig.py rename to test/rpc-tests/bipdersig.py diff --git a/qa/rpc-tests/blockchain.py b/test/rpc-tests/blockchain.py similarity index 100% rename from qa/rpc-tests/blockchain.py rename to test/rpc-tests/blockchain.py diff --git a/qa/rpc-tests/bumpfee.py b/test/rpc-tests/bumpfee.py similarity index 100% rename from qa/rpc-tests/bumpfee.py rename to test/rpc-tests/bumpfee.py diff --git a/qa/rpc-tests/create_cache.py b/test/rpc-tests/create_cache.py similarity index 100% rename from qa/rpc-tests/create_cache.py rename to test/rpc-tests/create_cache.py diff --git a/qa/rpc-tests/decodescript.py b/test/rpc-tests/decodescript.py similarity index 100% rename from qa/rpc-tests/decodescript.py rename to test/rpc-tests/decodescript.py diff --git a/qa/rpc-tests/disablewallet.py b/test/rpc-tests/disablewallet.py similarity index 100% rename from qa/rpc-tests/disablewallet.py rename to test/rpc-tests/disablewallet.py diff --git a/qa/rpc-tests/forknotify.py b/test/rpc-tests/forknotify.py similarity index 100% rename from qa/rpc-tests/forknotify.py rename to test/rpc-tests/forknotify.py diff --git a/qa/rpc-tests/fundrawtransaction.py b/test/rpc-tests/fundrawtransaction.py similarity index 100% rename from qa/rpc-tests/fundrawtransaction.py rename to test/rpc-tests/fundrawtransaction.py diff --git a/qa/rpc-tests/getblocktemplate_longpoll.py b/test/rpc-tests/getblocktemplate_longpoll.py similarity index 100% rename from qa/rpc-tests/getblocktemplate_longpoll.py rename to test/rpc-tests/getblocktemplate_longpoll.py diff --git a/qa/rpc-tests/getblocktemplate_proposals.py b/test/rpc-tests/getblocktemplate_proposals.py similarity index 100% rename from qa/rpc-tests/getblocktemplate_proposals.py rename to test/rpc-tests/getblocktemplate_proposals.py diff --git a/qa/rpc-tests/getchaintips.py b/test/rpc-tests/getchaintips.py similarity index 100% rename from qa/rpc-tests/getchaintips.py rename to test/rpc-tests/getchaintips.py diff --git a/qa/rpc-tests/httpbasics.py b/test/rpc-tests/httpbasics.py similarity index 100% rename from qa/rpc-tests/httpbasics.py rename to test/rpc-tests/httpbasics.py diff --git a/qa/rpc-tests/import-rescan.py b/test/rpc-tests/import-rescan.py similarity index 100% rename from qa/rpc-tests/import-rescan.py rename to test/rpc-tests/import-rescan.py diff --git a/qa/rpc-tests/importmulti.py b/test/rpc-tests/importmulti.py similarity index 100% rename from qa/rpc-tests/importmulti.py rename to test/rpc-tests/importmulti.py diff --git a/qa/rpc-tests/importprunedfunds.py b/test/rpc-tests/importprunedfunds.py similarity index 100% rename from qa/rpc-tests/importprunedfunds.py rename to test/rpc-tests/importprunedfunds.py diff --git a/qa/rpc-tests/invalidateblock.py b/test/rpc-tests/invalidateblock.py similarity index 100% rename from qa/rpc-tests/invalidateblock.py rename to test/rpc-tests/invalidateblock.py diff --git a/qa/rpc-tests/invalidblockrequest.py b/test/rpc-tests/invalidblockrequest.py similarity index 100% rename from qa/rpc-tests/invalidblockrequest.py rename to test/rpc-tests/invalidblockrequest.py diff --git a/qa/rpc-tests/invalidtxrequest.py b/test/rpc-tests/invalidtxrequest.py similarity index 100% rename from qa/rpc-tests/invalidtxrequest.py rename to test/rpc-tests/invalidtxrequest.py diff --git a/qa/rpc-tests/keypool.py b/test/rpc-tests/keypool.py similarity index 100% rename from qa/rpc-tests/keypool.py rename to test/rpc-tests/keypool.py diff --git a/qa/rpc-tests/listsinceblock.py b/test/rpc-tests/listsinceblock.py similarity index 100% rename from qa/rpc-tests/listsinceblock.py rename to test/rpc-tests/listsinceblock.py diff --git a/qa/rpc-tests/listtransactions.py b/test/rpc-tests/listtransactions.py similarity index 100% rename from qa/rpc-tests/listtransactions.py rename to test/rpc-tests/listtransactions.py diff --git a/qa/rpc-tests/maxblocksinflight.py b/test/rpc-tests/maxblocksinflight.py similarity index 100% rename from qa/rpc-tests/maxblocksinflight.py rename to test/rpc-tests/maxblocksinflight.py diff --git a/qa/rpc-tests/maxuploadtarget.py b/test/rpc-tests/maxuploadtarget.py similarity index 100% rename from qa/rpc-tests/maxuploadtarget.py rename to test/rpc-tests/maxuploadtarget.py diff --git a/qa/rpc-tests/mempool_limit.py b/test/rpc-tests/mempool_limit.py similarity index 100% rename from qa/rpc-tests/mempool_limit.py rename to test/rpc-tests/mempool_limit.py diff --git a/qa/rpc-tests/mempool_packages.py b/test/rpc-tests/mempool_packages.py similarity index 100% rename from qa/rpc-tests/mempool_packages.py rename to test/rpc-tests/mempool_packages.py diff --git a/qa/rpc-tests/mempool_reorg.py b/test/rpc-tests/mempool_reorg.py similarity index 100% rename from qa/rpc-tests/mempool_reorg.py rename to test/rpc-tests/mempool_reorg.py diff --git a/qa/rpc-tests/mempool_resurrect_test.py b/test/rpc-tests/mempool_resurrect_test.py similarity index 100% rename from qa/rpc-tests/mempool_resurrect_test.py rename to test/rpc-tests/mempool_resurrect_test.py diff --git a/qa/rpc-tests/mempool_spendcoinbase.py b/test/rpc-tests/mempool_spendcoinbase.py similarity index 100% rename from qa/rpc-tests/mempool_spendcoinbase.py rename to test/rpc-tests/mempool_spendcoinbase.py diff --git a/qa/rpc-tests/merkle_blocks.py b/test/rpc-tests/merkle_blocks.py similarity index 100% rename from qa/rpc-tests/merkle_blocks.py rename to test/rpc-tests/merkle_blocks.py diff --git a/qa/rpc-tests/multi_rpc.py b/test/rpc-tests/multi_rpc.py similarity index 100% rename from qa/rpc-tests/multi_rpc.py rename to test/rpc-tests/multi_rpc.py diff --git a/qa/rpc-tests/nodehandling.py b/test/rpc-tests/nodehandling.py similarity index 100% rename from qa/rpc-tests/nodehandling.py rename to test/rpc-tests/nodehandling.py diff --git a/qa/rpc-tests/nulldummy.py b/test/rpc-tests/nulldummy.py similarity index 100% rename from qa/rpc-tests/nulldummy.py rename to test/rpc-tests/nulldummy.py diff --git a/qa/rpc-tests/p2p-acceptblock.py b/test/rpc-tests/p2p-acceptblock.py similarity index 100% rename from qa/rpc-tests/p2p-acceptblock.py rename to test/rpc-tests/p2p-acceptblock.py diff --git a/qa/rpc-tests/p2p-compactblocks.py b/test/rpc-tests/p2p-compactblocks.py similarity index 100% rename from qa/rpc-tests/p2p-compactblocks.py rename to test/rpc-tests/p2p-compactblocks.py diff --git a/qa/rpc-tests/p2p-feefilter.py b/test/rpc-tests/p2p-feefilter.py similarity index 100% rename from qa/rpc-tests/p2p-feefilter.py rename to test/rpc-tests/p2p-feefilter.py diff --git a/qa/rpc-tests/p2p-fullblocktest.py b/test/rpc-tests/p2p-fullblocktest.py similarity index 100% rename from qa/rpc-tests/p2p-fullblocktest.py rename to test/rpc-tests/p2p-fullblocktest.py diff --git a/qa/rpc-tests/p2p-leaktests.py b/test/rpc-tests/p2p-leaktests.py similarity index 100% rename from qa/rpc-tests/p2p-leaktests.py rename to test/rpc-tests/p2p-leaktests.py diff --git a/qa/rpc-tests/p2p-mempool.py b/test/rpc-tests/p2p-mempool.py similarity index 100% rename from qa/rpc-tests/p2p-mempool.py rename to test/rpc-tests/p2p-mempool.py diff --git a/qa/rpc-tests/p2p-segwit.py b/test/rpc-tests/p2p-segwit.py similarity index 100% rename from qa/rpc-tests/p2p-segwit.py rename to test/rpc-tests/p2p-segwit.py diff --git a/qa/rpc-tests/p2p-timeouts.py b/test/rpc-tests/p2p-timeouts.py similarity index 100% rename from qa/rpc-tests/p2p-timeouts.py rename to test/rpc-tests/p2p-timeouts.py diff --git a/qa/rpc-tests/p2p-versionbits-warning.py b/test/rpc-tests/p2p-versionbits-warning.py similarity index 100% rename from qa/rpc-tests/p2p-versionbits-warning.py rename to test/rpc-tests/p2p-versionbits-warning.py diff --git a/qa/rpc-tests/preciousblock.py b/test/rpc-tests/preciousblock.py similarity index 100% rename from qa/rpc-tests/preciousblock.py rename to test/rpc-tests/preciousblock.py diff --git a/qa/rpc-tests/prioritise_transaction.py b/test/rpc-tests/prioritise_transaction.py similarity index 100% rename from qa/rpc-tests/prioritise_transaction.py rename to test/rpc-tests/prioritise_transaction.py diff --git a/qa/rpc-tests/proxy_test.py b/test/rpc-tests/proxy_test.py similarity index 100% rename from qa/rpc-tests/proxy_test.py rename to test/rpc-tests/proxy_test.py diff --git a/qa/rpc-tests/pruning.py b/test/rpc-tests/pruning.py similarity index 100% rename from qa/rpc-tests/pruning.py rename to test/rpc-tests/pruning.py diff --git a/qa/rpc-tests/rawtransactions.py b/test/rpc-tests/rawtransactions.py similarity index 100% rename from qa/rpc-tests/rawtransactions.py rename to test/rpc-tests/rawtransactions.py diff --git a/qa/rpc-tests/receivedby.py b/test/rpc-tests/receivedby.py similarity index 100% rename from qa/rpc-tests/receivedby.py rename to test/rpc-tests/receivedby.py diff --git a/qa/rpc-tests/reindex.py b/test/rpc-tests/reindex.py similarity index 100% rename from qa/rpc-tests/reindex.py rename to test/rpc-tests/reindex.py diff --git a/qa/rpc-tests/replace-by-fee.py b/test/rpc-tests/replace-by-fee.py similarity index 100% rename from qa/rpc-tests/replace-by-fee.py rename to test/rpc-tests/replace-by-fee.py diff --git a/qa/rpc-tests/rest.py b/test/rpc-tests/rest.py similarity index 100% rename from qa/rpc-tests/rest.py rename to test/rpc-tests/rest.py diff --git a/qa/rpc-tests/rpcbind_test.py b/test/rpc-tests/rpcbind_test.py similarity index 100% rename from qa/rpc-tests/rpcbind_test.py rename to test/rpc-tests/rpcbind_test.py diff --git a/qa/rpc-tests/rpcnamedargs.py b/test/rpc-tests/rpcnamedargs.py similarity index 100% rename from qa/rpc-tests/rpcnamedargs.py rename to test/rpc-tests/rpcnamedargs.py diff --git a/qa/rpc-tests/segwit.py b/test/rpc-tests/segwit.py similarity index 100% rename from qa/rpc-tests/segwit.py rename to test/rpc-tests/segwit.py diff --git a/qa/rpc-tests/sendheaders.py b/test/rpc-tests/sendheaders.py similarity index 100% rename from qa/rpc-tests/sendheaders.py rename to test/rpc-tests/sendheaders.py diff --git a/qa/rpc-tests/signmessages.py b/test/rpc-tests/signmessages.py similarity index 100% rename from qa/rpc-tests/signmessages.py rename to test/rpc-tests/signmessages.py diff --git a/qa/rpc-tests/signrawtransactions.py b/test/rpc-tests/signrawtransactions.py similarity index 100% rename from qa/rpc-tests/signrawtransactions.py rename to test/rpc-tests/signrawtransactions.py diff --git a/qa/rpc-tests/smartfees.py b/test/rpc-tests/smartfees.py similarity index 100% rename from qa/rpc-tests/smartfees.py rename to test/rpc-tests/smartfees.py diff --git a/qa/rpc-tests/test_framework/__init__.py b/test/rpc-tests/test_framework/__init__.py similarity index 100% rename from qa/rpc-tests/test_framework/__init__.py rename to test/rpc-tests/test_framework/__init__.py diff --git a/qa/rpc-tests/test_framework/address.py b/test/rpc-tests/test_framework/address.py similarity index 100% rename from qa/rpc-tests/test_framework/address.py rename to test/rpc-tests/test_framework/address.py diff --git a/qa/rpc-tests/test_framework/authproxy.py b/test/rpc-tests/test_framework/authproxy.py similarity index 100% rename from qa/rpc-tests/test_framework/authproxy.py rename to test/rpc-tests/test_framework/authproxy.py diff --git a/qa/rpc-tests/test_framework/bignum.py b/test/rpc-tests/test_framework/bignum.py similarity index 100% rename from qa/rpc-tests/test_framework/bignum.py rename to test/rpc-tests/test_framework/bignum.py diff --git a/qa/rpc-tests/test_framework/blockstore.py b/test/rpc-tests/test_framework/blockstore.py similarity index 100% rename from qa/rpc-tests/test_framework/blockstore.py rename to test/rpc-tests/test_framework/blockstore.py diff --git a/qa/rpc-tests/test_framework/blocktools.py b/test/rpc-tests/test_framework/blocktools.py similarity index 100% rename from qa/rpc-tests/test_framework/blocktools.py rename to test/rpc-tests/test_framework/blocktools.py diff --git a/qa/rpc-tests/test_framework/comptool.py b/test/rpc-tests/test_framework/comptool.py similarity index 100% rename from qa/rpc-tests/test_framework/comptool.py rename to test/rpc-tests/test_framework/comptool.py diff --git a/qa/rpc-tests/test_framework/coverage.py b/test/rpc-tests/test_framework/coverage.py similarity index 100% rename from qa/rpc-tests/test_framework/coverage.py rename to test/rpc-tests/test_framework/coverage.py diff --git a/qa/rpc-tests/test_framework/key.py b/test/rpc-tests/test_framework/key.py similarity index 100% rename from qa/rpc-tests/test_framework/key.py rename to test/rpc-tests/test_framework/key.py diff --git a/qa/rpc-tests/test_framework/mininode.py b/test/rpc-tests/test_framework/mininode.py similarity index 100% rename from qa/rpc-tests/test_framework/mininode.py rename to test/rpc-tests/test_framework/mininode.py diff --git a/qa/rpc-tests/test_framework/netutil.py b/test/rpc-tests/test_framework/netutil.py similarity index 100% rename from qa/rpc-tests/test_framework/netutil.py rename to test/rpc-tests/test_framework/netutil.py diff --git a/qa/rpc-tests/test_framework/script.py b/test/rpc-tests/test_framework/script.py similarity index 100% rename from qa/rpc-tests/test_framework/script.py rename to test/rpc-tests/test_framework/script.py diff --git a/qa/rpc-tests/test_framework/siphash.py b/test/rpc-tests/test_framework/siphash.py similarity index 100% rename from qa/rpc-tests/test_framework/siphash.py rename to test/rpc-tests/test_framework/siphash.py diff --git a/qa/rpc-tests/test_framework/socks5.py b/test/rpc-tests/test_framework/socks5.py similarity index 100% rename from qa/rpc-tests/test_framework/socks5.py rename to test/rpc-tests/test_framework/socks5.py diff --git a/qa/rpc-tests/test_framework/test_framework.py b/test/rpc-tests/test_framework/test_framework.py similarity index 100% rename from qa/rpc-tests/test_framework/test_framework.py rename to test/rpc-tests/test_framework/test_framework.py diff --git a/qa/rpc-tests/test_framework/util.py b/test/rpc-tests/test_framework/util.py similarity index 100% rename from qa/rpc-tests/test_framework/util.py rename to test/rpc-tests/test_framework/util.py diff --git a/qa/rpc-tests/txn_clone.py b/test/rpc-tests/txn_clone.py similarity index 100% rename from qa/rpc-tests/txn_clone.py rename to test/rpc-tests/txn_clone.py diff --git a/qa/rpc-tests/txn_doublespend.py b/test/rpc-tests/txn_doublespend.py similarity index 100% rename from qa/rpc-tests/txn_doublespend.py rename to test/rpc-tests/txn_doublespend.py diff --git a/qa/rpc-tests/wallet-accounts.py b/test/rpc-tests/wallet-accounts.py similarity index 100% rename from qa/rpc-tests/wallet-accounts.py rename to test/rpc-tests/wallet-accounts.py diff --git a/qa/rpc-tests/wallet-dump.py b/test/rpc-tests/wallet-dump.py similarity index 100% rename from qa/rpc-tests/wallet-dump.py rename to test/rpc-tests/wallet-dump.py diff --git a/qa/rpc-tests/wallet-hd.py b/test/rpc-tests/wallet-hd.py similarity index 100% rename from qa/rpc-tests/wallet-hd.py rename to test/rpc-tests/wallet-hd.py diff --git a/qa/rpc-tests/wallet.py b/test/rpc-tests/wallet.py similarity index 100% rename from qa/rpc-tests/wallet.py rename to test/rpc-tests/wallet.py diff --git a/qa/rpc-tests/walletbackup.py b/test/rpc-tests/walletbackup.py similarity index 100% rename from qa/rpc-tests/walletbackup.py rename to test/rpc-tests/walletbackup.py diff --git a/qa/rpc-tests/zapwallettxes.py b/test/rpc-tests/zapwallettxes.py similarity index 100% rename from qa/rpc-tests/zapwallettxes.py rename to test/rpc-tests/zapwallettxes.py diff --git a/qa/rpc-tests/zmq_test.py b/test/rpc-tests/zmq_test.py similarity index 100% rename from qa/rpc-tests/zmq_test.py rename to test/rpc-tests/zmq_test.py From c28ee91db07ce82e134d500ddeb5600363c98048 Mon Sep 17 00:00:00 2001 From: John Newbery Date: Thu, 9 Mar 2017 09:44:57 -0500 Subject: [PATCH 2/5] Rename rpc-tests directory to functional --- .travis.yml | 2 +- Makefile.am | 14 +++++++------- README.md | 2 +- configure.ac | 3 +-- contrib/devtools/copyright_header.py | 2 +- doc/developer-notes.md | 4 ++-- test/README.md | 6 +++--- test/{rpc-tests => functional}/.gitignore | 0 test/{rpc-tests => functional}/README.md | 0 .../{rpc-tests => functional}/abandonconflict.py | 0 test/{rpc-tests => functional}/assumevalid.py | 0 test/{rpc-tests => functional}/bip65-cltv-p2p.py | 0 test/{rpc-tests => functional}/bip65-cltv.py | 0 .../bip68-112-113-p2p.py | 0 test/{rpc-tests => functional}/bip68-sequence.py | 0 test/{rpc-tests => functional}/bip9-softforks.py | 0 test/{rpc-tests => functional}/bipdersig-p2p.py | 0 test/{rpc-tests => functional}/bipdersig.py | 0 test/{rpc-tests => functional}/blockchain.py | 0 test/{rpc-tests => functional}/bumpfee.py | 0 test/{rpc-tests => functional}/create_cache.py | 2 +- test/{rpc-tests => functional}/decodescript.py | 0 test/{rpc-tests => functional}/disablewallet.py | 0 test/{rpc-tests => functional}/forknotify.py | 0 .../fundrawtransaction.py | 0 .../getblocktemplate_longpoll.py | 0 .../getblocktemplate_proposals.py | 0 test/{rpc-tests => functional}/getchaintips.py | 0 test/{rpc-tests => functional}/httpbasics.py | 0 test/{rpc-tests => functional}/import-rescan.py | 0 test/{rpc-tests => functional}/importmulti.py | 0 .../importprunedfunds.py | 0 .../{rpc-tests => functional}/invalidateblock.py | 0 .../invalidblockrequest.py | 0 .../invalidtxrequest.py | 0 test/{rpc-tests => functional}/keypool.py | 0 test/{rpc-tests => functional}/listsinceblock.py | 0 .../listtransactions.py | 0 .../maxblocksinflight.py | 0 .../{rpc-tests => functional}/maxuploadtarget.py | 0 test/{rpc-tests => functional}/mempool_limit.py | 0 .../mempool_packages.py | 0 test/{rpc-tests => functional}/mempool_reorg.py | 0 .../mempool_resurrect_test.py | 0 .../mempool_spendcoinbase.py | 0 test/{rpc-tests => functional}/merkle_blocks.py | 0 test/{rpc-tests => functional}/multi_rpc.py | 0 test/{rpc-tests => functional}/nodehandling.py | 0 test/{rpc-tests => functional}/nulldummy.py | 0 .../{rpc-tests => functional}/p2p-acceptblock.py | 0 .../p2p-compactblocks.py | 0 test/{rpc-tests => functional}/p2p-feefilter.py | 0 .../p2p-fullblocktest.py | 0 test/{rpc-tests => functional}/p2p-leaktests.py | 0 test/{rpc-tests => functional}/p2p-mempool.py | 0 test/{rpc-tests => functional}/p2p-segwit.py | 0 test/{rpc-tests => functional}/p2p-timeouts.py | 0 .../p2p-versionbits-warning.py | 0 test/{rpc-tests => functional}/preciousblock.py | 0 .../prioritise_transaction.py | 0 test/{rpc-tests => functional}/proxy_test.py | 0 test/{rpc-tests => functional}/pruning.py | 0 .../{rpc-tests => functional}/rawtransactions.py | 0 test/{rpc-tests => functional}/receivedby.py | 0 test/{rpc-tests => functional}/reindex.py | 0 test/{rpc-tests => functional}/replace-by-fee.py | 0 test/{rpc-tests => functional}/rest.py | 0 test/{rpc-tests => functional}/rpcbind_test.py | 0 test/{rpc-tests => functional}/rpcnamedargs.py | 0 test/{rpc-tests => functional}/segwit.py | 0 test/{rpc-tests => functional}/sendheaders.py | 0 test/{rpc-tests => functional}/signmessages.py | 0 .../signrawtransactions.py | 0 test/{rpc-tests => functional}/smartfees.py | 0 .../test_framework/__init__.py | 0 .../test_framework/address.py | 0 .../test_framework/authproxy.py | 0 .../test_framework/bignum.py | 0 .../test_framework/blockstore.py | 0 .../test_framework/blocktools.py | 0 .../test_framework/comptool.py | 0 .../test_framework/coverage.py | 0 .../test_framework/key.py | 0 .../test_framework/mininode.py | 0 .../test_framework/netutil.py | 0 .../test_framework/script.py | 0 .../test_framework/siphash.py | 0 .../test_framework/socks5.py | 0 .../test_framework/test_framework.py | 0 .../test_framework/util.py | 0 test/{rpc-tests => functional}/txn_clone.py | 0 .../{rpc-tests => functional}/txn_doublespend.py | 0 .../{rpc-tests => functional}/wallet-accounts.py | 0 test/{rpc-tests => functional}/wallet-dump.py | 0 test/{rpc-tests => functional}/wallet-hd.py | 0 test/{rpc-tests => functional}/wallet.py | 0 test/{rpc-tests => functional}/walletbackup.py | 0 test/{rpc-tests => functional}/zapwallettxes.py | 0 test/{rpc-tests => functional}/zmq_test.py | 0 test/pull-tester/rpc-tests.py | 16 ++++++++-------- 100 files changed, 25 insertions(+), 26 deletions(-) rename test/{rpc-tests => functional}/.gitignore (100%) rename test/{rpc-tests => functional}/README.md (100%) rename test/{rpc-tests => functional}/abandonconflict.py (100%) rename test/{rpc-tests => functional}/assumevalid.py (100%) rename test/{rpc-tests => functional}/bip65-cltv-p2p.py (100%) rename test/{rpc-tests => functional}/bip65-cltv.py (100%) rename test/{rpc-tests => functional}/bip68-112-113-p2p.py (100%) rename test/{rpc-tests => functional}/bip68-sequence.py (100%) rename test/{rpc-tests => functional}/bip9-softforks.py (100%) rename test/{rpc-tests => functional}/bipdersig-p2p.py (100%) rename test/{rpc-tests => functional}/bipdersig.py (100%) rename test/{rpc-tests => functional}/blockchain.py (100%) rename test/{rpc-tests => functional}/bumpfee.py (100%) rename test/{rpc-tests => functional}/create_cache.py (89%) rename test/{rpc-tests => functional}/decodescript.py (100%) rename test/{rpc-tests => functional}/disablewallet.py (100%) rename test/{rpc-tests => functional}/forknotify.py (100%) rename test/{rpc-tests => functional}/fundrawtransaction.py (100%) rename test/{rpc-tests => functional}/getblocktemplate_longpoll.py (100%) rename test/{rpc-tests => functional}/getblocktemplate_proposals.py (100%) rename test/{rpc-tests => functional}/getchaintips.py (100%) rename test/{rpc-tests => functional}/httpbasics.py (100%) rename test/{rpc-tests => functional}/import-rescan.py (100%) rename test/{rpc-tests => functional}/importmulti.py (100%) rename test/{rpc-tests => functional}/importprunedfunds.py (100%) rename test/{rpc-tests => functional}/invalidateblock.py (100%) rename test/{rpc-tests => functional}/invalidblockrequest.py (100%) rename test/{rpc-tests => functional}/invalidtxrequest.py (100%) rename test/{rpc-tests => functional}/keypool.py (100%) rename test/{rpc-tests => functional}/listsinceblock.py (100%) rename test/{rpc-tests => functional}/listtransactions.py (100%) rename test/{rpc-tests => functional}/maxblocksinflight.py (100%) rename test/{rpc-tests => functional}/maxuploadtarget.py (100%) rename test/{rpc-tests => functional}/mempool_limit.py (100%) rename test/{rpc-tests => functional}/mempool_packages.py (100%) rename test/{rpc-tests => functional}/mempool_reorg.py (100%) rename test/{rpc-tests => functional}/mempool_resurrect_test.py (100%) rename test/{rpc-tests => functional}/mempool_spendcoinbase.py (100%) rename test/{rpc-tests => functional}/merkle_blocks.py (100%) rename test/{rpc-tests => functional}/multi_rpc.py (100%) rename test/{rpc-tests => functional}/nodehandling.py (100%) rename test/{rpc-tests => functional}/nulldummy.py (100%) rename test/{rpc-tests => functional}/p2p-acceptblock.py (100%) rename test/{rpc-tests => functional}/p2p-compactblocks.py (100%) rename test/{rpc-tests => functional}/p2p-feefilter.py (100%) rename test/{rpc-tests => functional}/p2p-fullblocktest.py (100%) rename test/{rpc-tests => functional}/p2p-leaktests.py (100%) rename test/{rpc-tests => functional}/p2p-mempool.py (100%) rename test/{rpc-tests => functional}/p2p-segwit.py (100%) rename test/{rpc-tests => functional}/p2p-timeouts.py (100%) rename test/{rpc-tests => functional}/p2p-versionbits-warning.py (100%) rename test/{rpc-tests => functional}/preciousblock.py (100%) rename test/{rpc-tests => functional}/prioritise_transaction.py (100%) rename test/{rpc-tests => functional}/proxy_test.py (100%) rename test/{rpc-tests => functional}/pruning.py (100%) rename test/{rpc-tests => functional}/rawtransactions.py (100%) rename test/{rpc-tests => functional}/receivedby.py (100%) rename test/{rpc-tests => functional}/reindex.py (100%) rename test/{rpc-tests => functional}/replace-by-fee.py (100%) rename test/{rpc-tests => functional}/rest.py (100%) rename test/{rpc-tests => functional}/rpcbind_test.py (100%) rename test/{rpc-tests => functional}/rpcnamedargs.py (100%) rename test/{rpc-tests => functional}/segwit.py (100%) rename test/{rpc-tests => functional}/sendheaders.py (100%) rename test/{rpc-tests => functional}/signmessages.py (100%) rename test/{rpc-tests => functional}/signrawtransactions.py (100%) rename test/{rpc-tests => functional}/smartfees.py (100%) rename test/{rpc-tests => functional}/test_framework/__init__.py (100%) rename test/{rpc-tests => functional}/test_framework/address.py (100%) rename test/{rpc-tests => functional}/test_framework/authproxy.py (100%) rename test/{rpc-tests => functional}/test_framework/bignum.py (100%) rename test/{rpc-tests => functional}/test_framework/blockstore.py (100%) rename test/{rpc-tests => functional}/test_framework/blocktools.py (100%) rename test/{rpc-tests => functional}/test_framework/comptool.py (100%) rename test/{rpc-tests => functional}/test_framework/coverage.py (100%) rename test/{rpc-tests => functional}/test_framework/key.py (100%) rename test/{rpc-tests => functional}/test_framework/mininode.py (100%) rename test/{rpc-tests => functional}/test_framework/netutil.py (100%) rename test/{rpc-tests => functional}/test_framework/script.py (100%) rename test/{rpc-tests => functional}/test_framework/siphash.py (100%) rename test/{rpc-tests => functional}/test_framework/socks5.py (100%) rename test/{rpc-tests => functional}/test_framework/test_framework.py (100%) rename test/{rpc-tests => functional}/test_framework/util.py (100%) rename test/{rpc-tests => functional}/txn_clone.py (100%) rename test/{rpc-tests => functional}/txn_doublespend.py (100%) rename test/{rpc-tests => functional}/wallet-accounts.py (100%) rename test/{rpc-tests => functional}/wallet-dump.py (100%) rename test/{rpc-tests => functional}/wallet-hd.py (100%) rename test/{rpc-tests => functional}/wallet.py (100%) rename test/{rpc-tests => functional}/walletbackup.py (100%) rename test/{rpc-tests => functional}/zapwallettxes.py (100%) rename test/{rpc-tests => functional}/zmq_test.py (100%) diff --git a/.travis.yml b/.travis.yml index ba250ec83..b6739e1dd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -70,7 +70,7 @@ script: - make $MAKEJOBS $GOAL || ( echo "Build failure. Verbose build follows." && make $GOAL V=1 ; false ) - export LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/depends/$HOST/lib - if [ "$RUN_TESTS" = "true" ]; then make $MAKEJOBS check VERBOSE=1; fi - - if [ "$RUN_TESTS" = "true" ]; then qa/pull-tester/rpc-tests.py --coverage; fi + - if [ "$RUN_TESTS" = "true" ]; then functional/pull-tester/rpc-tests.py --coverage; fi after_script: - echo $TRAVIS_COMMIT_RANGE - echo $TRAVIS_COMMIT_LOG diff --git a/Makefile.am b/Makefile.am index a8fa1d6c3..0316d9254 100644 --- a/Makefile.am +++ b/Makefile.am @@ -61,7 +61,7 @@ OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) \ COVERAGE_INFO = baseline_filtered_combined.info baseline.info \ leveldb_baseline.info test_bitcoin_filtered.info total_coverage.info \ - baseline_filtered.info rpc_test.info rpc_test_filtered.info \ + baseline_filtered.info functional_test.info functional_test_filtered.info \ leveldb_baseline_filtered.info test_bitcoin_coverage.info test_bitcoin.info dist-hook: @@ -194,20 +194,20 @@ test_bitcoin.info: baseline_filtered_combined.info test_bitcoin_filtered.info: test_bitcoin.info $(LCOV) -r $< "/usr/include/*" -o $@ -rpc_test.info: test_bitcoin_filtered.info +functional_test.info: test_bitcoin_filtered.info -@TIMEOUT=15 python test/pull-tester/rpc-tests.py $(EXTENDED_RPC_TESTS) - $(LCOV) -c -d $(abs_builddir)/src --t rpc-tests -o $@ + $(LCOV) -c -d $(abs_builddir)/src --t functional-tests -o $@ $(LCOV) -z -d $(abs_builddir)/src $(LCOV) -z -d $(abs_builddir)/src/leveldb -rpc_test_filtered.info: rpc_test.info +functional_test_filtered.info: functional_test.info $(LCOV) -r $< "/usr/include/*" -o $@ test_bitcoin_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -o $@ -total_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info rpc_test_filtered.info - $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -a rpc_test_filtered.info -o $@ | $(GREP) "\%" | $(AWK) '{ print substr($$3,2,50) "/" $$5 }' > coverage_percent.txt +total_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info functional_test_filtered.info + $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -a functional_test_filtered.info -o $@ | $(GREP) "\%" | $(AWK) '{ print substr($$3,2,50) "/" $$5 }' > coverage_percent.txt test_bitcoin.coverage/.dirstamp: test_bitcoin_coverage.info $(GENHTML) -s $< -o $(@D) @@ -223,7 +223,7 @@ endif dist_noinst_SCRIPTS = autogen.sh -EXTRA_DIST = $(top_srcdir)/share/genbuild.sh test/pull-tester/rpc-tests.py test/rpc-tests $(DIST_CONTRIB) $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS) +EXTRA_DIST = $(top_srcdir)/share/genbuild.sh test/pull-tester/rpc-tests.py test/functional $(DIST_CONTRIB) $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS) CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER) diff --git a/README.md b/README.md index 4de30e0df..ccaf8d914 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ submit new unit tests for old code. Unit tests can be compiled and run (assuming they weren't disabled in configure) with: `make check`. Further details on running and extending unit tests can be found in [/src/test/README.md](/src/test/README.md). -There are also [regression and integration tests](/test) of the RPC interface, written +There are also [regression and integration tests](/test), written in Python, that are run automatically on the build server. These tests can be run (if the [test dependencies](/test) are installed) with: `test/pull-tester/rpc-tests.py` diff --git a/configure.ac b/configure.ac index b32daf0a2..3671a406d 100644 --- a/configure.ac +++ b/configure.ac @@ -1147,8 +1147,7 @@ AC_SUBST(EVENT_PTHREADS_LIBS) AC_SUBST(ZMQ_LIBS) AC_SUBST(PROTOBUF_LIBS) AC_SUBST(QR_LIBS) -AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist src/test/buildenv.py]) -AC_CONFIG_FILES([test/pull-tester/tests_config.ini],[chmod +x test/pull-tester/tests_config.ini]) +AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist src/test/buildenv.py test/pull-tester/tests_config.ini]) AC_CONFIG_FILES([contrib/devtools/split-debug.sh],[chmod +x contrib/devtools/split-debug.sh]) AC_CONFIG_LINKS([test/pull-tester/rpc-tests.py:test/pull-tester/rpc-tests.py]) diff --git a/contrib/devtools/copyright_header.py b/contrib/devtools/copyright_header.py index 1b7087934..6d801d3ac 100755 --- a/contrib/devtools/copyright_header.py +++ b/contrib/devtools/copyright_header.py @@ -32,7 +32,7 @@ EXCLUDE = [ 'src/tinyformat.h', 'src/leveldb/util/env_win.cc', 'src/crypto/ctaes/bench.c', - 'test/rpc-tests/test_framework/bignum.py', + 'test/functional/test_framework/bignum.py', # python init: '*__init__.py', ] diff --git a/doc/developer-notes.md b/doc/developer-notes.md index ec608cfbd..797507cd3 100644 --- a/doc/developer-notes.md +++ b/doc/developer-notes.md @@ -132,7 +132,7 @@ Run with the -testnet option to run with "play bitcoins" on the test network, if are testing multi-machine code that needs to operate across the internet. If you are testing something that can run on one machine, run with the -regtest option. -In regression test mode, blocks can be created on-demand; see test/rpc-tests/ for tests +In regression test mode, blocks can be created on-demand; see test/functional/ for tests that run in -regtest mode. **DEBUG_LOCKORDER** @@ -252,7 +252,7 @@ Wallet - *Rationale*: In RPC code that conditionally uses the wallet (such as `validateaddress`) it is easy to forget that global pointer `pwalletMain` - can be NULL. See `test/rpc-tests/disablewallet.py` for functional tests + can be NULL. See `test/functional/disablewallet.py` for functional tests exercising the API with `-disablewallet` - Include `db_cxx.h` (BerkeleyDB header) only when `ENABLE_WALLET` is set diff --git a/test/README.md b/test/README.md index d71030df5..15ebf3204 100644 --- a/test/README.md +++ b/test/README.md @@ -1,5 +1,5 @@ The [pull-tester](/test/pull-tester/) folder contains a script to call -multiple tests from the [rpc-tests](/test/rpc-tests/) folder. +multiple tests from the [functional](/test/functional/) folder. Every pull request to the bitcoin repository is built and run through the regression test suite. You can also run all or only individual @@ -83,5 +83,5 @@ killall bitcoind Writing tests ============= You are encouraged to write tests for new or existing features. -Further information about the test framework and individual RPC -tests is found in [test/rpc-tests](/test/rpc-tests). +Further information about the test framework and individual functional +tests is found in [test/functional](/test/functional). diff --git a/test/rpc-tests/.gitignore b/test/functional/.gitignore similarity index 100% rename from test/rpc-tests/.gitignore rename to test/functional/.gitignore diff --git a/test/rpc-tests/README.md b/test/functional/README.md similarity index 100% rename from test/rpc-tests/README.md rename to test/functional/README.md diff --git a/test/rpc-tests/abandonconflict.py b/test/functional/abandonconflict.py similarity index 100% rename from test/rpc-tests/abandonconflict.py rename to test/functional/abandonconflict.py diff --git a/test/rpc-tests/assumevalid.py b/test/functional/assumevalid.py similarity index 100% rename from test/rpc-tests/assumevalid.py rename to test/functional/assumevalid.py diff --git a/test/rpc-tests/bip65-cltv-p2p.py b/test/functional/bip65-cltv-p2p.py similarity index 100% rename from test/rpc-tests/bip65-cltv-p2p.py rename to test/functional/bip65-cltv-p2p.py diff --git a/test/rpc-tests/bip65-cltv.py b/test/functional/bip65-cltv.py similarity index 100% rename from test/rpc-tests/bip65-cltv.py rename to test/functional/bip65-cltv.py diff --git a/test/rpc-tests/bip68-112-113-p2p.py b/test/functional/bip68-112-113-p2p.py similarity index 100% rename from test/rpc-tests/bip68-112-113-p2p.py rename to test/functional/bip68-112-113-p2p.py diff --git a/test/rpc-tests/bip68-sequence.py b/test/functional/bip68-sequence.py similarity index 100% rename from test/rpc-tests/bip68-sequence.py rename to test/functional/bip68-sequence.py diff --git a/test/rpc-tests/bip9-softforks.py b/test/functional/bip9-softforks.py similarity index 100% rename from test/rpc-tests/bip9-softforks.py rename to test/functional/bip9-softforks.py diff --git a/test/rpc-tests/bipdersig-p2p.py b/test/functional/bipdersig-p2p.py similarity index 100% rename from test/rpc-tests/bipdersig-p2p.py rename to test/functional/bipdersig-p2p.py diff --git a/test/rpc-tests/bipdersig.py b/test/functional/bipdersig.py similarity index 100% rename from test/rpc-tests/bipdersig.py rename to test/functional/bipdersig.py diff --git a/test/rpc-tests/blockchain.py b/test/functional/blockchain.py similarity index 100% rename from test/rpc-tests/blockchain.py rename to test/functional/blockchain.py diff --git a/test/rpc-tests/bumpfee.py b/test/functional/bumpfee.py similarity index 100% rename from test/rpc-tests/bumpfee.py rename to test/functional/bumpfee.py diff --git a/test/rpc-tests/create_cache.py b/test/functional/create_cache.py similarity index 89% rename from test/rpc-tests/create_cache.py rename to test/functional/create_cache.py index 13eac92bb..e4b6dbc2d 100755 --- a/test/rpc-tests/create_cache.py +++ b/test/functional/create_cache.py @@ -5,7 +5,7 @@ """Create a blockchain cache. Creating a cache of the blockchain speeds up test execution when running -multiple qa tests. This helper script is executed by rpc-tests when multiple +multiple functional tests. This helper script is executed by rpc-tests when multiple tests are being run in parallel. """ diff --git a/test/rpc-tests/decodescript.py b/test/functional/decodescript.py similarity index 100% rename from test/rpc-tests/decodescript.py rename to test/functional/decodescript.py diff --git a/test/rpc-tests/disablewallet.py b/test/functional/disablewallet.py similarity index 100% rename from test/rpc-tests/disablewallet.py rename to test/functional/disablewallet.py diff --git a/test/rpc-tests/forknotify.py b/test/functional/forknotify.py similarity index 100% rename from test/rpc-tests/forknotify.py rename to test/functional/forknotify.py diff --git a/test/rpc-tests/fundrawtransaction.py b/test/functional/fundrawtransaction.py similarity index 100% rename from test/rpc-tests/fundrawtransaction.py rename to test/functional/fundrawtransaction.py diff --git a/test/rpc-tests/getblocktemplate_longpoll.py b/test/functional/getblocktemplate_longpoll.py similarity index 100% rename from test/rpc-tests/getblocktemplate_longpoll.py rename to test/functional/getblocktemplate_longpoll.py diff --git a/test/rpc-tests/getblocktemplate_proposals.py b/test/functional/getblocktemplate_proposals.py similarity index 100% rename from test/rpc-tests/getblocktemplate_proposals.py rename to test/functional/getblocktemplate_proposals.py diff --git a/test/rpc-tests/getchaintips.py b/test/functional/getchaintips.py similarity index 100% rename from test/rpc-tests/getchaintips.py rename to test/functional/getchaintips.py diff --git a/test/rpc-tests/httpbasics.py b/test/functional/httpbasics.py similarity index 100% rename from test/rpc-tests/httpbasics.py rename to test/functional/httpbasics.py diff --git a/test/rpc-tests/import-rescan.py b/test/functional/import-rescan.py similarity index 100% rename from test/rpc-tests/import-rescan.py rename to test/functional/import-rescan.py diff --git a/test/rpc-tests/importmulti.py b/test/functional/importmulti.py similarity index 100% rename from test/rpc-tests/importmulti.py rename to test/functional/importmulti.py diff --git a/test/rpc-tests/importprunedfunds.py b/test/functional/importprunedfunds.py similarity index 100% rename from test/rpc-tests/importprunedfunds.py rename to test/functional/importprunedfunds.py diff --git a/test/rpc-tests/invalidateblock.py b/test/functional/invalidateblock.py similarity index 100% rename from test/rpc-tests/invalidateblock.py rename to test/functional/invalidateblock.py diff --git a/test/rpc-tests/invalidblockrequest.py b/test/functional/invalidblockrequest.py similarity index 100% rename from test/rpc-tests/invalidblockrequest.py rename to test/functional/invalidblockrequest.py diff --git a/test/rpc-tests/invalidtxrequest.py b/test/functional/invalidtxrequest.py similarity index 100% rename from test/rpc-tests/invalidtxrequest.py rename to test/functional/invalidtxrequest.py diff --git a/test/rpc-tests/keypool.py b/test/functional/keypool.py similarity index 100% rename from test/rpc-tests/keypool.py rename to test/functional/keypool.py diff --git a/test/rpc-tests/listsinceblock.py b/test/functional/listsinceblock.py similarity index 100% rename from test/rpc-tests/listsinceblock.py rename to test/functional/listsinceblock.py diff --git a/test/rpc-tests/listtransactions.py b/test/functional/listtransactions.py similarity index 100% rename from test/rpc-tests/listtransactions.py rename to test/functional/listtransactions.py diff --git a/test/rpc-tests/maxblocksinflight.py b/test/functional/maxblocksinflight.py similarity index 100% rename from test/rpc-tests/maxblocksinflight.py rename to test/functional/maxblocksinflight.py diff --git a/test/rpc-tests/maxuploadtarget.py b/test/functional/maxuploadtarget.py similarity index 100% rename from test/rpc-tests/maxuploadtarget.py rename to test/functional/maxuploadtarget.py diff --git a/test/rpc-tests/mempool_limit.py b/test/functional/mempool_limit.py similarity index 100% rename from test/rpc-tests/mempool_limit.py rename to test/functional/mempool_limit.py diff --git a/test/rpc-tests/mempool_packages.py b/test/functional/mempool_packages.py similarity index 100% rename from test/rpc-tests/mempool_packages.py rename to test/functional/mempool_packages.py diff --git a/test/rpc-tests/mempool_reorg.py b/test/functional/mempool_reorg.py similarity index 100% rename from test/rpc-tests/mempool_reorg.py rename to test/functional/mempool_reorg.py diff --git a/test/rpc-tests/mempool_resurrect_test.py b/test/functional/mempool_resurrect_test.py similarity index 100% rename from test/rpc-tests/mempool_resurrect_test.py rename to test/functional/mempool_resurrect_test.py diff --git a/test/rpc-tests/mempool_spendcoinbase.py b/test/functional/mempool_spendcoinbase.py similarity index 100% rename from test/rpc-tests/mempool_spendcoinbase.py rename to test/functional/mempool_spendcoinbase.py diff --git a/test/rpc-tests/merkle_blocks.py b/test/functional/merkle_blocks.py similarity index 100% rename from test/rpc-tests/merkle_blocks.py rename to test/functional/merkle_blocks.py diff --git a/test/rpc-tests/multi_rpc.py b/test/functional/multi_rpc.py similarity index 100% rename from test/rpc-tests/multi_rpc.py rename to test/functional/multi_rpc.py diff --git a/test/rpc-tests/nodehandling.py b/test/functional/nodehandling.py similarity index 100% rename from test/rpc-tests/nodehandling.py rename to test/functional/nodehandling.py diff --git a/test/rpc-tests/nulldummy.py b/test/functional/nulldummy.py similarity index 100% rename from test/rpc-tests/nulldummy.py rename to test/functional/nulldummy.py diff --git a/test/rpc-tests/p2p-acceptblock.py b/test/functional/p2p-acceptblock.py similarity index 100% rename from test/rpc-tests/p2p-acceptblock.py rename to test/functional/p2p-acceptblock.py diff --git a/test/rpc-tests/p2p-compactblocks.py b/test/functional/p2p-compactblocks.py similarity index 100% rename from test/rpc-tests/p2p-compactblocks.py rename to test/functional/p2p-compactblocks.py diff --git a/test/rpc-tests/p2p-feefilter.py b/test/functional/p2p-feefilter.py similarity index 100% rename from test/rpc-tests/p2p-feefilter.py rename to test/functional/p2p-feefilter.py diff --git a/test/rpc-tests/p2p-fullblocktest.py b/test/functional/p2p-fullblocktest.py similarity index 100% rename from test/rpc-tests/p2p-fullblocktest.py rename to test/functional/p2p-fullblocktest.py diff --git a/test/rpc-tests/p2p-leaktests.py b/test/functional/p2p-leaktests.py similarity index 100% rename from test/rpc-tests/p2p-leaktests.py rename to test/functional/p2p-leaktests.py diff --git a/test/rpc-tests/p2p-mempool.py b/test/functional/p2p-mempool.py similarity index 100% rename from test/rpc-tests/p2p-mempool.py rename to test/functional/p2p-mempool.py diff --git a/test/rpc-tests/p2p-segwit.py b/test/functional/p2p-segwit.py similarity index 100% rename from test/rpc-tests/p2p-segwit.py rename to test/functional/p2p-segwit.py diff --git a/test/rpc-tests/p2p-timeouts.py b/test/functional/p2p-timeouts.py similarity index 100% rename from test/rpc-tests/p2p-timeouts.py rename to test/functional/p2p-timeouts.py diff --git a/test/rpc-tests/p2p-versionbits-warning.py b/test/functional/p2p-versionbits-warning.py similarity index 100% rename from test/rpc-tests/p2p-versionbits-warning.py rename to test/functional/p2p-versionbits-warning.py diff --git a/test/rpc-tests/preciousblock.py b/test/functional/preciousblock.py similarity index 100% rename from test/rpc-tests/preciousblock.py rename to test/functional/preciousblock.py diff --git a/test/rpc-tests/prioritise_transaction.py b/test/functional/prioritise_transaction.py similarity index 100% rename from test/rpc-tests/prioritise_transaction.py rename to test/functional/prioritise_transaction.py diff --git a/test/rpc-tests/proxy_test.py b/test/functional/proxy_test.py similarity index 100% rename from test/rpc-tests/proxy_test.py rename to test/functional/proxy_test.py diff --git a/test/rpc-tests/pruning.py b/test/functional/pruning.py similarity index 100% rename from test/rpc-tests/pruning.py rename to test/functional/pruning.py diff --git a/test/rpc-tests/rawtransactions.py b/test/functional/rawtransactions.py similarity index 100% rename from test/rpc-tests/rawtransactions.py rename to test/functional/rawtransactions.py diff --git a/test/rpc-tests/receivedby.py b/test/functional/receivedby.py similarity index 100% rename from test/rpc-tests/receivedby.py rename to test/functional/receivedby.py diff --git a/test/rpc-tests/reindex.py b/test/functional/reindex.py similarity index 100% rename from test/rpc-tests/reindex.py rename to test/functional/reindex.py diff --git a/test/rpc-tests/replace-by-fee.py b/test/functional/replace-by-fee.py similarity index 100% rename from test/rpc-tests/replace-by-fee.py rename to test/functional/replace-by-fee.py diff --git a/test/rpc-tests/rest.py b/test/functional/rest.py similarity index 100% rename from test/rpc-tests/rest.py rename to test/functional/rest.py diff --git a/test/rpc-tests/rpcbind_test.py b/test/functional/rpcbind_test.py similarity index 100% rename from test/rpc-tests/rpcbind_test.py rename to test/functional/rpcbind_test.py diff --git a/test/rpc-tests/rpcnamedargs.py b/test/functional/rpcnamedargs.py similarity index 100% rename from test/rpc-tests/rpcnamedargs.py rename to test/functional/rpcnamedargs.py diff --git a/test/rpc-tests/segwit.py b/test/functional/segwit.py similarity index 100% rename from test/rpc-tests/segwit.py rename to test/functional/segwit.py diff --git a/test/rpc-tests/sendheaders.py b/test/functional/sendheaders.py similarity index 100% rename from test/rpc-tests/sendheaders.py rename to test/functional/sendheaders.py diff --git a/test/rpc-tests/signmessages.py b/test/functional/signmessages.py similarity index 100% rename from test/rpc-tests/signmessages.py rename to test/functional/signmessages.py diff --git a/test/rpc-tests/signrawtransactions.py b/test/functional/signrawtransactions.py similarity index 100% rename from test/rpc-tests/signrawtransactions.py rename to test/functional/signrawtransactions.py diff --git a/test/rpc-tests/smartfees.py b/test/functional/smartfees.py similarity index 100% rename from test/rpc-tests/smartfees.py rename to test/functional/smartfees.py diff --git a/test/rpc-tests/test_framework/__init__.py b/test/functional/test_framework/__init__.py similarity index 100% rename from test/rpc-tests/test_framework/__init__.py rename to test/functional/test_framework/__init__.py diff --git a/test/rpc-tests/test_framework/address.py b/test/functional/test_framework/address.py similarity index 100% rename from test/rpc-tests/test_framework/address.py rename to test/functional/test_framework/address.py diff --git a/test/rpc-tests/test_framework/authproxy.py b/test/functional/test_framework/authproxy.py similarity index 100% rename from test/rpc-tests/test_framework/authproxy.py rename to test/functional/test_framework/authproxy.py diff --git a/test/rpc-tests/test_framework/bignum.py b/test/functional/test_framework/bignum.py similarity index 100% rename from test/rpc-tests/test_framework/bignum.py rename to test/functional/test_framework/bignum.py diff --git a/test/rpc-tests/test_framework/blockstore.py b/test/functional/test_framework/blockstore.py similarity index 100% rename from test/rpc-tests/test_framework/blockstore.py rename to test/functional/test_framework/blockstore.py diff --git a/test/rpc-tests/test_framework/blocktools.py b/test/functional/test_framework/blocktools.py similarity index 100% rename from test/rpc-tests/test_framework/blocktools.py rename to test/functional/test_framework/blocktools.py diff --git a/test/rpc-tests/test_framework/comptool.py b/test/functional/test_framework/comptool.py similarity index 100% rename from test/rpc-tests/test_framework/comptool.py rename to test/functional/test_framework/comptool.py diff --git a/test/rpc-tests/test_framework/coverage.py b/test/functional/test_framework/coverage.py similarity index 100% rename from test/rpc-tests/test_framework/coverage.py rename to test/functional/test_framework/coverage.py diff --git a/test/rpc-tests/test_framework/key.py b/test/functional/test_framework/key.py similarity index 100% rename from test/rpc-tests/test_framework/key.py rename to test/functional/test_framework/key.py diff --git a/test/rpc-tests/test_framework/mininode.py b/test/functional/test_framework/mininode.py similarity index 100% rename from test/rpc-tests/test_framework/mininode.py rename to test/functional/test_framework/mininode.py diff --git a/test/rpc-tests/test_framework/netutil.py b/test/functional/test_framework/netutil.py similarity index 100% rename from test/rpc-tests/test_framework/netutil.py rename to test/functional/test_framework/netutil.py diff --git a/test/rpc-tests/test_framework/script.py b/test/functional/test_framework/script.py similarity index 100% rename from test/rpc-tests/test_framework/script.py rename to test/functional/test_framework/script.py diff --git a/test/rpc-tests/test_framework/siphash.py b/test/functional/test_framework/siphash.py similarity index 100% rename from test/rpc-tests/test_framework/siphash.py rename to test/functional/test_framework/siphash.py diff --git a/test/rpc-tests/test_framework/socks5.py b/test/functional/test_framework/socks5.py similarity index 100% rename from test/rpc-tests/test_framework/socks5.py rename to test/functional/test_framework/socks5.py diff --git a/test/rpc-tests/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py similarity index 100% rename from test/rpc-tests/test_framework/test_framework.py rename to test/functional/test_framework/test_framework.py diff --git a/test/rpc-tests/test_framework/util.py b/test/functional/test_framework/util.py similarity index 100% rename from test/rpc-tests/test_framework/util.py rename to test/functional/test_framework/util.py diff --git a/test/rpc-tests/txn_clone.py b/test/functional/txn_clone.py similarity index 100% rename from test/rpc-tests/txn_clone.py rename to test/functional/txn_clone.py diff --git a/test/rpc-tests/txn_doublespend.py b/test/functional/txn_doublespend.py similarity index 100% rename from test/rpc-tests/txn_doublespend.py rename to test/functional/txn_doublespend.py diff --git a/test/rpc-tests/wallet-accounts.py b/test/functional/wallet-accounts.py similarity index 100% rename from test/rpc-tests/wallet-accounts.py rename to test/functional/wallet-accounts.py diff --git a/test/rpc-tests/wallet-dump.py b/test/functional/wallet-dump.py similarity index 100% rename from test/rpc-tests/wallet-dump.py rename to test/functional/wallet-dump.py diff --git a/test/rpc-tests/wallet-hd.py b/test/functional/wallet-hd.py similarity index 100% rename from test/rpc-tests/wallet-hd.py rename to test/functional/wallet-hd.py diff --git a/test/rpc-tests/wallet.py b/test/functional/wallet.py similarity index 100% rename from test/rpc-tests/wallet.py rename to test/functional/wallet.py diff --git a/test/rpc-tests/walletbackup.py b/test/functional/walletbackup.py similarity index 100% rename from test/rpc-tests/walletbackup.py rename to test/functional/walletbackup.py diff --git a/test/rpc-tests/zapwallettxes.py b/test/functional/zapwallettxes.py similarity index 100% rename from test/rpc-tests/zapwallettxes.py rename to test/functional/zapwallettxes.py diff --git a/test/rpc-tests/zmq_test.py b/test/functional/zmq_test.py similarity index 100% rename from test/rpc-tests/zmq_test.py rename to test/functional/zmq_test.py diff --git a/test/pull-tester/rpc-tests.py b/test/pull-tester/rpc-tests.py index 925e19f09..78a754a28 100755 --- a/test/pull-tester/rpc-tests.py +++ b/test/pull-tester/rpc-tests.py @@ -8,7 +8,7 @@ rpc-tests.py - run regression test suite This module calls down into individual test cases via subprocess. It will forward all unrecognized arguments onto the individual test scripts. -RPC tests are disabled on Windows by default. Use --force to run them anyway. +Functional tests are disabled on Windows by default. Use --force to run them anyway. For a description of arguments recognized by test scripts, see `test/pull-tester/test_framework/test_framework.py:BitcoinTestFramework.main`. @@ -161,7 +161,7 @@ def main(): sys.exit(0) if not (enable_wallet and enable_utils and enable_bitcoind): - print("No rpc tests to run. Wallet, utils, and bitcoind must all be enabled") + print("No functional tests to run. Wallet, utils, and bitcoind must all be enabled") print("Rerun `configure` with -enable-wallet, -with-utils and -with-daemon and rerun make") sys.exit(0) @@ -206,7 +206,7 @@ def main(): if args.help: # Print help for rpc-tests.py, then print help of the first script and exit. parser.print_help() - subprocess.check_call((config["environment"]["SRCDIR"] + '/test/rpc-tests/' + test_list[0]).split() + ['-h']) + subprocess.check_call((config["environment"]["SRCDIR"] + '/test/functional/' + test_list[0]).split() + ['-h']) sys.exit(0) run_tests(test_list, config["environment"]["SRCDIR"], config["environment"]["BUILDDIR"], config["environment"]["EXEEXT"], args.jobs, args.coverage, passon_args) @@ -222,7 +222,7 @@ def run_tests(test_list, src_dir, build_dir, exeext, jobs=1, enable_coverage=Fal if "BITCOIND" not in os.environ: os.environ["BITCOIND"] = build_dir + '/src/bitcoind' + exeext - tests_dir = src_dir + '/test/rpc-tests/' + tests_dir = src_dir + '/test/functional/' flags = ["--srcdir={}/src".format(build_dir)] + args flags.append("--cachedir=%s/test/cache" % build_dir) @@ -243,7 +243,7 @@ def run_tests(test_list, src_dir, build_dir, exeext, jobs=1, enable_coverage=Fal time_sum = 0 time0 = time.time() - job_queue = RPCTestHandler(jobs, tests_dir, test_list, flags) + job_queue = TestHandler(jobs, tests_dir, test_list, flags) max_len_name = len(max(test_list, key=len)) results = BOLD[1] + "%s | %s | %s\n\n" % ("TEST".ljust(max_len_name), "PASSED", "DURATION") + BOLD[0] @@ -271,7 +271,7 @@ def run_tests(test_list, src_dir, build_dir, exeext, jobs=1, enable_coverage=Fal sys.exit(not all_passed) -class RPCTestHandler: +class TestHandler: """ Trigger the testscrips passed in via the list. """ @@ -335,7 +335,7 @@ class RPCCoverage(object): After all tests complete, the commands run are combined and diff'd against the complete list to calculate uncovered RPC commands. - See also: test/rpc-tests/test_framework/coverage.py + See also: test/functional/test_framework/coverage.py """ def __init__(self): @@ -363,7 +363,7 @@ class RPCCoverage(object): Return a set of currently untested RPC commands. """ - # This is shared from `test/rpc-tests/test-framework/coverage.py` + # This is shared from `test/functional/test-framework/coverage.py` reference_filename = 'rpc_interface.txt' coverage_file_prefix = 'coverage.' From a9bd622a658b41b219912288e643f5e2c1b145b4 Mon Sep 17 00:00:00 2001 From: John Newbery Date: Thu, 9 Mar 2017 09:53:26 -0500 Subject: [PATCH 3/5] Rename test/pull-tester/rpc-tests.py to test/functional/test_runner.py --- .travis.yml | 2 +- Makefile.am | 6 +++--- README.md | 2 +- configure.ac | 4 ++-- contrib/rpm/bitcoin.spec | 2 +- test/README.md | 14 +++++++------- .../config.ini.in} | 2 +- test/functional/create_cache.py | 2 +- .../rpc-tests.py => functional/test_runner.py} | 17 ++++++++--------- 9 files changed, 25 insertions(+), 26 deletions(-) rename test/{pull-tester/tests_config.ini.in => functional/config.ini.in} (95%) rename test/{pull-tester/rpc-tests.py => functional/test_runner.py} (95%) diff --git a/.travis.yml b/.travis.yml index b6739e1dd..f57a19c4c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -70,7 +70,7 @@ script: - make $MAKEJOBS $GOAL || ( echo "Build failure. Verbose build follows." && make $GOAL V=1 ; false ) - export LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/depends/$HOST/lib - if [ "$RUN_TESTS" = "true" ]; then make $MAKEJOBS check VERBOSE=1; fi - - if [ "$RUN_TESTS" = "true" ]; then functional/pull-tester/rpc-tests.py --coverage; fi + - if [ "$RUN_TESTS" = "true" ]; then test/functional/test_runner.py --coverage; fi after_script: - echo $TRAVIS_COMMIT_RANGE - echo $TRAVIS_COMMIT_LOG diff --git a/Makefile.am b/Makefile.am index 0316d9254..236d413b3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -195,7 +195,7 @@ test_bitcoin_filtered.info: test_bitcoin.info $(LCOV) -r $< "/usr/include/*" -o $@ functional_test.info: test_bitcoin_filtered.info - -@TIMEOUT=15 python test/pull-tester/rpc-tests.py $(EXTENDED_RPC_TESTS) + -@TIMEOUT=15 python test/functional/test_runner.py $(EXTENDED_RPC_TESTS) $(LCOV) -c -d $(abs_builddir)/src --t functional-tests -o $@ $(LCOV) -z -d $(abs_builddir)/src $(LCOV) -z -d $(abs_builddir)/src/leveldb @@ -223,7 +223,7 @@ endif dist_noinst_SCRIPTS = autogen.sh -EXTRA_DIST = $(top_srcdir)/share/genbuild.sh test/pull-tester/rpc-tests.py test/functional $(DIST_CONTRIB) $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS) +EXTRA_DIST = $(top_srcdir)/share/genbuild.sh test/functional/test_runner.py test/functional $(DIST_CONTRIB) $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS) CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER) @@ -233,4 +233,4 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-man clean-local: rm -rf coverage_percent.txt test_bitcoin.coverage/ total.coverage/ test/tmp/ cache/ $(OSX_APP) - rm -rf test/pull-tester/__pycache__ + rm -rf test/functional/__pycache__ diff --git a/README.md b/README.md index ccaf8d914..5db9fc992 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ and extending unit tests can be found in [/src/test/README.md](/src/test/README. There are also [regression and integration tests](/test), written in Python, that are run automatically on the build server. -These tests can be run (if the [test dependencies](/test) are installed) with: `test/pull-tester/rpc-tests.py` +These tests can be run (if the [test dependencies](/test) are installed) with: `test/functional/test_runner.py` The Travis CI system makes sure that every pull request is built for Windows, Linux, and OS X, and that unit/sanity tests are run automatically. diff --git a/configure.ac b/configure.ac index 3671a406d..b5120257d 100644 --- a/configure.ac +++ b/configure.ac @@ -1147,9 +1147,9 @@ AC_SUBST(EVENT_PTHREADS_LIBS) AC_SUBST(ZMQ_LIBS) AC_SUBST(PROTOBUF_LIBS) AC_SUBST(QR_LIBS) -AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist src/test/buildenv.py test/pull-tester/tests_config.ini]) +AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist src/test/buildenv.py test/functional/config.ini]) AC_CONFIG_FILES([contrib/devtools/split-debug.sh],[chmod +x contrib/devtools/split-debug.sh]) -AC_CONFIG_LINKS([test/pull-tester/rpc-tests.py:test/pull-tester/rpc-tests.py]) +AC_CONFIG_LINKS([test/functional/test_runner.py:test/functional/test_runner.py]) dnl boost's m4 checks do something really nasty: they export these vars. As a dnl result, they leak into secp256k1's configure and crazy things happen. diff --git a/contrib/rpm/bitcoin.spec b/contrib/rpm/bitcoin.spec index f7796efc0..54d661839 100644 --- a/contrib/rpm/bitcoin.spec +++ b/contrib/rpm/bitcoin.spec @@ -314,7 +314,7 @@ make check pushd src srcdir=. test/bitcoin-util-test.py popd -test/pull-tester/rpc-tests.py -extended +test/functional/test_runner.py --extended %post libs -p /sbin/ldconfig diff --git a/test/README.md b/test/README.md index 15ebf3204..3bf43717f 100644 --- a/test/README.md +++ b/test/README.md @@ -1,5 +1,5 @@ -The [pull-tester](/test/pull-tester/) folder contains a script to call -multiple tests from the [functional](/test/functional/) folder. +The [functional](/test/functional/) folder contains a script test_runner + to call multiple functional tests from its folder. Every pull request to the bitcoin repository is built and run through the regression test suite. You can also run all or only individual @@ -27,19 +27,19 @@ Running tests You can run any single test by calling - test/pull-tester/rpc-tests.py + test/functional/test_runner.py Or you can run any combination of tests by calling - test/pull-tester/rpc-tests.py ... + test/functional/test_runner.py ... Run the regression test suite with - test/pull-tester/rpc-tests.py + test/functional/test_runner.py Run all possible tests with - test/pull-tester/rpc-tests.py --extended + test/functional/test_runner.py --extended By default, tests will be run in parallel. To specify how many jobs to run, append `--jobs=n` (default n=4). @@ -61,7 +61,7 @@ Possible options, which apply to each individual test run: ``` If you set the environment variable `PYTHON_DEBUG=1` you will get some debug -output (example: `PYTHON_DEBUG=1 test/pull-tester/rpc-tests.py wallet`). +output (example: `PYTHON_DEBUG=1 test/functional/test_runner.py wallet`). A 200-block -regtest blockchain and wallets for four nodes is created the first time a regression test is run and diff --git a/test/pull-tester/tests_config.ini.in b/test/functional/config.ini.in similarity index 95% rename from test/pull-tester/tests_config.ini.in rename to test/functional/config.ini.in index e3e457d0b..29586c555 100644 --- a/test/pull-tester/tests_config.ini.in +++ b/test/functional/config.ini.in @@ -3,7 +3,7 @@ # file COPYING or http://www.opensource.org/licenses/mit-license.php. # These environment variables are set by the build process and read by -# rpc-tests.py +# test/functional/test_runner.py [environment] SRCDIR=@abs_top_srcdir@ diff --git a/test/functional/create_cache.py b/test/functional/create_cache.py index e4b6dbc2d..39c4c0f47 100755 --- a/test/functional/create_cache.py +++ b/test/functional/create_cache.py @@ -5,7 +5,7 @@ """Create a blockchain cache. Creating a cache of the blockchain speeds up test execution when running -multiple functional tests. This helper script is executed by rpc-tests when multiple +multiple functional tests. This helper script is executed by test_runner when multiple tests are being run in parallel. """ diff --git a/test/pull-tester/rpc-tests.py b/test/functional/test_runner.py similarity index 95% rename from test/pull-tester/rpc-tests.py rename to test/functional/test_runner.py index 78a754a28..12eb92028 100755 --- a/test/pull-tester/rpc-tests.py +++ b/test/functional/test_runner.py @@ -2,8 +2,7 @@ # Copyright (c) 2014-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. -""" -rpc-tests.py - run regression test suite +"""Run regression test suite. This module calls down into individual test cases via subprocess. It will forward all unrecognized arguments onto the individual test scripts. @@ -11,7 +10,7 @@ forward all unrecognized arguments onto the individual test scripts. Functional tests are disabled on Windows by default. Use --force to run them anyway. For a description of arguments recognized by test scripts, see -`test/pull-tester/test_framework/test_framework.py:BitcoinTestFramework.main`. +`test/functional/test_framework/test_framework.py:BitcoinTestFramework.main`. """ @@ -87,7 +86,7 @@ BASE_SCRIPTS= [ ZMQ_SCRIPTS = [ # ZMQ test can only be run if bitcoin was built with zmq-enabled. - # call rpc_tests.py with -nozmq to explicitly exclude these tests. + # call test_runner.py with -nozmq to explicitly exclude these tests. "zmq_test.py"] EXTENDED_SCRIPTS = [ @@ -127,7 +126,7 @@ ALL_SCRIPTS = BASE_SCRIPTS + ZMQ_SCRIPTS + EXTENDED_SCRIPTS def main(): # Parse arguments and pass through unrecognised args parser = argparse.ArgumentParser(add_help=False, - usage='%(prog)s [rpc-test.py options] [script options] [scripts]', + usage='%(prog)s [test_runner.py options] [script options] [scripts]', description=__doc__, epilog=''' Help text and arguments for individual test script:''', @@ -147,7 +146,7 @@ def main(): # Read config generated by configure. config = configparser.ConfigParser() - config.read_file(open(os.path.dirname(__file__) + "/tests_config.ini")) + config.read_file(open(os.path.dirname(__file__) + "/config.ini")) enable_wallet = config["components"].getboolean("ENABLE_WALLET") enable_utils = config["components"].getboolean("ENABLE_UTILS") @@ -200,11 +199,11 @@ def main(): if not test_list: print("No valid test scripts specified. Check that your test is in one " - "of the test lists in rpc-tests.py, or run rpc-tests.py with no arguments to run all tests") + "of the test lists in test_runner.py, or run test_runner.py with no arguments to run all tests") sys.exit(0) if args.help: - # Print help for rpc-tests.py, then print help of the first script and exit. + # Print help for test_runner.py, then print help of the first script and exit. parser.print_help() subprocess.check_call((config["environment"]["SRCDIR"] + '/test/functional/' + test_list[0]).split() + ['-h']) sys.exit(0) @@ -325,7 +324,7 @@ class TestHandler: class RPCCoverage(object): """ - Coverage reporting utilities for pull-tester. + Coverage reporting utilities for test_runner. Coverage calculation works by having each test script subprocess write coverage files into a particular directory. These files contain the RPC From 5b0bff4581cf5cbecce35df46075ba256b4974f5 Mon Sep 17 00:00:00 2001 From: John Newbery Date: Thu, 9 Mar 2017 09:55:12 -0500 Subject: [PATCH 4/5] Rename --enable-extended-rpc-tests to --enable-extended-functional-tests --- Makefile.am | 2 +- configure.ac | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile.am b/Makefile.am index 236d413b3..12ddfcd99 100644 --- a/Makefile.am +++ b/Makefile.am @@ -195,7 +195,7 @@ test_bitcoin_filtered.info: test_bitcoin.info $(LCOV) -r $< "/usr/include/*" -o $@ functional_test.info: test_bitcoin_filtered.info - -@TIMEOUT=15 python test/functional/test_runner.py $(EXTENDED_RPC_TESTS) + -@TIMEOUT=15 python test/functional/test_runner.py $(EXTENDED_FUNCTIONAL_TESTS) $(LCOV) -c -d $(abs_builddir)/src --t functional-tests -o $@ $(LCOV) -z -d $(abs_builddir)/src $(LCOV) -z -d $(abs_builddir)/src/leveldb diff --git a/configure.ac b/configure.ac index b5120257d..cd1d4204c 100644 --- a/configure.ac +++ b/configure.ac @@ -124,10 +124,10 @@ AC_ARG_ENABLE(bench, [use_bench=$enableval], [use_bench=yes]) -AC_ARG_ENABLE([extended-rpc-tests], - AS_HELP_STRING([--enable-extended-rpc-tests],[enable expensive RPC tests when using lcov (default no)]), - [use_extended_rpc_tests=$enableval], - [use_extended_rpc_tests=no]) +AC_ARG_ENABLE([extended-functional-tests], + AS_HELP_STRING([--enable-extended-functional-tests],[enable expensive functional tests when using lcov (default no)]), + [use_extended_functional_tests=$enableval], + [use_extended_functional_tests=no]) AC_ARG_WITH([qrencode], [AS_HELP_STRING([--with-qrencode], @@ -414,8 +414,8 @@ if test x$use_pkgconfig = xyes; then ]) fi -if test x$use_extended_rpc_tests != xno; then - AC_SUBST(EXTENDED_RPC_TESTS, -extended) +if test x$use_extended_functional_tests != xno; then + AC_SUBST(EXTENDED_FUNCTIONAL_TESTS, --extended) fi if test x$use_lcov = xyes; then From 63d66ba20a634b54f6d5e8b051fb4a106f2cef6c Mon Sep 17 00:00:00 2001 From: John Newbery Date: Wed, 8 Mar 2017 17:46:18 -0500 Subject: [PATCH 5/5] Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.py --- .gitignore | 6 +- Makefile.am | 56 +++++++++++++++++ configure.ac | 9 ++- contrib/rpm/bitcoin.spec | 4 +- src/Makefile.test.include | 61 +------------------ src/test/README.md | 9 --- src/test/bitcoin-util-test.py | 45 -------------- src/test/buildenv.py.in | 2 - test/README.md | 60 ++++++++++-------- {src/test => test/util}/bctest.py | 6 +- test/util/bitcoin-util-test.py | 36 +++++++++++ test/util/buildenv.py.in | 4 ++ .../util}/data/bitcoin-util-test.json | 0 {src/test => test/util}/data/blanktxv1.hex | 0 {src/test => test/util}/data/blanktxv1.json | 0 {src/test => test/util}/data/blanktxv2.hex | 0 {src/test => test/util}/data/blanktxv2.json | 0 .../test => test/util}/data/tt-delin1-out.hex | 0 .../util}/data/tt-delin1-out.json | 0 .../util}/data/tt-delout1-out.hex | 0 .../util}/data/tt-delout1-out.json | 0 .../util}/data/tt-locktime317000-out.hex | 0 .../util}/data/tt-locktime317000-out.json | 0 {src/test => test/util}/data/tx394b54bb.hex | 0 {src/test => test/util}/data/txcreate1.hex | 0 {src/test => test/util}/data/txcreate1.json | 0 {src/test => test/util}/data/txcreate2.hex | 0 {src/test => test/util}/data/txcreate2.json | 0 .../test => test/util}/data/txcreatedata1.hex | 0 .../util}/data/txcreatedata1.json | 0 .../test => test/util}/data/txcreatedata2.hex | 0 .../util}/data/txcreatedata2.json | 0 .../util}/data/txcreatedata_seq0.hex | 0 .../util}/data/txcreatedata_seq0.json | 0 .../util}/data/txcreatedata_seq1.hex | 0 .../util}/data/txcreatedata_seq1.json | 0 .../util}/data/txcreatemultisig1.hex | 0 .../util}/data/txcreatemultisig1.json | 0 .../util}/data/txcreatemultisig2.hex | 0 .../util}/data/txcreatemultisig2.json | 0 .../util}/data/txcreatemultisig3.hex | 0 .../util}/data/txcreatemultisig3.json | 0 .../util}/data/txcreatemultisig4.hex | 0 .../util}/data/txcreatemultisig4.json | 0 .../util}/data/txcreateoutpubkey1.hex | 0 .../util}/data/txcreateoutpubkey1.json | 0 .../util}/data/txcreateoutpubkey2.hex | 0 .../util}/data/txcreateoutpubkey2.json | 0 .../util}/data/txcreateoutpubkey3.hex | 0 .../util}/data/txcreateoutpubkey3.json | 0 .../util}/data/txcreatescript1.hex | 0 .../util}/data/txcreatescript1.json | 0 .../util}/data/txcreatescript2.hex | 0 .../util}/data/txcreatescript2.json | 0 .../util}/data/txcreatescript3.hex | 0 .../util}/data/txcreatescript3.json | 0 .../util}/data/txcreatescript4.hex | 0 .../util}/data/txcreatescript4.json | 0 .../util}/data/txcreatesignv1.hex | 0 .../util}/data/txcreatesignv1.json | 0 .../util}/data/txcreatesignv2.hex | 0 61 files changed, 146 insertions(+), 152 deletions(-) delete mode 100755 src/test/bitcoin-util-test.py delete mode 100644 src/test/buildenv.py.in rename {src/test => test/util}/bctest.py (96%) create mode 100755 test/util/bitcoin-util-test.py create mode 100644 test/util/buildenv.py.in rename {src/test => test/util}/data/bitcoin-util-test.json (100%) rename {src/test => test/util}/data/blanktxv1.hex (100%) rename {src/test => test/util}/data/blanktxv1.json (100%) rename {src/test => test/util}/data/blanktxv2.hex (100%) rename {src/test => test/util}/data/blanktxv2.json (100%) rename {src/test => test/util}/data/tt-delin1-out.hex (100%) rename {src/test => test/util}/data/tt-delin1-out.json (100%) rename {src/test => test/util}/data/tt-delout1-out.hex (100%) rename {src/test => test/util}/data/tt-delout1-out.json (100%) rename {src/test => test/util}/data/tt-locktime317000-out.hex (100%) rename {src/test => test/util}/data/tt-locktime317000-out.json (100%) rename {src/test => test/util}/data/tx394b54bb.hex (100%) rename {src/test => test/util}/data/txcreate1.hex (100%) rename {src/test => test/util}/data/txcreate1.json (100%) rename {src/test => test/util}/data/txcreate2.hex (100%) rename {src/test => test/util}/data/txcreate2.json (100%) rename {src/test => test/util}/data/txcreatedata1.hex (100%) rename {src/test => test/util}/data/txcreatedata1.json (100%) rename {src/test => test/util}/data/txcreatedata2.hex (100%) rename {src/test => test/util}/data/txcreatedata2.json (100%) rename {src/test => test/util}/data/txcreatedata_seq0.hex (100%) rename {src/test => test/util}/data/txcreatedata_seq0.json (100%) rename {src/test => test/util}/data/txcreatedata_seq1.hex (100%) rename {src/test => test/util}/data/txcreatedata_seq1.json (100%) rename {src/test => test/util}/data/txcreatemultisig1.hex (100%) rename {src/test => test/util}/data/txcreatemultisig1.json (100%) rename {src/test => test/util}/data/txcreatemultisig2.hex (100%) rename {src/test => test/util}/data/txcreatemultisig2.json (100%) rename {src/test => test/util}/data/txcreatemultisig3.hex (100%) rename {src/test => test/util}/data/txcreatemultisig3.json (100%) rename {src/test => test/util}/data/txcreatemultisig4.hex (100%) rename {src/test => test/util}/data/txcreatemultisig4.json (100%) rename {src/test => test/util}/data/txcreateoutpubkey1.hex (100%) rename {src/test => test/util}/data/txcreateoutpubkey1.json (100%) rename {src/test => test/util}/data/txcreateoutpubkey2.hex (100%) rename {src/test => test/util}/data/txcreateoutpubkey2.json (100%) rename {src/test => test/util}/data/txcreateoutpubkey3.hex (100%) rename {src/test => test/util}/data/txcreateoutpubkey3.json (100%) rename {src/test => test/util}/data/txcreatescript1.hex (100%) rename {src/test => test/util}/data/txcreatescript1.json (100%) rename {src/test => test/util}/data/txcreatescript2.hex (100%) rename {src/test => test/util}/data/txcreatescript2.json (100%) rename {src/test => test/util}/data/txcreatescript3.hex (100%) rename {src/test => test/util}/data/txcreatescript3.json (100%) rename {src/test => test/util}/data/txcreatescript4.hex (100%) rename {src/test => test/util}/data/txcreatescript4.json (100%) rename {src/test => test/util}/data/txcreatesignv1.hex (100%) rename {src/test => test/util}/data/txcreatesignv1.json (100%) rename {src/test => test/util}/data/txcreatesignv2.hex (100%) diff --git a/.gitignore b/.gitignore index 479889cb7..f1e9ca20c 100644 --- a/.gitignore +++ b/.gitignore @@ -101,9 +101,9 @@ coverage_percent.txt linux-coverage-build linux-build win32-build -qa/pull-tester/tests_config.py -qa/pull-tester/tests_config.ini -qa/cache/* +test/functional/config.ini +test/util/buildenv.py +test/cache/* !src/leveldb*/Makefile diff --git a/Makefile.am b/Makefile.am index 12ddfcd99..e82704dbd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -225,8 +225,64 @@ dist_noinst_SCRIPTS = autogen.sh EXTRA_DIST = $(top_srcdir)/share/genbuild.sh test/functional/test_runner.py test/functional $(DIST_CONTRIB) $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS) +EXTRA_DIST += \ + test/util/bctest.py \ + test/util/bitcoin-util-test.py \ + test/util/data/bitcoin-util-test.json \ + test/util/data/blanktxv1.hex \ + test/util/data/blanktxv1.json \ + test/util/data/blanktxv2.hex \ + test/util/data/blanktxv2.json \ + test/util/data/tt-delin1-out.hex \ + test/util/data/tt-delin1-out.json \ + test/util/data/tt-delout1-out.hex \ + test/util/data/tt-delout1-out.json \ + test/util/data/tt-locktime317000-out.hex \ + test/util/data/tt-locktime317000-out.json \ + test/util/data/tx394b54bb.hex \ + test/util/data/txcreate1.hex \ + test/util/data/txcreate1.json \ + test/util/data/txcreate2.hex \ + test/util/data/txcreate2.json \ + test/util/data/txcreatedata1.hex \ + test/util/data/txcreatedata1.json \ + test/util/data/txcreatedata2.hex \ + test/util/data/txcreatedata2.json \ + test/util/data/txcreatedata_seq0.hex \ + test/util/data/txcreatedata_seq0.json \ + test/util/data/txcreatedata_seq1.hex \ + test/util/data/txcreatedata_seq1.json \ + test/util/data/txcreatemultisig1.hex \ + test/util/data/txcreatemultisig1.json \ + test/util/data/txcreatemultisig2.hex \ + test/util/data/txcreatemultisig2.json \ + test/util/data/txcreatemultisig3.hex \ + test/util/data/txcreatemultisig3.json \ + test/util/data/txcreatemultisig4.hex \ + test/util/data/txcreatemultisig4.json \ + test/util/data/txcreateoutpubkey1.hex \ + test/util/data/txcreateoutpubkey1.json \ + test/util/data/txcreateoutpubkey2.hex \ + test/util/data/txcreateoutpubkey2.json \ + test/util/data/txcreateoutpubkey3.hex \ + test/util/data/txcreateoutpubkey3.json \ + test/util/data/txcreatescript1.hex \ + test/util/data/txcreatescript1.json \ + test/util/data/txcreatescript2.hex \ + test/util/data/txcreatescript2.json \ + test/util/data/txcreatescript3.hex \ + test/util/data/txcreatescript3.json \ + test/util/data/txcreatescript4.hex \ + test/util/data/txcreatescript4.json \ + test/util/data/txcreatesignv1.hex \ + test/util/data/txcreatesignv1.json \ + test/util/data/txcreatesignv2.hex + CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER) +# This file is problematic for out-of-tree builds if it exists. +DISTCLEANFILES = test/util/buildenv.pyc + .INTERMEDIATE: $(COVERAGE_INFO) DISTCHECK_CONFIGURE_FLAGS = --enable-man diff --git a/configure.ac b/configure.ac index cd1d4204c..2a9ee018a 100644 --- a/configure.ac +++ b/configure.ac @@ -1147,9 +1147,12 @@ AC_SUBST(EVENT_PTHREADS_LIBS) AC_SUBST(ZMQ_LIBS) AC_SUBST(PROTOBUF_LIBS) AC_SUBST(QR_LIBS) -AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist src/test/buildenv.py test/functional/config.ini]) +AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist test/functional/config.ini]) +AC_CONFIG_FILES([test/util/buildenv.py],[chmod +x test/util/buildenv.py]) AC_CONFIG_FILES([contrib/devtools/split-debug.sh],[chmod +x contrib/devtools/split-debug.sh]) AC_CONFIG_LINKS([test/functional/test_runner.py:test/functional/test_runner.py]) +AC_CONFIG_LINKS([test/util/bitcoin-util-test.py:test/util/bitcoin-util-test.py]) +AC_CONFIG_LINKS([test/util/bctest.py:test/util/bctest.py]) dnl boost's m4 checks do something really nasty: they export these vars. As a dnl result, they leak into secp256k1's configure and crazy things happen. @@ -1197,8 +1200,8 @@ esac dnl Replace the BUILDDIR path with the correct Windows path if compiling on Native Windows case ${OS} in *Windows*) - sed 's/BUILDDIR="\/\([[a-z]]\)/BUILDDIR="\1:/' test/pull-tester/tests_config.py > test/pull-tester/tests_config-2.py - mv test/pull-tester/tests_config-2.py test/pull-tester/tests_config.py + sed 's/BUILDDIR="\/\([[a-z]]\)/BUILDDIR="\1:/' test/functional/config.ini > test/functional/config-2.ini + mv test/functional/config-2.ini test/functional/config.ini ;; esac diff --git a/contrib/rpm/bitcoin.spec b/contrib/rpm/bitcoin.spec index 54d661839..cc54fcaf3 100644 --- a/contrib/rpm/bitcoin.spec +++ b/contrib/rpm/bitcoin.spec @@ -311,9 +311,7 @@ rm -f %{buildroot}%{_bindir}/test_* %check make check -pushd src -srcdir=. test/bitcoin-util-test.py -popd +srcdir=src test/bitcoin-util-test.py test/functional/test_runner.py --extended %post libs -p /sbin/ldconfig diff --git a/src/Makefile.test.include b/src/Makefile.test.include index cfd08b823..fe0ed59fe 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -8,60 +8,6 @@ noinst_PROGRAMS += test/test_bitcoin_fuzzy TEST_SRCDIR = test TEST_BINARY=test/test_bitcoin$(EXEEXT) - -EXTRA_DIST += \ - test/bctest.py \ - test/bitcoin-util-test.py \ - test/data/bitcoin-util-test.json \ - test/data/blanktxv1.hex \ - test/data/blanktxv1.json \ - test/data/blanktxv2.hex \ - test/data/blanktxv2.json \ - test/data/tt-delin1-out.hex \ - test/data/tt-delin1-out.json \ - test/data/tt-delout1-out.hex \ - test/data/tt-delout1-out.json \ - test/data/tt-locktime317000-out.hex \ - test/data/tt-locktime317000-out.json \ - test/data/tx394b54bb.hex \ - test/data/txcreate1.hex \ - test/data/txcreate1.json \ - test/data/txcreate2.hex \ - test/data/txcreate2.json \ - test/data/txcreatedata1.hex \ - test/data/txcreatedata1.json \ - test/data/txcreatedata2.hex \ - test/data/txcreatedata2.json \ - test/data/txcreatedata_seq0.hex \ - test/data/txcreatedata_seq0.json \ - test/data/txcreatedata_seq1.hex \ - test/data/txcreatedata_seq1.json \ - test/data/txcreatemultisig1.hex \ - test/data/txcreatemultisig1.json \ - test/data/txcreatemultisig2.hex \ - test/data/txcreatemultisig2.json \ - test/data/txcreatemultisig3.hex \ - test/data/txcreatemultisig3.json \ - test/data/txcreatemultisig4.hex \ - test/data/txcreatemultisig4.json \ - test/data/txcreateoutpubkey1.hex \ - test/data/txcreateoutpubkey1.json \ - test/data/txcreateoutpubkey2.hex \ - test/data/txcreateoutpubkey2.json \ - test/data/txcreateoutpubkey3.hex \ - test/data/txcreateoutpubkey3.json \ - test/data/txcreatescript1.hex \ - test/data/txcreatescript1.json \ - test/data/txcreatescript2.hex \ - test/data/txcreatescript2.json \ - test/data/txcreatescript3.hex \ - test/data/txcreatescript3.json \ - test/data/txcreatescript4.hex \ - test/data/txcreatescript4.json \ - test/data/txcreatesignv1.hex \ - test/data/txcreatesignv1.json \ - test/data/txcreatesignv2.hex - JSON_TEST_FILES = \ test/data/script_tests.json \ test/data/base58_keys_valid.json \ @@ -191,9 +137,6 @@ CLEAN_BITCOIN_TEST = test/*.gcda test/*.gcno $(GENERATED_TEST_FILES) CLEANFILES += $(CLEAN_BITCOIN_TEST) -# This file is problematic for out-of-tree builds if it exists. -DISTCLEANFILES += test/buildenv.pyc - bitcoin_test: $(TEST_BINARY) bitcoin_test_check: $(TEST_BINARY) FORCE @@ -203,8 +146,8 @@ bitcoin_test_clean : FORCE rm -f $(CLEAN_BITCOIN_TEST) $(test_test_bitcoin_OBJECTS) $(TEST_BINARY) check-local: - @echo "Running test/bitcoin-util-test.py..." - $(AM_V_at)srcdir=$(srcdir) PYTHONPATH=$(builddir)/test $(PYTHON) $(srcdir)/test/bitcoin-util-test.py + @echo "Running test/util/bitcoin-util-test.py..." + $(PYTHON) $(top_builddir)/test/util/bitcoin-util-test.py $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1 check if EMBEDDED_UNIVALUE $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C univalue check diff --git a/src/test/README.md b/src/test/README.md index 8f99804e1..eeb04c6ff 100644 --- a/src/test/README.md +++ b/src/test/README.md @@ -50,12 +50,3 @@ examine `uint256_tests.cpp`. For further reading, I found the following website to be helpful in explaining how the boost unit test framework works: [http://www.alittlemadness.com/2009/03/31/c-unit-testing-with-boosttest/](http://www.alittlemadness.com/2009/03/31/c-unit-testing-with-boosttest/). - -### bitcoin-util-test.py - -The test directory also contains the bitcoin-util-test.py tool, which tests bitcoin utils (currently just bitcoin-tx). This test gets run automatically during the `make check` build process. It is also possible to run the test manually from the src directory: - -``` -test/bitcoin-util-test.py --srcdir=[current directory] - -``` diff --git a/src/test/bitcoin-util-test.py b/src/test/bitcoin-util-test.py deleted file mode 100755 index e2087187a..000000000 --- a/src/test/bitcoin-util-test.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python -# Copyright 2014 BitPay Inc. -# Copyright 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. -from __future__ import division,print_function,unicode_literals -import os -import bctest -import buildenv -import argparse -import logging - -help_text="""Test framework for bitcoin utils. - -Runs automatically during `make check`. - -Can also be run manually from the src directory by specifying the source directory: - -test/bitcoin-util-test.py --srcdir='srcdir' [--verbose] -""" - -if __name__ == '__main__': - # Try to get the source directory from the environment variables. This will - # be set for `make check` automated runs. If environment variable is not set, - # then get the source directory from command line args. - try: - srcdir = os.environ["srcdir"] - verbose = False - except: - parser = argparse.ArgumentParser(description=help_text) - parser.add_argument('-s', '--srcdir') - parser.add_argument('-v', '--verbose', action='store_true') - args = parser.parse_args() - srcdir = args.srcdir - verbose = args.verbose - - if verbose: - level = logging.DEBUG - else: - level = logging.ERROR - formatter = '%(asctime)s - %(levelname)s - %(message)s' - # Add the format/level to the logger - logging.basicConfig(format = formatter, level=level) - - bctest.bctester(srcdir + "/test/data", "bitcoin-util-test.json", buildenv) diff --git a/src/test/buildenv.py.in b/src/test/buildenv.py.in deleted file mode 100644 index 153f34a3d..000000000 --- a/src/test/buildenv.py.in +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env python -exeext="@EXEEXT@" diff --git a/test/README.md b/test/README.md index 3bf43717f..dec8db960 100644 --- a/test/README.md +++ b/test/README.md @@ -1,29 +1,32 @@ -The [functional](/test/functional/) folder contains a script test_runner - to call multiple functional tests from its folder. +This directory contains integration tests that test bitcoind and its +utilities in their entirety. It does not contain unit tests, which +can be found in [/src/test](/src/test), [/src/wallet/test](/src/wallet/test), +etc. -Every pull request to the bitcoin repository is built and run through -the regression test suite. You can also run all or only individual -tests locally. +There are currently two sets of tests in this directory: -Test dependencies -================= -Before running the tests, the following must be installed. +- [functional](/test/functional) which test the functionality of +bitcoind and bitcoin-qt by interacting with them through the RPC and P2P +interfaces. +- [util](test/util) which tests the bitcoin utilities, currently only +bitcoin-tx. -Unix ----- -The python3-zmq library is required. On Ubuntu or Debian it can be installed via: -``` -sudo apt-get install python3-zmq -``` +The util tests are run as part of `make check` target. The functional +tests are run by the travis continuous build process whenever a pull +request is opened. Both sets of tests can also be run locally. -OS X ------- -``` -pip3 install pyzmq -``` +Functional Test dependencies +============================ +The ZMQ functional test requires a python ZMQ library. To install it: + +- on Unix, run `sudo apt-get install python3-zmq` +- on mac OS, run `pip3 install pyzmq` -Running tests -============= +Running tests locally +===================== + +Functional tests +---------------- You can run any single test by calling @@ -80,8 +83,15 @@ rm -rf cache killall bitcoind ``` -Writing tests -============= -You are encouraged to write tests for new or existing features. -Further information about the test framework and individual functional +Util tests +---------- + +Util tests can be run locally by running `test/util/bitcoin-util-test.py`. +Use the `-v` option for verbose output. + +Writing functional tests +======================== + +You are encouraged to write functional tests for new or existing features. +Further information about the functional test framework and individual tests is found in [test/functional](/test/functional). diff --git a/src/test/bctest.py b/test/util/bctest.py similarity index 96% rename from src/test/bctest.py rename to test/util/bctest.py index c69f52afc..dfe3a123d 100644 --- a/src/test/bctest.py +++ b/test/util/bctest.py @@ -23,14 +23,14 @@ def parse_output(a, fmt): else: raise NotImplementedError("Don't know how to compare %s" % fmt) -def bctest(testDir, testObj, exeext): +def bctest(testDir, testObj, buildenv): """Runs a single test, comparing output and RC to expected output and RC. Raises an error if input can't be read, executable fails, or output/RC are not as expected. Error is caught by bctester() and reported. """ # Get the exec names and arguments - execprog = testObj['exec'] + exeext + execprog = buildenv.BUILDDIR + "/src/" + testObj['exec'] + buildenv.exeext execargs = testObj['args'] execrun = [execprog] + execargs @@ -112,7 +112,7 @@ def bctester(testDir, input_basename, buildenv): for testObj in input_data: try: - bctest(testDir, testObj, buildenv.exeext) + bctest(testDir, testObj, buildenv) logging.info("PASSED: " + testObj["description"]) except: logging.info("FAILED: " + testObj["description"]) diff --git a/test/util/bitcoin-util-test.py b/test/util/bitcoin-util-test.py new file mode 100755 index 000000000..e09a25159 --- /dev/null +++ b/test/util/bitcoin-util-test.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python +# Copyright 2014 BitPay Inc. +# Copyright 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. +from __future__ import division,print_function,unicode_literals +import os +import sys +import argparse +import logging + +help_text="""Test framework for bitcoin utils. + +Runs automatically during `make check`. + +Can also be run manually.""" + +if __name__ == '__main__': + sys.path.append(os.path.dirname(os.path.abspath(__file__))) + import buildenv + import bctest + + parser = argparse.ArgumentParser(description=help_text) + parser.add_argument('-v', '--verbose', action='store_true') + args = parser.parse_args() + verbose = args.verbose + + if verbose: + level = logging.DEBUG + else: + level = logging.ERROR + formatter = '%(asctime)s - %(levelname)s - %(message)s' + # Add the format/level to the logger + logging.basicConfig(format = formatter, level=level) + + bctest.bctester(buildenv.SRCDIR + "/test/util/data", "bitcoin-util-test.json", buildenv) diff --git a/test/util/buildenv.py.in b/test/util/buildenv.py.in new file mode 100644 index 000000000..33030b034 --- /dev/null +++ b/test/util/buildenv.py.in @@ -0,0 +1,4 @@ +#!/usr/bin/env python +exeext="@EXEEXT@" +SRCDIR="@abs_top_srcdir@" +BUILDDIR="@abs_top_builddir@" diff --git a/src/test/data/bitcoin-util-test.json b/test/util/data/bitcoin-util-test.json similarity index 100% rename from src/test/data/bitcoin-util-test.json rename to test/util/data/bitcoin-util-test.json diff --git a/src/test/data/blanktxv1.hex b/test/util/data/blanktxv1.hex similarity index 100% rename from src/test/data/blanktxv1.hex rename to test/util/data/blanktxv1.hex diff --git a/src/test/data/blanktxv1.json b/test/util/data/blanktxv1.json similarity index 100% rename from src/test/data/blanktxv1.json rename to test/util/data/blanktxv1.json diff --git a/src/test/data/blanktxv2.hex b/test/util/data/blanktxv2.hex similarity index 100% rename from src/test/data/blanktxv2.hex rename to test/util/data/blanktxv2.hex diff --git a/src/test/data/blanktxv2.json b/test/util/data/blanktxv2.json similarity index 100% rename from src/test/data/blanktxv2.json rename to test/util/data/blanktxv2.json diff --git a/src/test/data/tt-delin1-out.hex b/test/util/data/tt-delin1-out.hex similarity index 100% rename from src/test/data/tt-delin1-out.hex rename to test/util/data/tt-delin1-out.hex diff --git a/src/test/data/tt-delin1-out.json b/test/util/data/tt-delin1-out.json similarity index 100% rename from src/test/data/tt-delin1-out.json rename to test/util/data/tt-delin1-out.json diff --git a/src/test/data/tt-delout1-out.hex b/test/util/data/tt-delout1-out.hex similarity index 100% rename from src/test/data/tt-delout1-out.hex rename to test/util/data/tt-delout1-out.hex diff --git a/src/test/data/tt-delout1-out.json b/test/util/data/tt-delout1-out.json similarity index 100% rename from src/test/data/tt-delout1-out.json rename to test/util/data/tt-delout1-out.json diff --git a/src/test/data/tt-locktime317000-out.hex b/test/util/data/tt-locktime317000-out.hex similarity index 100% rename from src/test/data/tt-locktime317000-out.hex rename to test/util/data/tt-locktime317000-out.hex diff --git a/src/test/data/tt-locktime317000-out.json b/test/util/data/tt-locktime317000-out.json similarity index 100% rename from src/test/data/tt-locktime317000-out.json rename to test/util/data/tt-locktime317000-out.json diff --git a/src/test/data/tx394b54bb.hex b/test/util/data/tx394b54bb.hex similarity index 100% rename from src/test/data/tx394b54bb.hex rename to test/util/data/tx394b54bb.hex diff --git a/src/test/data/txcreate1.hex b/test/util/data/txcreate1.hex similarity index 100% rename from src/test/data/txcreate1.hex rename to test/util/data/txcreate1.hex diff --git a/src/test/data/txcreate1.json b/test/util/data/txcreate1.json similarity index 100% rename from src/test/data/txcreate1.json rename to test/util/data/txcreate1.json diff --git a/src/test/data/txcreate2.hex b/test/util/data/txcreate2.hex similarity index 100% rename from src/test/data/txcreate2.hex rename to test/util/data/txcreate2.hex diff --git a/src/test/data/txcreate2.json b/test/util/data/txcreate2.json similarity index 100% rename from src/test/data/txcreate2.json rename to test/util/data/txcreate2.json diff --git a/src/test/data/txcreatedata1.hex b/test/util/data/txcreatedata1.hex similarity index 100% rename from src/test/data/txcreatedata1.hex rename to test/util/data/txcreatedata1.hex diff --git a/src/test/data/txcreatedata1.json b/test/util/data/txcreatedata1.json similarity index 100% rename from src/test/data/txcreatedata1.json rename to test/util/data/txcreatedata1.json diff --git a/src/test/data/txcreatedata2.hex b/test/util/data/txcreatedata2.hex similarity index 100% rename from src/test/data/txcreatedata2.hex rename to test/util/data/txcreatedata2.hex diff --git a/src/test/data/txcreatedata2.json b/test/util/data/txcreatedata2.json similarity index 100% rename from src/test/data/txcreatedata2.json rename to test/util/data/txcreatedata2.json diff --git a/src/test/data/txcreatedata_seq0.hex b/test/util/data/txcreatedata_seq0.hex similarity index 100% rename from src/test/data/txcreatedata_seq0.hex rename to test/util/data/txcreatedata_seq0.hex diff --git a/src/test/data/txcreatedata_seq0.json b/test/util/data/txcreatedata_seq0.json similarity index 100% rename from src/test/data/txcreatedata_seq0.json rename to test/util/data/txcreatedata_seq0.json diff --git a/src/test/data/txcreatedata_seq1.hex b/test/util/data/txcreatedata_seq1.hex similarity index 100% rename from src/test/data/txcreatedata_seq1.hex rename to test/util/data/txcreatedata_seq1.hex diff --git a/src/test/data/txcreatedata_seq1.json b/test/util/data/txcreatedata_seq1.json similarity index 100% rename from src/test/data/txcreatedata_seq1.json rename to test/util/data/txcreatedata_seq1.json diff --git a/src/test/data/txcreatemultisig1.hex b/test/util/data/txcreatemultisig1.hex similarity index 100% rename from src/test/data/txcreatemultisig1.hex rename to test/util/data/txcreatemultisig1.hex diff --git a/src/test/data/txcreatemultisig1.json b/test/util/data/txcreatemultisig1.json similarity index 100% rename from src/test/data/txcreatemultisig1.json rename to test/util/data/txcreatemultisig1.json diff --git a/src/test/data/txcreatemultisig2.hex b/test/util/data/txcreatemultisig2.hex similarity index 100% rename from src/test/data/txcreatemultisig2.hex rename to test/util/data/txcreatemultisig2.hex diff --git a/src/test/data/txcreatemultisig2.json b/test/util/data/txcreatemultisig2.json similarity index 100% rename from src/test/data/txcreatemultisig2.json rename to test/util/data/txcreatemultisig2.json diff --git a/src/test/data/txcreatemultisig3.hex b/test/util/data/txcreatemultisig3.hex similarity index 100% rename from src/test/data/txcreatemultisig3.hex rename to test/util/data/txcreatemultisig3.hex diff --git a/src/test/data/txcreatemultisig3.json b/test/util/data/txcreatemultisig3.json similarity index 100% rename from src/test/data/txcreatemultisig3.json rename to test/util/data/txcreatemultisig3.json diff --git a/src/test/data/txcreatemultisig4.hex b/test/util/data/txcreatemultisig4.hex similarity index 100% rename from src/test/data/txcreatemultisig4.hex rename to test/util/data/txcreatemultisig4.hex diff --git a/src/test/data/txcreatemultisig4.json b/test/util/data/txcreatemultisig4.json similarity index 100% rename from src/test/data/txcreatemultisig4.json rename to test/util/data/txcreatemultisig4.json diff --git a/src/test/data/txcreateoutpubkey1.hex b/test/util/data/txcreateoutpubkey1.hex similarity index 100% rename from src/test/data/txcreateoutpubkey1.hex rename to test/util/data/txcreateoutpubkey1.hex diff --git a/src/test/data/txcreateoutpubkey1.json b/test/util/data/txcreateoutpubkey1.json similarity index 100% rename from src/test/data/txcreateoutpubkey1.json rename to test/util/data/txcreateoutpubkey1.json diff --git a/src/test/data/txcreateoutpubkey2.hex b/test/util/data/txcreateoutpubkey2.hex similarity index 100% rename from src/test/data/txcreateoutpubkey2.hex rename to test/util/data/txcreateoutpubkey2.hex diff --git a/src/test/data/txcreateoutpubkey2.json b/test/util/data/txcreateoutpubkey2.json similarity index 100% rename from src/test/data/txcreateoutpubkey2.json rename to test/util/data/txcreateoutpubkey2.json diff --git a/src/test/data/txcreateoutpubkey3.hex b/test/util/data/txcreateoutpubkey3.hex similarity index 100% rename from src/test/data/txcreateoutpubkey3.hex rename to test/util/data/txcreateoutpubkey3.hex diff --git a/src/test/data/txcreateoutpubkey3.json b/test/util/data/txcreateoutpubkey3.json similarity index 100% rename from src/test/data/txcreateoutpubkey3.json rename to test/util/data/txcreateoutpubkey3.json diff --git a/src/test/data/txcreatescript1.hex b/test/util/data/txcreatescript1.hex similarity index 100% rename from src/test/data/txcreatescript1.hex rename to test/util/data/txcreatescript1.hex diff --git a/src/test/data/txcreatescript1.json b/test/util/data/txcreatescript1.json similarity index 100% rename from src/test/data/txcreatescript1.json rename to test/util/data/txcreatescript1.json diff --git a/src/test/data/txcreatescript2.hex b/test/util/data/txcreatescript2.hex similarity index 100% rename from src/test/data/txcreatescript2.hex rename to test/util/data/txcreatescript2.hex diff --git a/src/test/data/txcreatescript2.json b/test/util/data/txcreatescript2.json similarity index 100% rename from src/test/data/txcreatescript2.json rename to test/util/data/txcreatescript2.json diff --git a/src/test/data/txcreatescript3.hex b/test/util/data/txcreatescript3.hex similarity index 100% rename from src/test/data/txcreatescript3.hex rename to test/util/data/txcreatescript3.hex diff --git a/src/test/data/txcreatescript3.json b/test/util/data/txcreatescript3.json similarity index 100% rename from src/test/data/txcreatescript3.json rename to test/util/data/txcreatescript3.json diff --git a/src/test/data/txcreatescript4.hex b/test/util/data/txcreatescript4.hex similarity index 100% rename from src/test/data/txcreatescript4.hex rename to test/util/data/txcreatescript4.hex diff --git a/src/test/data/txcreatescript4.json b/test/util/data/txcreatescript4.json similarity index 100% rename from src/test/data/txcreatescript4.json rename to test/util/data/txcreatescript4.json diff --git a/src/test/data/txcreatesignv1.hex b/test/util/data/txcreatesignv1.hex similarity index 100% rename from src/test/data/txcreatesignv1.hex rename to test/util/data/txcreatesignv1.hex diff --git a/src/test/data/txcreatesignv1.json b/test/util/data/txcreatesignv1.json similarity index 100% rename from src/test/data/txcreatesignv1.json rename to test/util/data/txcreatesignv1.json diff --git a/src/test/data/txcreatesignv2.hex b/test/util/data/txcreatesignv2.hex similarity index 100% rename from src/test/data/txcreatesignv2.hex rename to test/util/data/txcreatesignv2.hex