Rune Halvorsen committed d475a2b

Added option for specifying test doc

Comments (0)

Files changed (1)

         Rule('/suite/<path:path>', endpoint='test_path', methods=('get',)),
-    def __init__(self, root, logclass):
+    def __init__(self, root, logclass, testdoc=None):
         self.root = os.path.abspath(root)
         self.runstate = None
         self.loggers = {}
         self.logclass = logclass
-        self.testpaths = self._scan_for_tests(root)
+        if testdoc:
+            self.testpaths = [testdoc]
+        else:
+            self.testpaths = self._scan_for_tests(root)
         # if testpaths is empty, raise something
     def __call__(self, environ, start_response):
 def build_app(root, options):
-    app = GlueonApp(root, SimplePrintLogger)
+    app = GlueonApp(root, SimplePrintLogger, testdoc=options.testdoc)
     app = SharedDataMiddleware(app, {'/suite': root},
                                cache=False, disallow="*.html")
     return app
                       default="foo", action="store",
                       help="Format of output")
-    parser.add_option("-t", "--testrunner", dest="testrunner",
+    parser.add_option("-t", "--testdoc", dest="testdoc",
                       default=None, action="store",
-                      help="The path to the testrunner html document. If none is given, try to autodetect it.")
+                      help="The path to the test runner html document. If none is given, try to autodetect it.")
     parser.add_option("-w", "--watchdog", dest="timeout",
                       default=None, action="store", type="float",