tests: Make run-tests.py command argument parser more flexible
This allow -e, -r, and -f arguments to be given in any order. Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
3b7475d365
commit
d85bb75d47
1 changed files with 12 additions and 11 deletions
|
@ -48,17 +48,18 @@ def main():
|
|||
else:
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
|
||||
if len(sys.argv) > idx + 1 and sys.argv[idx] == '-e':
|
||||
error_file = sys.argv[idx + 1]
|
||||
idx = idx + 2
|
||||
|
||||
if len(sys.argv) > idx + 1 and sys.argv[idx] == '-r':
|
||||
results_file = sys.argv[idx + 1]
|
||||
idx = idx + 2
|
||||
|
||||
if len(sys.argv) > idx + 1 and sys.argv[idx] == '-f':
|
||||
test_file = sys.argv[idx + 1]
|
||||
idx = idx + 2
|
||||
while len(sys.argv) > idx:
|
||||
if len(sys.argv) > idx + 1 and sys.argv[idx] == '-e':
|
||||
error_file = sys.argv[idx + 1]
|
||||
idx = idx + 2
|
||||
elif len(sys.argv) > idx + 1 and sys.argv[idx] == '-r':
|
||||
results_file = sys.argv[idx + 1]
|
||||
idx = idx + 2
|
||||
elif len(sys.argv) > idx + 1 and sys.argv[idx] == '-f':
|
||||
test_file = sys.argv[idx + 1]
|
||||
idx = idx + 2
|
||||
else:
|
||||
break
|
||||
|
||||
if len(sys.argv) > idx:
|
||||
test_filter = sys.argv[idx]
|
||||
|
|
Loading…
Reference in a new issue