Mercurial > hg > truffle
changeset 21639:e65bf81961be
added -x option to gate command that makes --task-filter an exclusion filter
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 01 Jun 2015 17:20:51 +0200 |
parents | b6aadfd3dfbe |
children | 11f68b116a07 |
files | mx/mx_graal.py |
diffstat | 1 files changed, 12 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mx/mx_graal.py Mon Jun 01 16:10:50 2015 +0200 +++ b/mx/mx_graal.py Mon Jun 01 17:20:51 2015 +0200 @@ -1523,11 +1523,18 @@ # a non-None value from __enter__. The body of a 'with Task(...) as t' # statement should check 't' and exit immediately if it is None. filters = None + filtersExclude = False def __init__(self, title, tasks=None): self.tasks = tasks self.title = title - self.skipped = tasks is not None and Task.filters is not None and not any([f in title for f in Task.filters]) + if tasks is not None and Task.filters is not None: + if Task.filtersExclude: + self.skipped = any([f in title for f in Task.filters]) + else: + self.skipped = not any([f in title for f in Task.filters]) + else: + self.skipped = False if not self.skipped: self.start = time.time() self.end = None @@ -1710,6 +1717,7 @@ parser.add_argument('-i', '--omit-ide-clean', action='store_false', dest='cleanIde', help='omit cleaning the ide project files') parser.add_argument('-g', '--only-build-jvmci', action='store_false', dest='buildNonJVMCI', help='only build the JVMCI VM') parser.add_argument('-t', '--task-filter', help='comma separated list of substrings to select subset of tasks to be run') + parser.add_argument('-x', action='store_true', help='makes --task-filter an exclusion instead of inclusion filter') parser.add_argument('--jacocout', help='specify the output directory for jacoco report') args = parser.parse_args(args) @@ -1717,6 +1725,9 @@ global _jacoco if args.task_filter: Task.filters = args.task_filter.split(',') + Task.filtersExclude = args.x + elif args.x: + mx.abort('-x option cannot be used without --task-filter option') # Force if not mx._opts.strict_compliance: