Commit 50c51ea3 authored by Mathieu Giraud's avatar Mathieu Giraud

src/should.py: --no-a, --no-f

parent 76b5aedc
Pipeline #614 passed with stages
in 12 seconds
......@@ -264,6 +264,8 @@ for p in (group, options):
group = parser.add_argument_group('selecting tests to be run')
group.add_argument('--shuffle', action='store_true', help='shuffle the tests')
group.add_argument('--no-a', action='store_true', help="do not launch 'a' tests")
group.add_argument('--no-f', action='store_true', help="do not launch 'f' tests")
group.add_argument('--only-a', action='store_true', help="launches only 'a' tests")
group.add_argument('--only-f', action='store_true', help="launches only 'f' tests")
......@@ -1120,10 +1122,12 @@ if __name__ == '__main__':
random.shuffle(args.file)
# Filters
only = None
if args.only_f or args.only_a:
only = lambda test: ((MOD_TODO in test.modifiers) >= args.only_f) and ((MOD_ALLOW in test.modifiers) >= args.only_a)
only = lambda test: (
((MOD_TODO in test.modifiers) <= (not args.no_f)) and
((MOD_TODO in test.modifiers) >= args.only_f) and
((MOD_ALLOW in test.modifiers) <= (not args.no_a)) and
((MOD_ALLOW in test.modifiers) >= args.only_a)
)
# Launch tests
fs = FileSet(args.file, timeout = args.timeout, modifiers=''.join(args.mod if args.mod else []))
status = fs.test(variables = variables, cd = args.cd, cd_same = args.cd_same, output = args.output, verbose = args.verbose, only = only)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment