diff options
Diffstat (limited to 'src/test/bitcoin-util-test.py')
-rwxr-xr-x | src/test/bitcoin-util-test.py | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/src/test/bitcoin-util-test.py b/src/test/bitcoin-util-test.py index 95dd3e81b4..3099506d6d 100755 --- a/src/test/bitcoin-util-test.py +++ b/src/test/bitcoin-util-test.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # Copyright 2014 BitPay, Inc. # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -6,8 +6,27 @@ 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__': + verbose = False + try: + srcdir = os.environ["srcdir"] + 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 + bctest.bctester(srcdir + "/test/data", "bitcoin-util-test.json", buildenv, verbose = verbose) |