aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2017-05-01 15:12:49 -0400
committerJohn Newbery <john@johnnewbery.com>2017-05-01 15:12:49 -0400
commitb8251f63373ed58a05d104f9c1637d2c07b3569e (patch)
tree018248012b0999c9e86c23c6b34cad3c2da94531 /test
parente2b99b13131b5d0fd6fae6d55892c2ebb327d438 (diff)
[tests] allow zmq test to be run in out-of-tree builds
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/test_framework/test_framework.py2
-rwxr-xr-xtest/functional/test_runner.py5
-rwxr-xr-xtest/functional/zmq_test.py4
3 files changed, 9 insertions, 2 deletions
diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py
index 473b7c14a9..896b3aafcd 100755
--- a/test/functional/test_framework/test_framework.py
+++ b/test/functional/test_framework/test_framework.py
@@ -124,6 +124,8 @@ class BitcoinTestFramework(object):
help="The seed to use for assigning port numbers (default: current process id)")
parser.add_option("--coveragedir", dest="coveragedir",
help="Write tested RPC commands into this directory")
+ parser.add_option("--configfile", dest="configfile",
+ help="Location of the test framework config file")
self.add_options(parser)
(self.options, self.args) = parser.parse_args()
diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py
index 0996b1bc20..965fe9ad7f 100755
--- a/test/functional/test_runner.py
+++ b/test/functional/test_runner.py
@@ -178,7 +178,10 @@ def main():
# Read config generated by configure.
config = configparser.ConfigParser()
- config.read_file(open(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)
# Set up logging
logging_level = logging.INFO if args.quiet else logging.DEBUG
diff --git a/test/functional/zmq_test.py b/test/functional/zmq_test.py
index 891b609ffa..70a8e0180e 100755
--- a/test/functional/zmq_test.py
+++ b/test/functional/zmq_test.py
@@ -29,7 +29,9 @@ class ZMQTest (BitcoinTestFramework):
# Check that bitcoin has been built with ZMQ enabled
config = configparser.ConfigParser()
- config.read_file(open(os.path.dirname(__file__) + "/config.ini"))
+ if not self.options.configfile:
+ self.options.configfile = os.path.dirname(__file__) + "/config.ini"
+ config.read_file(open(self.options.configfile))
if not config["components"].getboolean("ENABLE_ZMQ"):
self.log.warning("bitcoind has not been built with zmq enabled. Skipping zmq tests!")