aboutsummaryrefslogtreecommitdiff
path: root/src/test/bitcoin-util-test.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/bitcoin-util-test.py')
-rwxr-xr-xsrc/test/bitcoin-util-test.py22
1 files changed, 19 insertions, 3 deletions
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)