Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
Rename rpc-tests directory to functional
Browse files Browse the repository at this point in the history
  • Loading branch information
jnewbery committed Mar 20, 2017
1 parent 00902c4 commit c28ee91
Show file tree
Hide file tree
Showing 100 changed files with 25 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 7 additions & 7 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand All @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
3 changes: 1 addition & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down
2 changes: 1 addition & 1 deletion contrib/devtools/copyright_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
'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',
]
Expand Down
4 changes: 2 additions & 2 deletions doc/developer-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions test/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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).
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 8 additions & 8 deletions test/pull-tester/rpc-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
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`.
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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]
Expand Down Expand Up @@ -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.
"""
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -363,7 +363,7 @@ def _get_uncovered_rpc_commands(self):
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.'

Expand Down

0 comments on commit c28ee91

Please sign in to comment.