diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-09-30 16:14:10 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-09-30 17:03:21 +0200 |
commit | ef0801bd138101898f56c2348355cf7feee1fb0e (patch) | |
tree | 07c2295b2120dcf86c87e9efd5bb9951fa2d5010 /src | |
parent | 90adfabd5daa2434af33f75df965d6aa23cd636c (diff) | |
parent | b82f4939385e87805b4c1896442f0e179e7d9465 (diff) |
Merge #8830: [test] Add option to run bitcoin-util-test.py manually
b82f493 Add option to run bitcoin-util-test.py manually (jnewbery)
Diffstat (limited to 'src')
-rw-r--r-- | src/test/README.md | 8 | ||||
-rwxr-xr-x | src/test/bitcoin-util-test.py | 22 |
2 files changed, 27 insertions, 3 deletions
diff --git a/src/test/README.md b/src/test/README.md index 61462642bf..3afdefe5fc 100644 --- a/src/test/README.md +++ b/src/test/README.md @@ -30,3 +30,11 @@ example, to run just the getarg_tests verbosely: Run `test_bitcoin --help` for the full list. +### 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] + +```
\ No newline at end of file diff --git a/src/test/bitcoin-util-test.py b/src/test/bitcoin-util-test.py index 882b5c67b8..225b3324e9 100755 --- a/src/test/bitcoin-util-test.py +++ b/src/test/bitcoin-util-test.py @@ -6,8 +6,24 @@ from __future__ import division,print_function,unicode_literals import os import bctest import buildenv +import argparse -if __name__ == '__main__': - bctest.bctester(os.environ["srcdir"] + "/test/data", - "bitcoin-util-test.json",buildenv) +help_text="""Test framework for bitcoin utils. + +Runs automatically during `make check`. + +Can also be run manually from the src directory by specifiying the source directory: +test/bitcoin-util-test.py --src=[srcdir] +""" + + +if __name__ == '__main__': + try: + srcdir = os.environ["srcdir"] + except: + parser = argparse.ArgumentParser(description=help_text) + parser.add_argument('-s', '--srcdir') + args = parser.parse_args() + srcdir = args.srcdir + bctest.bctester(srcdir + "/test/data", "bitcoin-util-test.json", buildenv) |