diff options
author | John Newbery <john@johnnewbery.com> | 2017-03-21 14:38:09 -0400 |
---|---|---|
committer | John Newbery <john@johnnewbery.com> | 2017-05-03 14:18:14 -0400 |
commit | 89fcd3586c9714a923b6a3147f60e43d5de74942 (patch) | |
tree | 4cf324feafd10daecd38edee3860a4c62f40b334 /test | |
parent | e9265df15b04178b40ab3bacfe6a944f0fb9ad27 (diff) |
Use an .ini config file for environment vars in bitcoin-util-test.py
Diffstat (limited to 'test')
-rwxr-xr-x | test/util/bitcoin-util-test.py | 9 | ||||
-rw-r--r-- | test/util/buildenv.py.in | 4 | ||||
-rw-r--r-- | test/util/config.ini.in | 11 |
3 files changed, 19 insertions, 5 deletions
diff --git a/test/util/bitcoin-util-test.py b/test/util/bitcoin-util-test.py index 0c67663edb..f85bd13f93 100755 --- a/test/util/bitcoin-util-test.py +++ b/test/util/bitcoin-util-test.py @@ -9,6 +9,7 @@ Runs automatically during `make check`. Can also be run manually.""" +import configparser import os import sys import argparse @@ -16,9 +17,15 @@ import logging if __name__ == '__main__': sys.path.append(os.path.dirname(os.path.abspath(__file__))) - import buildenv import bctest + config = configparser.ConfigParser() + config.read_file(open(os.path.dirname(__file__) + "/config.ini")) + + buildenv = argparse.Namespace(exeext=config["environment"]["EXEEXT"], + SRCDIR=config["environment"]["SRCDIR"], + BUILDDIR=config["environment"]["BUILDDIR"]) + parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('-v', '--verbose', action='store_true') args = parser.parse_args() diff --git a/test/util/buildenv.py.in b/test/util/buildenv.py.in deleted file mode 100644 index 33030b0348..0000000000 --- a/test/util/buildenv.py.in +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env python -exeext="@EXEEXT@" -SRCDIR="@abs_top_srcdir@" -BUILDDIR="@abs_top_builddir@" diff --git a/test/util/config.ini.in b/test/util/config.ini.in new file mode 100644 index 0000000000..a1f8f09cec --- /dev/null +++ b/test/util/config.ini.in @@ -0,0 +1,11 @@ +# Copyright (c) 2013-2017 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +# These environment variables are set by the build process and read by +# test/util/bitcoin-util-test.py + +[environment] +SRCDIR=@abs_top_srcdir@ +BUILDDIR=@abs_top_builddir@ +EXEEXT=@EXEEXT@ |