]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Fix regression in START line total count
authorJouni Malinen <j@w1.fi>
Wed, 19 Nov 2014 20:02:08 +0000 (22:02 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 19 Nov 2014 20:02:08 +0000 (22:02 +0200)
The previous changes to enable stdin control broke the previous case of
showing the total number of test cases in the START lines. Fix that by
using a separate variable for the total number of test casess instead of
using length of the list of remaining test cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/run-tests.py

index 481b7858b2b4a6eb6d7e925c191fdb32112ab33c..239ec9693ff0a733fa0a3774abad4afda13779bb 100755 (executable)
@@ -344,8 +344,9 @@ def main():
     if args.stdin_ctrl:
         print "READY"
         sys.stdout.flush()
+        num_tests = 0
     else:
-        remaining_tests = tests_to_run
+        num_tests = len(tests_to_run)
     while True:
         if args.stdin_ctrl:
             test = sys.stdin.readline()
@@ -365,9 +366,9 @@ def main():
                 sys.stdout.flush()
                 continue
         else:
-            if len(remaining_tests) == 0:
+            if len(tests_to_run) == 0:
                 break
-            t = remaining_tests.pop(0)
+            t = tests_to_run.pop(0)
 
         name = t.__name__.replace('test_', '', 1)
         if log_handler:
@@ -382,7 +383,7 @@ def main():
         reset_ok = True
         with DataCollector(args.logdir, name, args.tracing, args.dmesg):
             count = count + 1
-            msg = "START {} {}/{}".format(name, count, len(tests_to_run))
+            msg = "START {} {}/{}".format(name, count, num_tests)
             logger.info(msg)
             if args.loglevel == logging.WARNING:
                 print msg