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:
|
else:
|
||||||
logging.basicConfig(level=logging.INFO)
|
logging.basicConfig(level=logging.INFO)
|
||||||
|
|
||||||
if len(sys.argv) > idx + 1 and sys.argv[idx] == '-e':
|
while len(sys.argv) > idx:
|
||||||
error_file = sys.argv[idx + 1]
|
if len(sys.argv) > idx + 1 and sys.argv[idx] == '-e':
|
||||||
idx = idx + 2
|
error_file = sys.argv[idx + 1]
|
||||||
|
idx = idx + 2
|
||||||
if len(sys.argv) > idx + 1 and sys.argv[idx] == '-r':
|
elif len(sys.argv) > idx + 1 and sys.argv[idx] == '-r':
|
||||||
results_file = sys.argv[idx + 1]
|
results_file = sys.argv[idx + 1]
|
||||||
idx = idx + 2
|
idx = idx + 2
|
||||||
|
elif len(sys.argv) > idx + 1 and sys.argv[idx] == '-f':
|
||||||
if len(sys.argv) > idx + 1 and sys.argv[idx] == '-f':
|
test_file = sys.argv[idx + 1]
|
||||||
test_file = sys.argv[idx + 1]
|
idx = idx + 2
|
||||||
idx = idx + 2
|
else:
|
||||||
|
break
|
||||||
|
|
||||||
if len(sys.argv) > idx:
|
if len(sys.argv) > idx:
|
||||||
test_filter = sys.argv[idx]
|
test_filter = sys.argv[idx]
|
||||||
|
|
Loading…
Reference in a new issue