Author: rhs Date: Tue Jun 2 22:19:07 2009 New Revision: 781187 URL: http://svn.apache.org/viewvc?rev=781187&view=rev Log: added defines to the test harness and made the delay used by the tests configurable
Modified: qpid/trunk/qpid/python/qpid-python-test qpid/trunk/qpid/python/qpid/tests/messaging.py Modified: qpid/trunk/qpid/python/qpid-python-test URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/python/qpid-python-test?rev=781187&r1=781186&r2=781187&view=diff ============================================================================== --- qpid/trunk/qpid/python/qpid-python-test (original) +++ qpid/trunk/qpid/python/qpid-python-test Tue Jun 2 22:19:07 2009 @@ -53,12 +53,14 @@ parser.add_option("-I", "--ignore-file", metavar="IFILE", action="append", default=[], help="ignore tests matching patterns in IFILE") +parser.add_option("-D", "--define", metavar="DEFINE", dest="defines", + action="append", default=[], help="define test parameters") class Config: def __init__(self): self.broker = URL("localhost") - self.work = None + self.defines = {} self.log_file = None self.log_level = WARN self.log_categories = [] @@ -70,6 +72,14 @@ config = Config() list_only = opts.list config.broker = URL(opts.broker) +for d in opts.defines: + try: + idx = d.index("=") + name = d[:idx] + value = d[idx+1:] + config.defines[name] = value + except ValueError: + config.defines[d] = None config.log_file = opts.log_file config.log_level = levels[opts.log_level.upper()] config.log_categories = opts.log_categories Modified: qpid/trunk/qpid/python/qpid/tests/messaging.py URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/python/qpid/tests/messaging.py?rev=781187&r1=781186&r2=781187&view=diff ============================================================================== --- qpid/trunk/qpid/python/qpid/tests/messaging.py (original) +++ qpid/trunk/qpid/python/qpid/tests/messaging.py Tue Jun 2 22:19:07 2009 @@ -70,7 +70,8 @@ return msgs def delay(self): - time.sleep(2) + d = float(self.config.defines.get("delay", "2")) + time.sleep(d) class SetupTests(Base): --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:commits-subscr...@qpid.apache.org