diff options
| -rwxr-xr-x | scripts/oe-selftest | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/oe-selftest b/scripts/oe-selftest index c32c419e19..e77768b292 100755 --- a/scripts/oe-selftest +++ b/scripts/oe-selftest | |||
| @@ -82,6 +82,8 @@ def get_args_parser(): | |||
| 82 | help='run-tests-by <name|class|module|id|tag> <list of tests|classes|modules|ids|tags>') | 82 | help='run-tests-by <name|class|module|id|tag> <list of tests|classes|modules|ids|tags>') |
| 83 | group.add_argument('--list-tests-by', required=False, dest='list_tests_by', default=False, nargs='*', | 83 | group.add_argument('--list-tests-by', required=False, dest='list_tests_by', default=False, nargs='*', |
| 84 | help='list-tests-by <name|class|module|id|tag> <list of tests|classes|modules|ids|tags>') | 84 | help='list-tests-by <name|class|module|id|tag> <list of tests|classes|modules|ids|tags>') |
| 85 | group.add_argument('--list-tests', required=False, action="store_true", dest="list_tests", default=False, | ||
| 86 | help='List all available tests.') | ||
| 85 | group.add_argument('--list-tags', required=False, dest='list_tags', default=False, action="store_true", | 87 | group.add_argument('--list-tags', required=False, dest='list_tags', default=False, action="store_true", |
| 86 | help='List all tags that have been set to test cases.') | 88 | help='List all tags that have been set to test cases.') |
| 87 | return parser | 89 | return parser |
| @@ -333,6 +335,22 @@ def list_testsuite_by(criteria, keyword): | |||
| 333 | print 'Total found:\t %s' % len(ts) | 335 | print 'Total found:\t %s' % len(ts) |
| 334 | 336 | ||
| 335 | 337 | ||
| 338 | def list_tests(): | ||
| 339 | # List all available oe-selftest tests | ||
| 340 | |||
| 341 | ts = get_all_tests() | ||
| 342 | |||
| 343 | print '%-4s\t%-20s\t%-60s\t%-25s\t%-20s' % ('id', 'tag', 'name', 'class', 'module') | ||
| 344 | print '_' * 150 | ||
| 345 | for t in ts: | ||
| 346 | if isinstance(t.tctag, (tuple, list)): | ||
| 347 | print '%-4s\t%-20s\t%-60s\t%-25s\t%-20s' % (t.tcid, ', '.join(t.tctag), t.tcname, t.tcclass, t.tcmodule) | ||
| 348 | else: | ||
| 349 | print '%-4s\t%-20s\t%-60s\t%-25s\t%-20s' % (t.tcid, t.tctag, t.tcname, t.tcclass, t.tcmodule) | ||
| 350 | print '_' * 150 | ||
| 351 | print 'Total found:\t %s' % len(ts) | ||
| 352 | |||
| 353 | |||
| 336 | def list_tags(): | 354 | def list_tags(): |
| 337 | # Get all tags set to test cases | 355 | # Get all tags set to test cases |
| 338 | # This is useful when setting tags to test cases | 356 | # This is useful when setting tags to test cases |
| @@ -429,6 +447,9 @@ def main(): | |||
| 429 | keyword = args.list_tests_by[1:] | 447 | keyword = args.list_tests_by[1:] |
| 430 | list_testsuite_by(criteria, keyword) | 448 | list_testsuite_by(criteria, keyword) |
| 431 | 449 | ||
| 450 | if args.list_tests: | ||
| 451 | list_tests() | ||
| 452 | |||
| 432 | if args.list_tags: | 453 | if args.list_tags: |
| 433 | list_tags() | 454 | list_tags() |
| 434 | 455 | ||
