Skip to content

Commit 83073de

Browse files
committed
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
2 parents d4732f3 + b8251f6 commit 83073de

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

test/functional/test_framework/test_framework.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ def main(self):
115115
help="The seed to use for assigning port numbers (default: current process id)")
116116
parser.add_option("--coveragedir", dest="coveragedir",
117117
help="Write tested RPC commands into this directory")
118+
parser.add_option("--configfile", dest="configfile",
119+
help="Location of the test framework config file")
118120
self.add_options(parser)
119121
(self.options, self.args) = parser.parse_args()
120122

test/functional/test_runner.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,10 @@ def main():
178178

179179
# Read config generated by configure.
180180
config = configparser.ConfigParser()
181-
config.read_file(open(os.path.dirname(__file__) + "/config.ini"))
181+
configfile = os.path.abspath(os.path.dirname(__file__)) + "/config.ini"
182+
config.read_file(open(configfile))
183+
184+
passon_args.append("--configfile=%s" % configfile)
182185

183186
# Set up logging
184187
logging_level = logging.INFO if args.quiet else logging.DEBUG

test/functional/zmq_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ def setup_nodes(self):
2929

3030
# Check that bitcoin has been built with ZMQ enabled
3131
config = configparser.ConfigParser()
32-
config.read_file(open(os.path.dirname(__file__) + "/config.ini"))
32+
if not self.options.configfile:
33+
self.options.configfile = os.path.dirname(__file__) + "/config.ini"
34+
config.read_file(open(self.options.configfile))
3335

3436
if not config["components"].getboolean("ENABLE_ZMQ"):
3537
self.log.warning("bitcoind has not been built with zmq enabled. Skipping zmq tests!")

0 commit comments

Comments
 (0)