Author: rhs
Date: Mon May 28 12:28:02 2012
New Revision: 1343225

URL: http://svn.apache.org/viewvc?rev=1343225&view=rev
Log:
test harness for proton

Added:
    qpid/proton/trunk/tests/
    qpid/proton/trunk/tests/proton-test
      - copied, changed from r1300276, qpid/trunk/qpid/python/qpid-python-test

Copied: qpid/proton/trunk/tests/proton-test (from r1300276, 
qpid/trunk/qpid/python/qpid-python-test)
URL: 
http://svn.apache.org/viewvc/qpid/proton/trunk/tests/proton-test?p2=qpid/proton/trunk/tests/proton-test&p1=qpid/trunk/qpid/python/qpid-python-test&r1=1300276&r2=1343225&rev=1343225&view=diff
==============================================================================
--- qpid/trunk/qpid/python/qpid-python-test (original)
+++ qpid/proton/trunk/tests/proton-test Mon May 28 12:28:02 2012
@@ -25,8 +25,6 @@ from fnmatch import fnmatchcase as match
 from getopt import GetoptError
 from logging import getLogger, StreamHandler, Formatter, Filter, \
     WARN, DEBUG, ERROR
-from qpid.harness import Skipped
-from qpid.util import URL
 
 levels = {
   "DEBUG": DEBUG,
@@ -42,8 +40,6 @@ parser = optparse.OptionParser(usage="us
                                description="Run tests matching the specified 
PATTERNs.")
 parser.add_option("-l", "--list", action="store_true", default=False,
                   help="list tests instead of executing them")
-parser.add_option("-b", "--broker", default="localhost",
-                  help="run tests against BROKER (default %default)")
 parser.add_option("-f", "--log-file", metavar="FILE", help="log output to 
FILE")
 parser.add_option("-v", "--log-level", metavar="LEVEL", default="WARN",
                   help="only display log messages of LEVEL or higher severity: 
"
@@ -70,7 +66,6 @@ parser.add_option("-x", "--xml", metavar
 class Config:
 
   def __init__(self):
-    self.broker = URL("localhost")
     self.defines = {}
     self.log_file = None
     self.log_level = WARN
@@ -82,7 +77,6 @@ includes = []
 excludes = ["*__*__"]
 config = Config()
 list_only = opts.list
-config.broker = URL(opts.broker)
 for d in opts.defines:
   try:
     idx = d.index("=")
@@ -111,7 +105,7 @@ if not includes:
   if opts.modules:
     includes.append("*")
   else:
-    includes.extend(["qpid.tests.*"])
+    includes.extend(["proton.tests.*"])
 
 def is_ignored(path):
   for p in excludes:
@@ -311,7 +305,7 @@ handler.setFormatter(Formatter("%(asctim
 root.addHandler(handler)
 root.setLevel(WARN)
 
-log = getLogger("qpid.test")
+log = getLogger("proton.test")
 
 PASS = "pass"
 SKIP = "skip"
@@ -342,8 +336,7 @@ class Runner:
       raise
     except:
       exi = sys.exc_info()
-      if issubclass(exi[0], Skipped):
-        self.skip = True
+      self.skip = getattr(exi[0], "skipped", False)
       self.exceptions.append((name, exi))
 
   def status(self):
@@ -358,7 +351,7 @@ class Runner:
 
   def get_formatted_exceptions(self):
     for name, info in self.exceptions:
-      if issubclass(info[0], Skipped):
+      if getattr(info[0], "skipped", False):
         output = 
indent("".join(traceback.format_exception_only(*info[:2]))).rstrip()
       else:
         output = "Error during %s:" % name
@@ -557,7 +550,7 @@ class Harness:
 
 modules = opts.modules
 if not modules:
-  modules.extend(["qpid.tests"])
+  modules.extend(["proton.tests"])
 h = Harness()
 for name in modules:
   m = __import__(name, None, None, ["dummy"])



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to