Changeset View
Changeset View
Standalone View
Standalone View
src/test/bitcoin-util-test.py
#!/usr/bin/env python | #!/usr/bin/env python3 | ||||
# Copyright 2014 BitPay Inc. | # Copyright 2014 BitPay Inc. | ||||
# Copyright 2016 The Bitcoin Core developers | # Copyright 2016 The Bitcoin Core developers | ||||
# Distributed under the MIT software license, see the accompanying | # Distributed under the MIT software license, see the accompanying | ||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php. | # file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
from __future__ import division,print_function,unicode_literals | from __future__ import division, print_function, unicode_literals | ||||
import os | import os | ||||
import bctest | import bctest | ||||
import buildenv | import buildenv | ||||
import argparse | import argparse | ||||
import logging | import logging | ||||
help_text="""Test framework for bitcoin utils. | help_text = """Test framework for bitcoin utils. | ||||
Runs automatically during `make check`. | Runs automatically during `make check`. | ||||
Can also be run manually from the src directory by specifying the source directory: | Can also be run manually from the src directory by specifying the source directory: | ||||
test/bitcoin-util-test.py --srcdir='srcdir' [--verbose] | test/bitcoin-util-test.py --srcdir='srcdir' [--verbose] | ||||
""" | """ | ||||
Show All 13 Lines | except: | ||||
verbose = args.verbose | verbose = args.verbose | ||||
if verbose: | if verbose: | ||||
level = logging.DEBUG | level = logging.DEBUG | ||||
else: | else: | ||||
level = logging.ERROR | level = logging.ERROR | ||||
formatter = '%(asctime)s - %(levelname)s - %(message)s' | formatter = '%(asctime)s - %(levelname)s - %(message)s' | ||||
# Add the format/level to the logger | # Add the format/level to the logger | ||||
logging.basicConfig(format = formatter, level=level) | logging.basicConfig(format=formatter, level=level) | ||||
bctest.bctester(srcdir + "/test/data", "bitcoin-util-test.json", buildenv) | bctest.bctester(srcdir + "/test/data", "bitcoin-util-test.json", buildenv) |