comparison mx/commands.py @ 7389:d7c1266a26c7

Merge.
author Christian Haeubl <haeubl@ssw.jku.at>
date Mon, 07 Jan 2013 08:39:06 +0100
parents 57edf6b07d36
children dd903cdfe708
comparison
equal deleted inserted replaced
7388:599ea4fcdb6d 7389:d7c1266a26c7
394 stdin = p.stdin 394 stdin = p.stdin
395 if logFile: 395 if logFile:
396 log = open(logFile, 'w') 396 log = open(logFile, 'w')
397 ret = False 397 ret = False
398 while True: 398 while True:
399 line = stdout.readline().decode(sys.stdout.encoding) 399
400 # encoding may be None on windows plattforms
401 if sys.stdout.encoding is None:
402 encoding = 'utf-8'
403 else:
404 encoding = sys.stdout.encoding
405
406 line = stdout.readline().decode(encoding)
400 if logFile: 407 if logFile:
401 log.write(line.encode('utf-8')) 408 log.write(line.encode('utf-8'))
402 line = line.strip() 409 line = line.strip()
403 mx.log(line) 410 mx.log(line)
404 if line == STARTTOKEN: 411 if line == STARTTOKEN:
688 If filters are supplied, only tests whose fully qualified name 695 If filters are supplied, only tests whose fully qualified name
689 include a filter as a substring are run. Negative filters are 696 include a filter as a substring are run. Negative filters are
690 those with a '-' prefix. VM args should have a @ prefix.""" 697 those with a '-' prefix. VM args should have a @ prefix."""
691 698
692 def harness(p, vmArgs, classes): 699 def harness(p, vmArgs, classes):
693 prefixArgs = ['-XX:-BootstrapGraal', '-esa'] 700 prefixArgs = ['-XX:-BootstrapGraal', '-esa', '-ea']
694 if p.name.endswith('.jtt'):
695 prefixArgs = prefixArgs + [
696 '-XX:CompileOnly=com/oracle/graal/jtt',
697 '-XX:CompileCommand=compileonly,java/lang/Object::<init>',
698 '-XX:CompileCommand=quiet',
699 '-Xcomp']
700 vm(prefixArgs + vmArgs + ['-cp', mx.classpath(p.name), 'org.junit.runner.JUnitCore'] + classes) 701 vm(prefixArgs + vmArgs + ['-cp', mx.classpath(p.name), 'org.junit.runner.JUnitCore'] + classes)
701 _run_tests(args, harness) 702 _run_tests(args, harness)
702 703
703 def buildvms(args): 704 def buildvms(args):
704 """build one or more VMs in various configurations""" 705 """build one or more VMs in various configurations"""
797 vm(['-esa', '-version']) 798 vm(['-esa', '-version'])
798 tasks.append(t.stop()) 799 tasks.append(t.stop())
799 800
800 _vmbuild = 'product' 801 _vmbuild = 'product'
801 t = Task('UnitTests:product') 802 t = Task('UnitTests:product')
802 unittest(['@-XX:CompileCommand=exclude,*::run*']) 803 unittest([])
803 tasks.append(t.stop()) 804 tasks.append(t.stop())
804 805
805 for vmbuild in ['fastdebug', 'product']: 806 for vmbuild in ['fastdebug', 'product']:
806 for test in sanitycheck.getDacapos(level=sanitycheck.SanityCheckLevel.Gate, gateBuildLevel=vmbuild): 807 for test in sanitycheck.getDacapos(level=sanitycheck.SanityCheckLevel.Gate, gateBuildLevel=vmbuild):
807 t = Task(str(test) + ':' + vmbuild) 808 t = Task(str(test) + ':' + vmbuild)
1072 out = args[0] 1073 out = args[0]
1073 elif len(args) > 1: 1074 elif len(args) > 1:
1074 mx.abort('jacocoreport takes only one argument : an output directory') 1075 mx.abort('jacocoreport takes only one argument : an output directory')
1075 mx.run_java(['-jar', jacocoreport.get_path(True), '-in', 'jacoco.exec', '-g', join(_graal_home, 'graal'), out]) 1076 mx.run_java(['-jar', jacocoreport.get_path(True), '-in', 'jacoco.exec', '-g', join(_graal_home, 'graal'), out])
1076 1077
1078 def jar(args):
1079 parser = ArgumentParser(prog='mx jar');
1080 parser.add_argument('projects', nargs=REMAINDER, metavar='projects...')
1081 args = parser.parse_args(args)
1082
1083 if not args.projects:
1084 mx.abort('Please specify at least one project to jar.')
1085
1086 for pname in args.projects:
1087 p = mx.project(pname, fatalIfMissing=True)
1088 outputDir = p.output_dir()
1089 targetJar = join(p.dir, p.name + '.jar')
1090 mx.jar(targetJar, [outputDir])
1091
1077 def site(args): 1092 def site(args):
1078 """create a website containing javadoc and the project dependency graph""" 1093 """create a website containing javadoc and the project dependency graph"""
1079 1094
1080 return mx.site(['--name', 'Graal', 1095 return mx.site(['--name', 'Graal',
1081 '--jd', '@-tag', '--jd', '@test:X', 1096 '--jd', '@-tag', '--jd', '@test:X',
1098 'igv' : [igv, ''], 1113 'igv' : [igv, ''],
1099 'jdkhome': [jdkhome, ''], 1114 'jdkhome': [jdkhome, ''],
1100 'dacapo': [dacapo, '[[n] benchmark] [VM options|@DaCapo options]'], 1115 'dacapo': [dacapo, '[[n] benchmark] [VM options|@DaCapo options]'],
1101 'scaladacapo': [scaladacapo, '[[n] benchmark] [VM options|@Scala DaCapo options]'], 1116 'scaladacapo': [scaladacapo, '[[n] benchmark] [VM options|@Scala DaCapo options]'],
1102 'specjvm2008': [specjvm2008, '[VM options|@specjvm2008 options]'], 1117 'specjvm2008': [specjvm2008, '[VM options|@specjvm2008 options]'],
1118 'jar': [jar, '[-options]'],
1103 #'example': [example, '[-v] example names...'], 1119 #'example': [example, '[-v] example names...'],
1104 'gate' : [gate, '[-options]'], 1120 'gate' : [gate, '[-options]'],
1105 'gv' : [gv, ''], 1121 'gv' : [gv, ''],
1106 'bench' : [bench, '[-resultfile file] [all(default)|dacapo|specjvm2008|bootstrap]'], 1122 'bench' : [bench, '[-resultfile file] [all(default)|dacapo|specjvm2008|bootstrap]'],
1107 'unittest' : [unittest, '[filters...]'], 1123 'unittest' : [unittest, '[filters...]'],