From bbf9bbc999ab2d804899d1115a1fb620433c679d Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Wed, 8 Dec 2021 19:49:42 -0800 Subject: [PATCH] make argv handling more flexible --- src/soc/simple/test/test_issuer.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/soc/simple/test/test_issuer.py b/src/soc/simple/test/test_issuer.py index 11c16339..5d22ca09 100644 --- a/src/soc/simple/test/test_issuer.py +++ b/src/soc/simple/test/test_issuer.py @@ -36,7 +36,7 @@ from openpower.simulator.test_helloworld_sim import HelloTestCases if __name__ == "__main__": svp64 = True - if sys.argv[1] == 'nosvp64': + if len(sys.argv) > 1 and sys.argv[1] == 'nosvp64': svp64 = False del sys.argv[1] @@ -47,8 +47,10 @@ if __name__ == "__main__": del sys.argv[1] # allow list of testing to be selected by command-line - testing = sys.argv[1:] - sys.argv = sys.argv[:1] + testing = [] + for i in reversed(range(1, len(sys.argv))): + if not sys.argv[i].startswith('-'): + testing.append(sys.argv.pop(i)) if not testing: testing = ['general', 'ldst', 'cr', 'shiftrot', 'shiftrot2', -- 2.30.2