mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 05:57:59 +01:00
Use an .ini config file for environment vars in bitcoin-util-test.py
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
exeext="@EXEEXT@"
|
||||
SRCDIR="@abs_top_srcdir@"
|
||||
BUILDDIR="@abs_top_builddir@"
|
||||
11
test/util/config.ini.in
Normal file
11
test/util/config.ini.in
Normal file
@@ -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@
|
||||
Reference in New Issue
Block a user