From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11304 invoked by alias); 22 Jun 2006 20:05:54 -0000 Received: (qmail 11290 invoked by uid 22791); 22 Jun 2006 20:05:53 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 22 Jun 2006 20:05:50 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k5MK5mrj032406 for ; Thu, 22 Jun 2006 16:05:48 -0400 Received: from pobox.toronto.redhat.com (pobox.toronto.redhat.com [172.16.14.4]) by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k5MK5l6v025270 for ; Thu, 22 Jun 2006 16:05:48 -0400 Received: from tony.toronto.redhat.com (tony.toronto.redhat.com [172.16.14.158]) by pobox.toronto.redhat.com (8.12.8/8.12.8) with ESMTP id k5MK5lve023945 for ; Thu, 22 Jun 2006 16:05:47 -0400 Subject: Harness fix From: Anthony Balkissoon To: mauve-patches@sources.redhat.com Content-Type: multipart/mixed; boundary="=-NYXXyOXbDqm4QRBY33t0" Date: Thu, 22 Jun 2006 20:05:00 -0000 Message-Id: <1151006747.25174.93.camel@tony.toronto.redhat.com> Mime-Version: 1.0 X-Mailer: Evolution 2.6.0 (2.6.0-1) X-IsSubscribed: yes Mailing-List: contact mauve-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: mauve-patches-owner@sourceware.org X-SW-Source: 2006/txt/msg00458.txt.bz2 --=-NYXXyOXbDqm4QRBY33t0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 974 This patch allows the Harness to display info that tests sent to their error stream (via System.err.pritnln or Throwable.printStackTrace or something similar). It also stops the timeout watcher for the startup process and passes vmargs when autodetecting the bootclasspath for the compiler. The commit also included the README because I forgot to check it in with the update I made yesterday (that patch was sent to this list). 2006-06-22 Anthony Balkissoon * Harness.java: (runner_in_err): New field. (getBootClassPath): Use the vmArgs when forking the detector. (finalize): Close the pipe to the RunnerProcess' error stream. (initProcess): Set up the pipe to the RunnerProcess' error stream. Stop the watcher after confirming startup. (runTest): Collect error stream output from the RunnerProcess in a StringBuffer and print it when there's no new regular output from the test. Also print it after the test has completed. --Tony --=-NYXXyOXbDqm4QRBY33t0 Content-Disposition: attachment; filename=AcceptRunnerErrorStream.diff Content-Type: text/x-patch; name=AcceptRunnerErrorStream.diff; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-length: 3508 Index: Harness.java =================================================================== RCS file: /cvs/mauve/mauve/Harness.java,v retrieving revision 1.12 diff -u -r1.12 Harness.java --- Harness.java 21 Jun 2006 20:17:55 -0000 1.12 +++ Harness.java 22 Jun 2006 20:01:51 -0000 @@ -128,6 +128,9 @@ // A way to listen to the runner process private static BufferedReader runner_in = null; + + // A way to listen to the runner process' standard error stream + private static BufferedReader runner_in_err = null; // The process that will run the tests for us private static Process runnerProcess = null; @@ -393,7 +396,6 @@ throw e; } } - // Set up the compiler and the PrintWriters for the compile errors. ecjConstructor = klass.getConstructor @@ -405,7 +407,6 @@ ecjWriterErr = new CompilerErrorWriter(System.out); ecjWriterOut = new PrintWriter(System.out); - // Set up the compiler options now that we know whether or not we are // compiling. compileStringBase += getClasspathInstallString(); @@ -477,7 +478,7 @@ { try { - String c = vmCommand + " Harness$DetectBootclasspath"; + String c = vmCommand + vmArgs + " Harness$DetectBootclasspath"; Process p = Runtime.getRuntime().exec(c); BufferedReader br = new BufferedReader @@ -622,6 +623,7 @@ { runTest("_dump_data_"); runner_in.close(); + runner_in_err.close(); runner_out.close(); runnerProcess.destroy(); } @@ -652,7 +654,10 @@ runner_out = new PrintWriter(runnerProcess.getOutputStream(), true); runner_in = new BufferedReader - (new InputStreamReader(runnerProcess.getInputStream())); + (new InputStreamReader(runnerProcess.getInputStream())); + runner_in_err = + new BufferedReader + (new InputStreamReader(runnerProcess.getErrorStream())); } catch (IOException e) { @@ -667,6 +672,7 @@ // to time out. runner_watcher = new TimeoutWatcher(runner_timeout); runTest("_confirm_startup_"); + runner_watcher.stop(); runner_watcher = new TimeoutWatcher(runner_timeout); } @@ -756,6 +762,7 @@ { String tn = stripPrefix(testName.replace(File.separatorChar, '.')); String outputFromTest; + StringBuffer sb = new StringBuffer(); boolean invalidTest = false; int temp = -1; @@ -788,6 +795,7 @@ try { runner_in.close(); + runner_in_err.close(); runner_out.close(); runnerProcess.destroy(); } @@ -801,6 +809,8 @@ } try { + if (runner_in_err.ready()) + sb.append(runner_in_err.readLine() + "\n"); if (runner_in.ready()) { outputFromTest = runner_in.readLine(); @@ -845,11 +855,17 @@ // pass these on to stdout. System.out.println(outputFromTest); } + else + { + System.err.print(sb.toString()); + sb = new StringBuffer(); + } } catch (IOException e) { } } + System.err.print(sb.toString()); if (temp == -1) { // This means the watcher thread had to stop the process --=-NYXXyOXbDqm4QRBY33t0--