From: Jouni Malinen Date: Thu, 27 Nov 2014 17:48:41 +0000 (+0200) Subject: tests: Follow test sequence from run-tests.py command line X-Git-Tag: hostap_2_4~1012 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=499c5e9dc6761311ddddd87365469b12195de89f;p=thirdparty%2Fhostap.git tests: Follow test sequence from run-tests.py command line 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 --- diff --git a/tests/hwsim/run-tests.py b/tests/hwsim/run-tests.py index 239ec9693..1d0746250 100755 --- a/tests/hwsim/run-tests.py +++ b/tests/hwsim/run-tests.py @@ -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: