Mercurial > hg > truffle
comparison mx/mx_graal.py @ 13712:190d29710e97
Merge.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 20 Jan 2014 18:25:17 +0100 |
parents | b688e7da4c69 |
children | 7c418666c6c9 |
comparison
equal
deleted
inserted
replaced
13711:193e3917dc07 | 13712:190d29710e97 |
---|---|
342 | 342 |
343 with open(releaseFile, 'w') as fp: | 343 with open(releaseFile, 'w') as fp: |
344 for line in releaseFileLines: | 344 for line in releaseFileLines: |
345 if line.startswith("SOURCE="): | 345 if line.startswith("SOURCE="): |
346 try: | 346 try: |
347 sourceLine = line[0:-2] # remove last char | 347 sourceLine = line[0:-2] # remove last char |
348 hgcfg = mx.HgConfig() | 348 hgcfg = mx.HgConfig() |
349 hgcfg.check() | 349 hgcfg.check() |
350 revision = hgcfg.tip('.')[:12] # take first 12 chars | 350 revision = hgcfg.tip('.')[:12] # take first 12 chars |
351 fp.write(sourceLine + ' graal:' + revision + '\"\n') | 351 fp.write(sourceLine + ' graal:' + revision + '\"\n') |
352 except: | 352 except: |
353 fp.write(line) | 353 fp.write(line) |
354 else: | 354 else: |
355 fp.write(line) | 355 fp.write(line) |
791 vmArgs, tests = _extract_VM_args(args) | 791 vmArgs, tests = _extract_VM_args(args) |
792 for t in tests: | 792 for t in tests: |
793 if t.startswith('-'): | 793 if t.startswith('-'): |
794 mx.abort('VM option ' + t + ' must precede ' + tests[0]) | 794 mx.abort('VM option ' + t + ' must precede ' + tests[0]) |
795 | 795 |
796 candidates = [] | 796 candidates = {} |
797 for p in mx.projects_opt_limit_to_suites(): | 797 for p in mx.projects_opt_limit_to_suites(): |
798 if mx.java().javaCompliance < p.javaCompliance: | 798 if mx.java().javaCompliance < p.javaCompliance: |
799 continue | 799 continue |
800 candidates += _find_classes_with_annotations(p, None, annotations).keys() | 800 for c in _find_classes_with_annotations(p, None, annotations).keys(): |
801 candidates[c] = p | |
801 | 802 |
802 classes = [] | 803 classes = [] |
803 if len(tests) == 0: | 804 if len(tests) == 0: |
804 classes = candidates | 805 classes = candidates.keys() |
806 projectscp = mx.classpath([pcp.name for pcp in mx.projects_opt_limit_to_suites() if pcp.javaCompliance <= mx.java().javaCompliance]) | |
805 else: | 807 else: |
808 projs = set() | |
806 for t in tests: | 809 for t in tests: |
807 found = False | 810 found = False |
808 for c in candidates: | 811 for c, p in candidates.iteritems(): |
809 if t in c: | 812 if t in c: |
810 found = True | 813 found = True |
811 classes.append(c) | 814 classes.append(c) |
815 projs.add(p.name) | |
812 if not found: | 816 if not found: |
813 mx.log('warning: no tests matched by substring "' + t) | 817 mx.log('warning: no tests matched by substring "' + t) |
814 | 818 projectscp = mx.classpath(projs) |
815 projectscp = mx.classpath([pcp.name for pcp in mx.projects_opt_limit_to_suites() if pcp.javaCompliance <= mx.java().javaCompliance]) | |
816 | 819 |
817 if len(classes) != 0: | 820 if len(classes) != 0: |
818 f_testfile = open(testfile, 'w') | 821 f_testfile = open(testfile, 'w') |
819 for c in classes: | 822 for c in classes: |
820 f_testfile.write(c + '\n') | 823 f_testfile.write(c + '\n') |
1502 })) | 1505 })) |
1503 | 1506 |
1504 # gather graal options | 1507 # gather graal options |
1505 output = StringIO.StringIO() | 1508 output = StringIO.StringIO() |
1506 vm(['-XX:-BootstrapGraal', '-G:+PrintFlags' if optionType == "graal" else '-XX:+PrintFlagsWithComments'], | 1509 vm(['-XX:-BootstrapGraal', '-G:+PrintFlags' if optionType == "graal" else '-XX:+PrintFlagsWithComments'], |
1507 vm = "graal", | 1510 vm="graal", |
1508 vmbuild = "optimized", | 1511 vmbuild="optimized", |
1509 nonZeroIsFatal = False, | 1512 nonZeroIsFatal=False, |
1510 out = output.write, | 1513 out=output.write, |
1511 err = subprocess.STDOUT) | 1514 err=subprocess.STDOUT) |
1512 | 1515 |
1513 valueMap = parser.parse(output.getvalue()) | 1516 valueMap = parser.parse(output.getvalue()) |
1514 return valueMap | 1517 return valueMap |
1515 | 1518 |
1516 | 1519 |