diff options
Diffstat (limited to 'poky/meta/lib/oeqa/selftest/context.py')
-rw-r--r-- | poky/meta/lib/oeqa/selftest/context.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/poky/meta/lib/oeqa/selftest/context.py b/poky/meta/lib/oeqa/selftest/context.py index d279994ddf..3126ada716 100644 --- a/poky/meta/lib/oeqa/selftest/context.py +++ b/poky/meta/lib/oeqa/selftest/context.py @@ -77,7 +77,14 @@ class OESelftestTestContextExecutor(OETestContextExecutor): parser.add_argument('--machine', required=False, choices=['random', 'all'], help='Run tests on different machines (random/all).') - + + parser.add_argument('-t', '--select-tags', dest="select_tags", + nargs='*', default=None, + help='Filter all (unhidden) tests to any that match any of the specified tags.') + parser.add_argument('-T', '--exclude-tags', dest="exclude_tags", + nargs='*', default=None, + help='Exclude all (unhidden) tests that match any of the specified tags. (exclude applies before select)') + parser.set_defaults(func=self.run) def _get_available_machines(self): @@ -149,6 +156,18 @@ class OESelftestTestContextExecutor(OETestContextExecutor): copyfile(self.tc_kwargs['init']['config_paths']['bblayers'], self.tc_kwargs['init']['config_paths']['bblayers_backup']) + def tag_filter(tags): + if args.exclude_tags: + if any(tag in args.exclude_tags for tag in tags): + return True + if args.select_tags: + if not tags or not any(tag in args.select_tags for tag in tags): + return True + return False + + if args.select_tags or args.exclude_tags: + self.tc_kwargs['load']['tags_filter'] = tag_filter + self.tc_kwargs['run']['skips'] = args.skips self.tc_kwargs['run']['processes'] = args.processes |