]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Follow test sequence from run-tests.py command line
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 27 Nov 2014 17:48:41 +0000 (19:48 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 27 Nov 2014 17:48:41 +0000 (19:48 +0200)
It can be useful to specify an exact order of test cases and also to
allow the same test case to be run multiple times when the list of tests
is provided on the command line.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/run-tests.py

index 239ec9693ff0a733fa0a3774abad4afda13779bb..1d07462509cc127d3cbe92b8e1be03a467946c63 100755 (executable)
@@ -239,15 +239,19 @@ def main():
                args.testmodules.append(line)
 
     tests_to_run = []
-    for t in tests:
-        name = t.__name__.replace('test_', '', 1)
-        if args.tests:
-            if not name in args.tests:
-                continue
-        if args.testmodules:
-            if not t.__module__.replace('test_', '', 1) in args.testmodules:
-                continue
-        tests_to_run.append(t)
+    if args.tests:
+        for selected in args.tests:
+            for t in tests:
+                name = t.__name__.replace('test_', '', 1)
+                if name == selected:
+                    tests_to_run.append(t)
+    else:
+        for t in tests:
+            name = t.__name__.replace('test_', '', 1)
+            if args.testmodules:
+                if not t.__module__.replace('test_', '', 1) in args.testmodules:
+                    continue
+            tests_to_run.append(t)
 
     if args.update_tests_db:
         for t in tests_to_run: