From 3d87faff5e792acf34e90548074916acf409aeea Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 3 May 2017 08:37:14 +0200 Subject: [PATCH] Merge #10307: [tests] allow zmq test to be run in out-of-tree builds b8251f6 [tests] allow zmq test to be run in out-of-tree builds (John Newbery) Tree-SHA512: 6946d23bc8a0b57e841a6811989182732d0534989e0e3b94421387f7971379b25a25d238cad22272e04076293275f6e980c8a713fce87ba48c1c4463d9243051 --- test/functional/test_framework/test_framework.py | 2 ++ test/functional/test_runner.py | 5 ++++- test/functional/zmq_test.py | 6 ++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py index 1ee4366474..648e790a02 100755 --- a/test/functional/test_framework/test_framework.py +++ b/test/functional/test_framework/test_framework.py @@ -130,6 +130,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 6bcdd629e1..ce6831d890 100755 --- a/test/functional/test_runner.py +++ b/test/functional/test_runner.py @@ -192,7 +192,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 43861c767b..fe7d7aa87d 100755 --- a/test/functional/zmq_test.py +++ b/test/functional/zmq_test.py @@ -27,9 +27,11 @@ class ZMQTest (BitcoinTestFramework): self.log.warning("python3-zmq module not available. Skipping zmq tests!") sys.exit(self.TEST_EXIT_SKIPPED) - # Check that bitcoin has been built with ZMQ enabled + # Check that dash 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("dashd has not been built with zmq enabled. Skipping zmq tests!")