aboutsummaryrefslogtreecommitdiff
path: root/test/util/bitcoin-util-test.py
blob: 55d89c3b927a11680a3e916c281fc8c33524158b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python3
# 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.
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)