Browse Source

Merge pull request #6548

060058e Enable python tests for Native Windows (ptschip)
0.13
Wladimir J. van der Laan 9 years ago
parent
commit
10c0e52b68
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 2
      Makefile.am
  2. 2
      qa/pull-tester/rpc-tests.sh
  3. 13
      qa/pull-tester/run-bitcoin-cli
  4. 15
      qa/rpc-tests/test_framework/util.py

2
Makefile.am

@ -204,7 +204,7 @@ endif @@ -204,7 +204,7 @@ endif
dist_noinst_SCRIPTS = autogen.sh
EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/rpc-tests.sh qa/pull-tester/run-bitcoin-cli qa/rpc-tests $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING)
EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/rpc-tests.sh qa/rpc-tests $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING)
CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER)

2
qa/pull-tester/rpc-tests.sh

@ -5,8 +5,8 @@ CURDIR=$(cd $(dirname "$0"); pwd) @@ -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

13
qa/pull-tester/run-bitcoin-cli

@ -1,13 +0,0 @@ @@ -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//'

15
qa/rpc-tests/test_framework/util.py

@ -78,8 +78,17 @@ def initialize_chain(test_dir): @@ -78,8 +78,17 @@ def initialize_chain(test_dir):
bitcoind and bitcoin-cli must be in search path.
"""
if not os.path.isdir(os.path.join("cache", "node0")):
devnull = open("/dev/null", "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)
@ -171,7 +180,7 @@ def start_node(i, dirname, extra_args=None, rpchost=None, timewait=None, binary= @@ -171,7 +180,7 @@ def start_node(i, dirname, extra_args=None, rpchost=None, timewait=None, binary=
args = [ binary, "-datadir="+datadir, "-keypool=1", "-discover=0", "-rest" ]
if extra_args is not None: args.extend(extra_args)
bitcoind_processes[i] = subprocess.Popen(args)
devnull = open("/dev/null", "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] +

Loading…
Cancel
Save