Mercurial > hg > truffle
changeset 18714:b56e88144e0a
prefer exact class matches when searching for unit tests with method name
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Wed, 17 Dec 2014 20:00:44 -0800 |
parents | cbb097347545 |
children | ba61e58aafbc |
files | mx/mx_graal.py |
diffstat | 1 files changed, 13 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mx/mx_graal.py Wed Dec 17 19:57:58 2014 -0800 +++ b/mx/mx_graal.py Wed Dec 17 20:00:44 2014 -0800 @@ -1123,12 +1123,23 @@ t, method = words for c, p in candidates.iteritems(): - if t in c: + # prefer exact matches first + if t == c: found = True - classes.append(c + '#' + method) + classes.append(c) projs.add(p.name) if not found: + for c, p in candidates.iteritems(): + if t in c: + found = True + classes.append(c) + projs.add(p.name) + if not found: mx.log('warning: no tests matched by substring "' + t) + elif len(classes) != 1: + mx.abort('More than one test matches substring {0} {1}'.format(t, classes)) + + classes = [c + "#" + method for c in classes] else: for t in tests: if '#' in t: