Mercurial > hg > graal-jvmci-8
comparison mx/mx_graal.py @ 15657:50740bac9679
mx unittest: simplify argument passing.
author | Josef Eisl <josef.eisl@jku.at> |
---|---|
date | Wed, 14 May 2014 20:43:43 +0200 |
parents | fcf6e5683082 |
children | dffc37fa7157 |
comparison
equal
deleted
inserted
replaced
15656:fcf6e5683082 | 15657:50740bac9679 |
---|---|
1070 parsed_args = parser.parse_args(ut_args) | 1070 parsed_args = parser.parse_args(ut_args) |
1071 else: | 1071 else: |
1072 # parse all know arguments | 1072 # parse all know arguments |
1073 parsed_args, args = parser.parse_known_args(ut_args) | 1073 parsed_args, args = parser.parse_known_args(ut_args) |
1074 | 1074 |
1075 whitelist = None | |
1076 if parsed_args.whitelist: | 1075 if parsed_args.whitelist: |
1077 try: | 1076 try: |
1078 with open(join(_graal_home, parsed_args.whitelist)) as fp: | 1077 with open(join(_graal_home, parsed_args.whitelist)) as fp: |
1079 whitelist = [re.compile(fnmatch.translate(l.rstrip())) for l in fp.readlines() if not l.startswith('#')] | 1078 parsed_args.whitelist = [re.compile(fnmatch.translate(l.rstrip())) for l in fp.readlines() if not l.startswith('#')] |
1080 except IOError: | 1079 except IOError: |
1081 mx.log('warning: could not read whitelist: ' + parsed_args.whitelist) | 1080 mx.log('warning: could not read whitelist: ' + parsed_args.whitelist) |
1082 | 1081 |
1083 _unittest(args, ['@Test', '@Parameters'], whitelist=whitelist, verbose=parsed_args.verbose, enable_timing=parsed_args.enable_timing, regex=parsed_args.regex, color=parsed_args.color, eager_stacktrace=parsed_args.eager_stacktrace) | 1082 _unittest(args, ['@Test', '@Parameters'], **parsed_args.__dict__) |
1084 | 1083 |
1085 def shortunittest(args): | 1084 def shortunittest(args): |
1086 """alias for 'unittest --whitelist test/whitelist_shortunittest.txt'{0}""" | 1085 """alias for 'unittest --whitelist test/whitelist_shortunittest.txt'{0}""" |
1087 | 1086 |
1088 args = ['--whitelist', 'test/whitelist_shortunittest.txt'] + args | 1087 args = ['--whitelist', 'test/whitelist_shortunittest.txt'] + args |