Denis Bilenko avatar Denis Bilenko committed 2e9dfd1

run_autobahn_tests.py: allow passing test case at command line

Comments (0)

Files changed (1)

run_autobahn_tests.py

 spec = {
    "options": {"failByDrop": False},
    "enable-ssl": False,
-   "servers": [],
-   "cases": ["*"],
-   "exclude-cases": ["7.5.1",
-                     "7.9.3",
-                     "7.9.4",
-                     "7.9.5",
-                     "7.9.6",
-                     "7.9.7",
-                     "7.9.8",
-                     "7.9.9",
-                     "7.9.10",
-                     "7.9.11",
-                     "7.9.12",
-                     "7.9.13"]
-}
+   "servers": []}
+
+
+default_args = ["*",
+         "x7.5.1",
+         "x7.9.3",
+         "x7.9.4",
+         "x7.9.5",
+         "x7.9.6",
+         "x7.9.7",
+         "x7.9.8",
+         "x7.9.9",
+         "x7.9.10",
+         "x7.9.11",
+         "x7.9.12",
+         "x7.9.13"]
 # We ignore 7.5.1 because it checks that close frame has valid utf-8 message
 # we do not validate utf-8.
 
     parser.add_option('--geventwebsocket', default='examples/echoserver.py')
     parser.add_option('--autobahn', default='../../src/Autobahn/testsuite/websockets/servers/test_autobahn.py')
     options, args = parser.parse_args()
-    assert not args, args
+
+    cases = []
+    exclude_cases = []
+
+    for arg in (args or default_args):
+        if arg.startswith('x'):
+            arg = arg[1:]
+            exclude_cases.append(arg)
+        else:
+            cases.append(arg)
+
+    spec['cases'] = cases
+    spec['exclude-cases'] = exclude_cases
+
     if options.autobahn and not os.path.exists(options.autobahn):
         print 'Ignoring %s (not found)' % options.autobahn
         options.autobahn = None
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.