Merge "Fail when no test case selected"

This commit is contained in:
Jenkins 2017-07-28 14:58:53 +00:00 committed by Gerrit Code Review
commit f59d90adfd
2 changed files with 7 additions and 0 deletions

View File

@ -256,6 +256,10 @@ def _call_testr_with_list(opts, test_list, others):
print("\n".join(test_list))
return 0
if not test_list:
print("No testcase selected to run")
return 8
ec = call_testr(None, opts.subunit, opts.pretty, opts.list,
opts.slowest, opts.parallel, opts.concurrency,
opts.until_failure, opts.color, test_list, others)

View File

@ -102,3 +102,6 @@ class TestReturnCodes(base.TestCase):
def test_list(self):
self.assertRunExit('ostestr --list', 0)
def test_no_test(self):
self.assertRunExit('ostestr --regex a --black-regex a', 8)