Skip to content

Commit

Permalink
Share config between util and functional tests
Browse files Browse the repository at this point in the history
Summary:
Backport core's PR10331

Depends on D956

Test Plan:
  make check
  ./test/functional/test_runner.py

Reviewers: schancel, #bitcoin_abc

Reviewed By: schancel, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D959
  • Loading branch information
jnewbery authored and deadalnix committed Jan 16, 2018
1 parent f9d817b commit 6c4dd6b
Show file tree
Hide file tree
Showing 10 changed files with 172 additions and 181 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Expand Up @@ -81,7 +81,6 @@ Bitcoin-Qt.app
# Unit-tests
Makefile.test
bitcoin-qt_test
src/test/buildenv.py

# Resources cpp
qrc_*.cpp
Expand All @@ -102,8 +101,7 @@ coverage_percent.txt
linux-coverage-build
linux-build
win32-build
test/functional/config.ini
test/util/buildenv.py
test/config.ini
test/cache/*

!src/leveldb*/Makefile
Expand Down
4 changes: 0 additions & 4 deletions Makefile.am
Expand Up @@ -232,7 +232,6 @@ dist_noinst_SCRIPTS = autogen.sh
EXTRA_DIST = $(top_srcdir)/share/genbuild.sh test/functional/test_runner.py test/functional $(DIST_CONTRIB) $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS)

EXTRA_DIST += \
test/util/bctest.py \
test/util/bitcoin-util-test.py \
test/util/data/bitcoin-util-test.json \
test/util/data/blanktxv1.hex \
Expand Down Expand Up @@ -274,9 +273,6 @@ EXTRA_DIST += \

CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER)

# This file is problematic for out-of-tree builds if it exists.
DISTCLEANFILES = test/util/buildenv.pyc

.INTERMEDIATE: $(COVERAGE_INFO)

DISTCHECK_CONFIGURE_FLAGS = --enable-man
Expand Down
8 changes: 3 additions & 5 deletions configure.ac
Expand Up @@ -1277,12 +1277,10 @@ AC_SUBST(EVENT_PTHREADS_LIBS)
AC_SUBST(ZMQ_LIBS)
AC_SUBST(PROTOBUF_LIBS)
AC_SUBST(QR_LIBS)
AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist test/functional/config.ini])
AC_CONFIG_FILES([test/util/buildenv.py],[chmod +x test/util/buildenv.py])
AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist test/config.ini])
AC_CONFIG_FILES([contrib/devtools/split-debug.sh],[chmod +x contrib/devtools/split-debug.sh])
AC_CONFIG_LINKS([test/functional/test_runner.py:test/functional/test_runner.py])
AC_CONFIG_LINKS([test/util/bitcoin-util-test.py:test/util/bitcoin-util-test.py])
AC_CONFIG_LINKS([test/util/bctest.py:test/util/bctest.py])

dnl boost's m4 checks do something really nasty: they export these vars. As a
dnl result, they leak into secp256k1's configure and crazy things happen.
Expand Down Expand Up @@ -1330,8 +1328,8 @@ esac
dnl Replace the BUILDDIR path with the correct Windows path if compiling on Native Windows
case ${OS} in
*Windows*)
sed 's/BUILDDIR="\/\([[a-z]]\)/BUILDDIR="\1:/' test/functional/config.ini > test/functional/config-2.ini
mv test/functional/config-2.ini test/functional/config.ini
sed 's/BUILDDIR="\/\([[a-z]]\)/BUILDDIR="\1:/' test/config.ini > test/config-2.ini
mv test/config-2.ini test/config.ini
;;
esac

Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.test.include
Expand Up @@ -164,7 +164,7 @@ bitcoin_test_clean : FORCE

check-local:
@echo "Running test/util/bitcoin-util-test.py..."
$(PYTHON) $(top_builddir)/test/util/bitcoin-util-test.py
$(top_builddir)/test/util/bitcoin-util-test.py
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1 check
if EMBEDDED_UNIVALUE
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C univalue check
Expand Down
2 changes: 1 addition & 1 deletion test/functional/config.ini.in → test/config.ini.in
Expand Up @@ -3,7 +3,7 @@
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

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

[environment]
SRCDIR=@abs_top_srcdir@
Expand Down
2 changes: 1 addition & 1 deletion test/functional/test_runner.py
Expand Up @@ -160,7 +160,7 @@ def main():

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

passon_args.append("--configfile=%s" % configfile)
Expand Down
3 changes: 2 additions & 1 deletion test/functional/zmq_test.py
Expand Up @@ -32,7 +32,8 @@ def setup_nodes(self):
# Check that bitcoin has been built with ZMQ enabled
config = configparser.ConfigParser()
if not self.options.configfile:
self.options.configfile = os.path.dirname(__file__) + "/config.ini"
self.options.configfile = os.path.dirname(
__file__) + "/../config.ini"
config.read_file(open(self.options.configfile))

if not config["components"].getboolean("ENABLE_ZMQ"):
Expand Down
144 changes: 0 additions & 144 deletions test/util/bctest.py

This file was deleted.

0 comments on commit 6c4dd6b

Please sign in to comment.