aboutsummaryrefslogtreecommitdiff
path: root/test/util/bitcoin-util-test.py
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2017-03-08 17:46:18 -0500
committerJohn Newbery <john@johnnewbery.com>2017-03-20 10:40:31 -0400
commit63d66ba20a634b54f6d5e8b051fb4a106f2cef6c (patch)
treee6c1211ac2cedbfbe61061fc405914262da4437e /test/util/bitcoin-util-test.py
parent5b0bff4581cf5cbecce35df46075ba256b4974f5 (diff)
Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.py
Diffstat (limited to 'test/util/bitcoin-util-test.py')
-rwxr-xr-xtest/util/bitcoin-util-test.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/util/bitcoin-util-test.py b/test/util/bitcoin-util-test.py
new file mode 100755
index 0000000000..e09a25159d
--- /dev/null
+++ b/test/util/bitcoin-util-test.py
@@ -0,0 +1,36 @@
+#!/usr/bin/env python
+# Copyright 2014 BitPay Inc.
+# Copyright 2016 The Bitcoin Core developers
+# Distributed under the MIT software license, see the accompanying
+# file COPYING or http://www.opensource.org/licenses/mit-license.php.
+from __future__ import division,print_function,unicode_literals
+import os
+import sys
+import argparse
+import logging
+
+help_text="""Test framework for bitcoin utils.
+
+Runs automatically during `make check`.
+
+Can also be run manually."""
+
+if __name__ == '__main__':
+ sys.path.append(os.path.dirname(os.path.abspath(__file__)))
+ import buildenv
+ import bctest
+
+ parser = argparse.ArgumentParser(description=help_text)
+ parser.add_argument('-v', '--verbose', action='store_true')
+ args = parser.parse_args()
+ verbose = args.verbose
+
+ if verbose:
+ level = logging.DEBUG
+ else:
+ level = logging.ERROR
+ formatter = '%(asctime)s - %(levelname)s - %(message)s'
+ # Add the format/level to the logger
+ logging.basicConfig(format = formatter, level=level)
+
+ bctest.bctester(buildenv.SRCDIR + "/test/util/data", "bitcoin-util-test.json", buildenv)