mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 13:09:50 +00:00
oe-selftest: New option --list-tests
This option will list all available tests in a comprehensive manner. Fix for [YOCTO #8868] (From OE-Core rev: 8b9ea3ee39bceef7ee6faeef64f33bd9dbad2e4b) Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
17d886bef2
commit
32f332c9d4
@@ -82,6 +82,8 @@ def get_args_parser():
|
|||||||
help='run-tests-by <name|class|module|id|tag> <list of tests|classes|modules|ids|tags>')
|
help='run-tests-by <name|class|module|id|tag> <list of tests|classes|modules|ids|tags>')
|
||||||
group.add_argument('--list-tests-by', required=False, dest='list_tests_by', default=False, nargs='*',
|
group.add_argument('--list-tests-by', required=False, dest='list_tests_by', default=False, nargs='*',
|
||||||
help='list-tests-by <name|class|module|id|tag> <list of tests|classes|modules|ids|tags>')
|
help='list-tests-by <name|class|module|id|tag> <list of tests|classes|modules|ids|tags>')
|
||||||
|
group.add_argument('--list-tests', required=False, action="store_true", dest="list_tests", default=False,
|
||||||
|
help='List all available tests.')
|
||||||
group.add_argument('--list-tags', required=False, dest='list_tags', default=False, action="store_true",
|
group.add_argument('--list-tags', required=False, dest='list_tags', default=False, action="store_true",
|
||||||
help='List all tags that have been set to test cases.')
|
help='List all tags that have been set to test cases.')
|
||||||
return parser
|
return parser
|
||||||
@@ -333,6 +335,22 @@ def list_testsuite_by(criteria, keyword):
|
|||||||
print 'Total found:\t %s' % len(ts)
|
print 'Total found:\t %s' % len(ts)
|
||||||
|
|
||||||
|
|
||||||
|
def list_tests():
|
||||||
|
# List all available oe-selftest tests
|
||||||
|
|
||||||
|
ts = get_all_tests()
|
||||||
|
|
||||||
|
print '%-4s\t%-20s\t%-60s\t%-25s\t%-20s' % ('id', 'tag', 'name', 'class', 'module')
|
||||||
|
print '_' * 150
|
||||||
|
for t in ts:
|
||||||
|
if isinstance(t.tctag, (tuple, list)):
|
||||||
|
print '%-4s\t%-20s\t%-60s\t%-25s\t%-20s' % (t.tcid, ', '.join(t.tctag), t.tcname, t.tcclass, t.tcmodule)
|
||||||
|
else:
|
||||||
|
print '%-4s\t%-20s\t%-60s\t%-25s\t%-20s' % (t.tcid, t.tctag, t.tcname, t.tcclass, t.tcmodule)
|
||||||
|
print '_' * 150
|
||||||
|
print 'Total found:\t %s' % len(ts)
|
||||||
|
|
||||||
|
|
||||||
def list_tags():
|
def list_tags():
|
||||||
# Get all tags set to test cases
|
# Get all tags set to test cases
|
||||||
# This is useful when setting tags to test cases
|
# This is useful when setting tags to test cases
|
||||||
@@ -429,6 +447,9 @@ def main():
|
|||||||
keyword = args.list_tests_by[1:]
|
keyword = args.list_tests_by[1:]
|
||||||
list_testsuite_by(criteria, keyword)
|
list_testsuite_by(criteria, keyword)
|
||||||
|
|
||||||
|
if args.list_tests:
|
||||||
|
list_tests()
|
||||||
|
|
||||||
if args.list_tags:
|
if args.list_tags:
|
||||||
list_tags()
|
list_tags()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user