Enable python tests for Native Windows

1) Multiplatorm support for devnull
2) Fixed a bug in the handling of cache files
3) Deleted run-bitcoin-cli as no longer needed
This commit is contained in:
ptschip 2015-08-26 06:02:21 -07:00 committed by Jack Grigg
parent c3df71a8e9
commit 8f863b2817
4 changed files with 14 additions and 18 deletions

View File

@ -155,7 +155,7 @@ endif
dist_bin_SCRIPTS = zcutil/fetch-params.sh
dist_noinst_SCRIPTS = autogen.sh zcutil/build-debian-package.sh zcutil/build.sh
EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/rpc-tests.sh qa/pull-tester/run-bitcoin-cli qa/rpc-tests qa/zcash $(DIST_DOCS) $(BIN_CHECKS)
EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/rpc-tests.sh qa/rpc-tests qa/zcash $(DIST_DOCS) $(BIN_CHECKS)
install-exec-hook:
mv $(DESTDIR)$(bindir)/fetch-params.sh $(DESTDIR)$(bindir)/zcash-fetch-params

View File

@ -5,8 +5,8 @@ CURDIR=$(cd $(dirname "$0"); pwd)
# Get BUILDDIR and REAL_BITCOIND
. "${CURDIR}/tests-config.sh"
export BITCOINCLI=${BUILDDIR}/qa/pull-tester/run-bitcoin-cli
export BITCOIND=${REAL_BITCOIND}
export BITCOINCLI=${REAL_BITCOINCLI}
#Run the tests

View File

@ -1,13 +0,0 @@
#!/bin/bash
# This is a thin wrapper around bitcoin-cli that strips the Windows-style EOLs
# from the output if present. It is necessary when using bitcoin-cli.exe on
# Linux since shells will interpret the line-endings as part of the result.
CURDIR=$(cd $(dirname "$0"); pwd)
# Get BUILDDIR and REAL_BITCOIND
# Grab the value of $REAL_BITCOINCLI which may be bitcoin-cli.exe.
. "${CURDIR}/tests-config.sh"
"${REAL_BITCOINCLI}" "$@" | sed 's/\r//'

View File

@ -136,8 +136,17 @@ def initialize_chain(test_dir):
print("initialize_chain(): Removing stale cache")
shutil.rmtree("cache")
if not os.path.isdir(os.path.join("cache", "node0")):
devnull = open(os.devnull, "w+")
if (not os.path.isdir(os.path.join("cache","node0"))
or not os.path.isdir(os.path.join("cache","node1"))
or not os.path.isdir(os.path.join("cache","node2"))
or not os.path.isdir(os.path.join("cache","node3"))):
#find and delete old cache directories if any exist
for i in range(4):
if os.path.isdir(os.path.join("cache","node"+str(i))):
shutil.rmtree(os.path.join("cache","node"+str(i)))
devnull = open(os.devnull, "w")
# Create cache directories, run bitcoinds:
for i in range(4):
datadir=initialize_datadir("cache", i)
@ -240,7 +249,7 @@ def start_node(i, dirname, extra_args=None, rpchost=None, timewait=None, binary=
])
if extra_args is not None: args.extend(extra_args)
bitcoind_processes[i] = subprocess.Popen(args)
devnull = open(os.devnull, "w+")
devnull = open(os.devnull, "w")
if os.getenv("PYTHON_DEBUG", ""):
print("start_node: bitcoind started, calling bitcoin-cli -rpcwait getblockcount")
subprocess.check_call([ os.getenv("BITCOINCLI", "bitcoin-cli"), "-datadir="+datadir] +