Skip to content

Commit 95836c5

Browse files
committed
Use shared config file for functional and util tests
The functional tests and util tests both require a config file that is generated by ./configure. This commit merges those two config files into a single configuration file that can be shared by both tests. The config from config.ini is put into a Namespace object to maintain the interface with bctest.py. A future commit could change this interface to use a dictionary instead of a namespace.
1 parent 89fcd35 commit 95836c5

File tree

6 files changed

+7
-18
lines changed

6 files changed

+7
-18
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ coverage_percent.txt
100100
linux-coverage-build
101101
linux-build
102102
win32-build
103-
test/functional/config.ini
103+
test/config.ini
104104
test/cache/*
105105

106106
!src/leveldb*/Makefile

configure.ac

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,7 +1160,7 @@ AC_SUBST(EVENT_PTHREADS_LIBS)
11601160
AC_SUBST(ZMQ_LIBS)
11611161
AC_SUBST(PROTOBUF_LIBS)
11621162
AC_SUBST(QR_LIBS)
1163-
AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist test/functional/config.ini test/util/config.ini])
1163+
AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist test/config.ini])
11641164
AC_CONFIG_FILES([contrib/devtools/split-debug.sh],[chmod +x contrib/devtools/split-debug.sh])
11651165
AC_CONFIG_FILES([doc/Doxyfile])
11661166
AC_CONFIG_LINKS([test/functional/test_runner.py:test/functional/test_runner.py])
@@ -1213,8 +1213,8 @@ esac
12131213
dnl Replace the BUILDDIR path with the correct Windows path if compiling on Native Windows
12141214
case ${OS} in
12151215
*Windows*)
1216-
sed 's/BUILDDIR="\/\([[a-z]]\)/BUILDDIR="\1:/' test/functional/config.ini > test/functional/config-2.ini
1217-
mv test/functional/config-2.ini test/functional/config.ini
1216+
sed 's/BUILDDIR="\/\([[a-z]]\)/BUILDDIR="\1:/' test/config.ini > test/config-2.ini
1217+
mv test/config-2.ini test/config.ini
12181218
;;
12191219
esac
12201220

test/functional/config.ini.in renamed to test/config.ini.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

55
# These environment variables are set by the build process and read by
6-
# test/functional/test_runner.py
6+
# test/functional/test_runner.py and test/util/bitcoin-util-test.py
77

88
[environment]
99
SRCDIR=@abs_top_srcdir@

test/functional/test_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def main():
179179

180180
# Read config generated by configure.
181181
config = configparser.ConfigParser()
182-
configfile = os.path.abspath(os.path.dirname(__file__)) + "/config.ini"
182+
configfile = os.path.abspath(os.path.dirname(__file__)) + "/../config.ini"
183183
config.read_file(open(configfile))
184184

185185
passon_args.append("--configfile=%s" % configfile)

test/util/bitcoin-util-test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import bctest
2121

2222
config = configparser.ConfigParser()
23-
config.read_file(open(os.path.dirname(__file__) + "/config.ini"))
23+
config.read_file(open(os.path.dirname(__file__) + "/../config.ini"))
2424

2525
buildenv = argparse.Namespace(exeext=config["environment"]["EXEEXT"],
2626
SRCDIR=config["environment"]["SRCDIR"],

test/util/config.ini.in

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)