]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/selftest/context.py: For -t/-T use append argparse action
authorNathan Rossi <nathan@nathanrossi.com>
Tue, 10 Sep 2019 12:40:59 +0000 (12:40 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 11 Sep 2019 06:30:08 +0000 (07:30 +0100)
Use the 'append' action of argparse instead of nargs. This changes the
behaviour of the option from "-t foo bar -r" to "-t foo -t bar -r".

Additionally rename the long form options to be consistent with
behaviour, such that they specifying a single tag at a time.

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/selftest/context.py

index 3126ada716ee71d8005fbb576ed1043342d8d79d..c4eb5d614eba8281b29d68eeb520b92a2c0f58ea 100644 (file)
@@ -78,12 +78,12 @@ 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.add_argument('-t', '--select-tag', dest="select_tags",
+                action='append', default=None,
+                help='Filter all (unhidden) tests to any that match any of the specified tag(s).')
+        parser.add_argument('-T', '--exclude-tag', dest="exclude_tags",
+                action='append', default=None,
+                help='Exclude all (unhidden) tests that match any of the specified tag(s). (exclude applies before select)')
 
         parser.set_defaults(func=self.run)