From c6f136869e0b3d5d9aff3a5886b9523863ee13c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 30 Mar 2015 01:40:39 +0200 Subject: [PATCH] tests: fix handling tests list from cmdline Previous approach didn't worked for dynamically generated tests. --- tests/run.py | 7 +++++-- tests/vm_qrexec_gui.py | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/run.py b/tests/run.py index 8c2dd6b8..d4064898 100755 --- a/tests/run.py +++ b/tests/run.py @@ -303,8 +303,11 @@ def main(): loader = unittest.TestLoader() if args.names: - suite.addTests(loader.loadTestsFromNames( - ('qubes.tests.' + name.replace('/', '.') for name in args.names))) + alltests = loader.loadTestsFromName('qubes.tests') + for name in args.names: + suite.addTests( + [test for test in list_test_cases(alltests) + if (str(test)+'/').startswith(name.replace('.', '/')+'/')]) else: suite.addTests(loader.loadTestsFromName('qubes.tests')) diff --git a/tests/vm_qrexec_gui.py b/tests/vm_qrexec_gui.py index 4db65893..4aa9ee1d 100644 --- a/tests/vm_qrexec_gui.py +++ b/tests/vm_qrexec_gui.py @@ -564,5 +564,4 @@ def load_tests(loader, tests, pattern): (TC_20_DispVMMixin, qubes.tests.QubesTestCase), {'template': template}))) - tests.addTests(loader.loadTestsFromTestCase(TC_10_HVM)) return tests \ No newline at end of file