# HG changeset patch # User Doug Simon # Date 1375805444 -7200 # Node ID bd0e589a9a65f798c3b7ee7e34f327d36e7ce51a # Parent 422b0e9b9aedb43416ae97a6761524ce3a829f09 avoid use of JUnitWrapper when exactly one test is being executed diff -r 422b0e9b9aed -r bd0e589a9a65 mx/commands.py --- a/mx/commands.py Tue Aug 06 16:13:05 2013 +0200 +++ b/mx/commands.py Tue Aug 06 18:10:44 2013 +0200 @@ -763,7 +763,14 @@ prefixArgs = ['-esa', '-ea'] else: prefixArgs = ['-XX:-BootstrapGraal', '-esa', '-ea'] - vm(prefixArgs + vmArgs + ['-cp', projectscp + os.pathsep + mxdir, name] + [testfile]) + with open(testfile) as fp: + testclasses = [l.rstrip() for l in fp.readlines()] + 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) + else: + vm(prefixArgs + vmArgs + ['-cp', projectscp + os.pathsep + mxdir, name] + [testfile]) try: _run_tests(args, harness, annotations, testfile)