Browse Source

[tests] allow zmq test to be run in out-of-tree builds

pull/1/head
John Newbery 5 years ago
parent
commit
b8251f6337
  1. 2
      test/functional/test_framework/test_framework.py
  2. 5
      test/functional/test_runner.py
  3. 4
      test/functional/zmq_test.py

2
test/functional/test_framework/test_framework.py

@ -124,6 +124,8 @@ class BitcoinTestFramework(object): @@ -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()

5
test/functional/test_runner.py

@ -178,7 +178,10 @@ def main(): @@ -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

4
test/functional/zmq_test.py

@ -29,7 +29,9 @@ class ZMQTest (BitcoinTestFramework): @@ -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!")

Loading…
Cancel
Save