Mercurial > hg > truffle
changeset 15327:25633b639fd7
mx: support simple filename globbing in whitelist
author | Bernhard Urban <bernhard.urban@jku.at> |
---|---|
date | Wed, 23 Apr 2014 14:59:05 +0200 |
parents | 6e1d5f3e4615 |
children | d89ed48ae349 |
files | mx/mx_graal.py test/whitelist_baseline.txt |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mx/mx_graal.py Wed Apr 23 14:44:24 2014 +0200 +++ b/mx/mx_graal.py Wed Apr 23 14:59:05 2014 +0200 @@ -35,6 +35,7 @@ import sanitycheck import itertools import json, textwrap +import fnmatch, re # This works because when mx loads this file, it makes sure __file__ gets an absolute path _graal_home = dirname(dirname(__file__)) @@ -861,7 +862,7 @@ projectscp = mx.classpath(projs) if whitelist: - classes = list(set(classes) & set(whitelist)) + classes = [c for c in classes if any([glob.match(c) for glob in whitelist])] if len(classes) != 0: f_testfile = open(testfile, 'w') @@ -966,7 +967,7 @@ if parsed_args.whitelist: try: with open(join(_graal_home, parsed_args.whitelist)) as fp: - whitelist = [l.rstrip() for l in fp.readlines() if not l.startswith('#')] + whitelist = [re.compile(fnmatch.translate(l.rstrip())) for l in fp.readlines() if not l.startswith('#')] except IOError: mx.log('warning: could not read whitelist: ' + parsed_args.whitelist)