tests: fix handling tests list from cmdline
Previous approach didn't worked for dynamically generated tests.
This commit is contained in:
parent
01e208d5ec
commit
c6f136869e
@ -303,8 +303,11 @@ def main():
|
|||||||
loader = unittest.TestLoader()
|
loader = unittest.TestLoader()
|
||||||
|
|
||||||
if args.names:
|
if args.names:
|
||||||
suite.addTests(loader.loadTestsFromNames(
|
alltests = loader.loadTestsFromName('qubes.tests')
|
||||||
('qubes.tests.' + name.replace('/', '.') for name in args.names)))
|
for name in args.names:
|
||||||
|
suite.addTests(
|
||||||
|
[test for test in list_test_cases(alltests)
|
||||||
|
if (str(test)+'/').startswith(name.replace('.', '/')+'/')])
|
||||||
else:
|
else:
|
||||||
suite.addTests(loader.loadTestsFromName('qubes.tests'))
|
suite.addTests(loader.loadTestsFromName('qubes.tests'))
|
||||||
|
|
||||||
|
@ -564,5 +564,4 @@ def load_tests(loader, tests, pattern):
|
|||||||
(TC_20_DispVMMixin, qubes.tests.QubesTestCase),
|
(TC_20_DispVMMixin, qubes.tests.QubesTestCase),
|
||||||
{'template': template})))
|
{'template': template})))
|
||||||
|
|
||||||
tests.addTests(loader.loadTestsFromTestCase(TC_10_HVM))
|
|
||||||
return tests
|
return tests
|
Loading…
Reference in New Issue
Block a user