Skip to content

Commit b8251f6

Browse files
committed
[tests] allow zmq test to be run in out-of-tree builds
1 parent e2b99b1 commit b8251f6

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
@@ -124,6 +124,8 @@ def main(self):
124124
help="The seed to use for assigning port numbers (default: current process id)")
125125
parser.add_option("--coveragedir", dest="coveragedir",
126126
help="Write tested RPC commands into this directory")
127+
parser.add_option("--configfile", dest="configfile",
128+
help="Location of the test framework config file")
127129
self.add_options(parser)
128130
(self.options, self.args) = parser.parse_args()
129131

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)