Merge #8830: [test] Add option to run bitcoin-util-test.py manually
b82f493
Add option to run bitcoin-util-test.py manually (jnewbery)
This commit is contained in:
commit
ef0801bd13
2 changed files with 27 additions and 3 deletions
|
@ -30,3 +30,11 @@ example, to run just the getarg_tests verbosely:
|
||||||
|
|
||||||
Run `test_bitcoin --help` for the full list.
|
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]
|
||||||
|
|
||||||
|
```
|
|
@ -6,8 +6,24 @@ from __future__ import division,print_function,unicode_literals
|
||||||
import os
|
import os
|
||||||
import bctest
|
import bctest
|
||||||
import buildenv
|
import buildenv
|
||||||
|
import argparse
|
||||||
|
|
||||||
|
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__':
|
if __name__ == '__main__':
|
||||||
bctest.bctester(os.environ["srcdir"] + "/test/data",
|
try:
|
||||||
"bitcoin-util-test.json",buildenv)
|
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)
|
||||||
|
|
Loading…
Reference in a new issue