# HG changeset patch # User Chris Seaton # Date 1386944799 0 # Node ID 093353894575e6f88557d399b6f0b1cc2495d553 # Parent 30e57b49fdb13cae4e6ba1fb4d4068347d53e55c Test the Truffle JAR after building. diff -r 30e57b49fdb1 -r 093353894575 mx/mx_graal.py --- a/mx/mx_graal.py Fri Dec 13 13:54:13 2013 +0000 +++ b/mx/mx_graal.py Fri Dec 13 14:26:39 2013 +0000 @@ -808,7 +808,7 @@ f_testfile.close() harness(projectscp, vmArgs) -def _unittest(args, annotations): +def _unittest(args, annotations, prefixcp=""): mxdir = dirname(__file__) name = 'JUnitWrapper' javaSource = join(mxdir, name + '.java') @@ -830,9 +830,9 @@ if len(testclasses) == 1: # Execute Junit directly when one test is being run. This simplifies # replaying the VM execution in a native debugger (e.g., gdb). - vm(prefixArgs + vmArgs + ['-cp', projectscp, 'org.junit.runner.JUnitCore'] + testclasses) + vm(prefixArgs + vmArgs + ['-cp', prefixcp + projectscp, 'org.junit.runner.JUnitCore'] + testclasses) else: - vm(prefixArgs + vmArgs + ['-cp', projectscp + os.pathsep + mxdir, name] + [testfile]) + vm(prefixArgs + vmArgs + ['-cp', prefixcp + projectscp + os.pathsep + mxdir, name] + [testfile]) try: _run_tests(args, harness, annotations, testfile) @@ -1348,9 +1348,17 @@ def trufflejar(args=None): """make truffle.jar""" + + # Test with the built classes + _unittest(["com.oracle.truffle.api.test", "com.oracle.truffle.api.dsl.test"], ['@Test', '@LongTest', '@Parameters']) + # We use the DSL processor as the starting point for the classpath - this # therefore includes the DSL processor, the DSL and the API. packagejar(mx.classpath("com.oracle.truffle.dsl.processor").split(os.pathsep), "truffle.jar", None, "com.oracle.truffle.dsl.processor.TruffleProcessor") + + # Test with the JAR + _unittest(["com.oracle.truffle.api.test", "com.oracle.truffle.api.dsl.test"], ['@Test', '@LongTest', '@Parameters'], "truffle.jar:") + def isGraalEnabled(vm): return vm != 'original' and not vm.endswith('nograal')