Rename rpc-tests directory to functional

This commit is contained in:
John Newbery 2017-03-09 09:44:57 -05:00
parent 00902c48cd
commit c28ee91db0
100 changed files with 25 additions and 26 deletions

View file

@ -70,7 +70,7 @@ script:
- make $MAKEJOBS $GOAL || ( echo "Build failure. Verbose build follows." && make $GOAL V=1 ; false ) - make $MAKEJOBS $GOAL || ( echo "Build failure. Verbose build follows." && make $GOAL V=1 ; false )
- export LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/depends/$HOST/lib - 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 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: after_script:
- echo $TRAVIS_COMMIT_RANGE - echo $TRAVIS_COMMIT_RANGE
- echo $TRAVIS_COMMIT_LOG - echo $TRAVIS_COMMIT_LOG

View file

@ -61,7 +61,7 @@ OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) \
COVERAGE_INFO = baseline_filtered_combined.info baseline.info \ COVERAGE_INFO = baseline_filtered_combined.info baseline.info \
leveldb_baseline.info test_bitcoin_filtered.info total_coverage.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 leveldb_baseline_filtered.info test_bitcoin_coverage.info test_bitcoin.info
dist-hook: dist-hook:
@ -194,20 +194,20 @@ test_bitcoin.info: baseline_filtered_combined.info
test_bitcoin_filtered.info: test_bitcoin.info test_bitcoin_filtered.info: test_bitcoin.info
$(LCOV) -r $< "/usr/include/*" -o $@ $(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) -@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
$(LCOV) -z -d $(abs_builddir)/src/leveldb $(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 $@ $(LCOV) -r $< "/usr/include/*" -o $@
test_bitcoin_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info 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 $@ $(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 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 rpc_test_filtered.info -o $@ | $(GREP) "\%" | $(AWK) '{ print substr($$3,2,50) "/" $$5 }' > coverage_percent.txt $(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 test_bitcoin.coverage/.dirstamp: test_bitcoin_coverage.info
$(GENHTML) -s $< -o $(@D) $(GENHTML) -s $< -o $(@D)
@ -223,7 +223,7 @@ endif
dist_noinst_SCRIPTS = autogen.sh 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) CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER)

View file

@ -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 (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). 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. 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/pull-tester/rpc-tests.py`

View file

@ -1147,8 +1147,7 @@ AC_SUBST(EVENT_PTHREADS_LIBS)
AC_SUBST(ZMQ_LIBS) AC_SUBST(ZMQ_LIBS)
AC_SUBST(PROTOBUF_LIBS) AC_SUBST(PROTOBUF_LIBS)
AC_SUBST(QR_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([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([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_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/pull-tester/rpc-tests.py:test/pull-tester/rpc-tests.py])

View file

@ -32,7 +32,7 @@ EXCLUDE = [
'src/tinyformat.h', 'src/tinyformat.h',
'src/leveldb/util/env_win.cc', 'src/leveldb/util/env_win.cc',
'src/crypto/ctaes/bench.c', 'src/crypto/ctaes/bench.c',
'test/rpc-tests/test_framework/bignum.py', 'test/functional/test_framework/bignum.py',
# python init: # python init:
'*__init__.py', '*__init__.py',
] ]

View file

@ -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. 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. 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. that run in -regtest mode.
**DEBUG_LOCKORDER** **DEBUG_LOCKORDER**
@ -252,7 +252,7 @@ Wallet
- *Rationale*: In RPC code that conditionally uses the wallet (such as - *Rationale*: In RPC code that conditionally uses the wallet (such as
`validateaddress`) it is easy to forget that global pointer `pwalletMain` `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` exercising the API with `-disablewallet`
- Include `db_cxx.h` (BerkeleyDB header) only when `ENABLE_WALLET` is set - Include `db_cxx.h` (BerkeleyDB header) only when `ENABLE_WALLET` is set

View file

@ -1,5 +1,5 @@
The [pull-tester](/test/pull-tester/) folder contains a script to call 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 Every pull request to the bitcoin repository is built and run through
the regression test suite. You can also run all or only individual the regression test suite. You can also run all or only individual
@ -83,5 +83,5 @@ killall bitcoind
Writing tests Writing tests
============= =============
You are encouraged to write tests for new or existing features. You are encouraged to write tests for new or existing features.
Further information about the test framework and individual RPC Further information about the test framework and individual functional
tests is found in [test/rpc-tests](/test/rpc-tests). tests is found in [test/functional](/test/functional).

View file

@ -5,7 +5,7 @@
"""Create a blockchain cache. """Create a blockchain cache.
Creating a cache of the blockchain speeds up test execution when running 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. tests are being run in parallel.
""" """

View file

@ -8,7 +8,7 @@ rpc-tests.py - run regression test suite
This module calls down into individual test cases via subprocess. It will This module calls down into individual test cases via subprocess. It will
forward all unrecognized arguments onto the individual test scripts. 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 For a description of arguments recognized by test scripts, see
`test/pull-tester/test_framework/test_framework.py:BitcoinTestFramework.main`. `test/pull-tester/test_framework/test_framework.py:BitcoinTestFramework.main`.
@ -161,7 +161,7 @@ def main():
sys.exit(0) sys.exit(0)
if not (enable_wallet and enable_utils and enable_bitcoind): 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") print("Rerun `configure` with -enable-wallet, -with-utils and -with-daemon and rerun make")
sys.exit(0) sys.exit(0)
@ -206,7 +206,7 @@ def main():
if args.help: if args.help:
# Print help for rpc-tests.py, then print help of the first script and exit. # Print help for rpc-tests.py, then print help of the first script and exit.
parser.print_help() 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) sys.exit(0)
run_tests(test_list, config["environment"]["SRCDIR"], config["environment"]["BUILDDIR"], config["environment"]["EXEEXT"], args.jobs, args.coverage, passon_args) 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: if "BITCOIND" not in os.environ:
os.environ["BITCOIND"] = build_dir + '/src/bitcoind' + exeext 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 = ["--srcdir={}/src".format(build_dir)] + args
flags.append("--cachedir=%s/test/cache" % build_dir) 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 time_sum = 0
time0 = time.time() 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)) 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] 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) sys.exit(not all_passed)
class RPCTestHandler: class TestHandler:
""" """
Trigger the testscrips passed in via the list. 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 After all tests complete, the commands run are combined and diff'd against
the complete list to calculate uncovered RPC commands. 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): def __init__(self):
@ -363,7 +363,7 @@ class RPCCoverage(object):
Return a set of currently untested RPC commands. 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' reference_filename = 'rpc_interface.txt'
coverage_file_prefix = 'coverage.' coverage_file_prefix = 'coverage.'