comparison mx/mx_graal.py @ 16394:0dd27c6472d7

mx: remove entries from unittest class path that are in graal.jar when running with a Graal enabled VM
author Doug Simon <doug.simon@oracle.com>
date Thu, 03 Jul 2014 14:31:34 +0200
parents 380290b81eb0
children ad431bf0de07
comparison
equal deleted inserted replaced
16393:380290b81eb0 16394:0dd27c6472d7
1048 prefixArgs = ['-XX:-BootstrapGraal', '-esa', '-ea'] 1048 prefixArgs = ['-XX:-BootstrapGraal', '-esa', '-ea']
1049 if gc_after_test: 1049 if gc_after_test:
1050 prefixArgs.append('-XX:-DisableExplicitGC') 1050 prefixArgs.append('-XX:-DisableExplicitGC')
1051 with open(testfile) as fp: 1051 with open(testfile) as fp:
1052 testclasses = [l.rstrip() for l in fp.readlines()] 1052 testclasses = [l.rstrip() for l in fp.readlines()]
1053
1054 # Remove entries from class path that are in graal.jar
1055 cp = prefixCp + coreCp + os.pathsep + projectsCp
1056 if isGraalEnabled(_get_vm()):
1057 graalDist = mx.distribution('GRAAL')
1058 graalJarCp = set([d.output_dir() for d in graalDist.sorted_deps()])
1059 cp = os.pathsep.join([e for e in cp.split(os.pathsep) if e not in graalJarCp])
1060
1053 if len(testclasses) == 1: 1061 if len(testclasses) == 1:
1054 # Execute Junit directly when one test is being run. This simplifies 1062 # Execute Junit directly when one test is being run. This simplifies
1055 # replaying the VM execution in a native debugger (e.g., gdb). 1063 # replaying the VM execution in a native debugger (e.g., gdb).
1056 vm(prefixArgs + vmArgs + ['-cp', prefixCp + coreCp + ':' + projectsCp, 'com.oracle.graal.test.GraalJUnitCore'] + coreArgs + testclasses) 1064 vm(prefixArgs + vmArgs + ['-cp', cp, 'com.oracle.graal.test.GraalJUnitCore'] + coreArgs + testclasses)
1057 else: 1065 else:
1058 vm(prefixArgs + vmArgs + ['-cp', prefixCp + coreCp + ':' + projectsCp + os.pathsep + mxdir, name] + [testfile] + coreArgs) 1066 vm(prefixArgs + vmArgs + ['-cp', cp + os.pathsep + mxdir, name] + [testfile] + coreArgs)
1059 1067
1060 try: 1068 try:
1061 _run_tests(args, harness, annotations, testfile, whitelist, regex) 1069 _run_tests(args, harness, annotations, testfile, whitelist, regex)
1062 finally: 1070 finally:
1063 if os.environ.get('MX_TESTFILE') is None: 1071 if os.environ.get('MX_TESTFILE') is None: