This is the mail archive of the mauve-patches@sourceware.org mailing list for the Mauve project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: new Harness with compilation capabilities (FIX inline)


> > On Tue, 2006-04-25 at 13:20 +0100, Gary Benson wrote:
> > > Anthony Balkissoon wrote:
> > > > This new version of the Harness has auto-compilation capabilities
> > > > and also fixes a lot of bugs and performance issues that were
> > > > present in the last one.
> > > 
> > > This looks really nice, but I can't get it to run.  I've applied the
> > > attached patch to make it build with 1.4 and I'm doing:
> > > 
> > >   ./configure --enable-auto-compile \
> > >       --with-classpath-install-dir=/home/users/gary/work/classpath/install \
> > >       --with-vm=jamvm
> > > 
> > > I then do:
> > > 
> > >   CLASSPATH=`pwd` make
> > > 
> > > (For some reason it doesn't find config.java without the extra bit).
> > > When I go to run some tests ecj is being invoked with -bootclasspath
> > > /home/users/gary/work/classpath/install/share/classpath and that
> > > directory contains the following:
> > > 
> > >   examples/  glibj.zip  README  tools/  tools.zip
> > > 
> > > Am I building Classpath in some wierd way?
> > > 
> > > Cheers,
> > > Gary
> > 
> 

Okay, the fix for this is committed, and I committed Gary's
1.4-compliant patch along with it, thank you Gary.

2006-04-24  Anthony Balkissoon  <abalkiss@redhat.com>

	* Harness.java:
	(setupCompiler): Changed ecjWriterOut and ecjWriterErr to use 1.4 
	PrintWriter constructors.
	(getClasspathInstallString): Add "glibj.zip" onto the end of the 
	bootclasspath, if that file is present.
	(initProcess): Use StringBuffer instead of StringBuilder, so it 
	compiles on older compilers.
	(compileFolder): Likewise.
	(runFolder): Likewise.
	* RunnerProcess.java:
	(runTest): Replaced String.contains() with String.indexOf() so it 
	compiles on older compilers.
	(exceptionDetails): Replaced StringBuilder with StringBuffer so it
	compiles on older compilers.

--Tony
? Test.java
Index: Harness.java
===================================================================
RCS file: /cvs/mauve/mauve/Harness.java,v
retrieving revision 1.2
diff -u -r1.2 Harness.java
--- Harness.java	24 Apr 2006 19:42:02 -0000	1.2
+++ Harness.java	25 Apr 2006 16:12:51 -0000
@@ -28,6 +28,7 @@
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
 import java.io.FileReader;
 import java.io.IOException;
 import java.io.InputStreamReader;
@@ -384,8 +385,8 @@
       klass.getMethod
       ("compile", new Class[] 
           { String.class, PrintWriter.class, PrintWriter.class });    
-    ecjWriterOut = new PrintWriter(".ecjOut");
-    ecjWriterErr = new PrintWriter(".ecjErr");
+    ecjWriterOut = new PrintWriter(new FileOutputStream(".ecjOut"));
+    ecjWriterErr = new PrintWriter(new FileOutputStream(".ecjErr"));
     
     
     // Set up the compiler options now that we know whether or not we are
@@ -436,7 +437,11 @@
     temp = " -bootclasspath " + temp;
     if (!temp.endsWith(File.separator))
       temp += File.separator;
-    temp += "share/classpath";
+    temp += "share" + File.separator + "classpath";
+    
+    File f = new File (temp.substring(16) + File.separator + "glibj.zip");
+    if (f.exists())
+      temp += File.separator + "glibj.zip";
     return temp;
   }
 
@@ -553,7 +558,7 @@
    */
   private static void initProcess(String[] args)
   {    
-    StringBuilder sb = new StringBuilder(" RunnerProcess");
+    StringBuffer sb = new StringBuffer(" RunnerProcess");
     for (int i = 0; i < args.length; i++)      
       sb.append(" " + args[i]);      
     sb.insert(0, vmCommand);
@@ -836,7 +841,7 @@
     File dir = new File(folderName);
     String dirPath = dir.getPath();    
     File[] files = dir.listFiles();
-    StringBuilder sb = new StringBuilder();
+    StringBuffer sb = new StringBuffer();
     String fullPath = null;
     boolean compilepassed = true;
     
@@ -888,7 +893,7 @@
     runFolder(sb, compilepassed);
   }
   
-  private static boolean compileFolder(StringBuilder sb, String folderName)
+  private static boolean compileFolder(StringBuffer sb, String folderName)
   {
     int result = - 1;
     int compileFailsInFolder = 0;
@@ -1024,7 +1029,7 @@
    * @param compilepassed true if the compilation step happened and all 
    * tests passed or if compilation didn't happen (because of -nocompile).
    */
-  private static void runFolder(StringBuilder sb, boolean compilepassed)
+  private static void runFolder(StringBuffer sb, boolean compilepassed)
   {
     StringTokenizer st = new StringTokenizer(sb.toString());
     String nextTest = null;
Index: RunnerProcess.java
===================================================================
RCS file: /cvs/mauve/mauve/RunnerProcess.java,v
retrieving revision 1.2
diff -u -r1.2 RunnerProcess.java
--- RunnerProcess.java	24 Apr 2006 19:42:02 -0000	1.2
+++ RunnerProcess.java	25 Apr 2006 16:12:51 -0000
@@ -215,7 +215,7 @@
           // we have to check through the file.
           while (firstLine != null)
             {
-              if (firstLine.contains("not-a-test"))
+              if (firstLine.indexOf("not-a-test") != -1)
                   {
                     description = NOT_A_TEST_DESCRIPTION;
                     return;
@@ -691,10 +691,10 @@
       }
     
     // sb holds all the information we wish to return.
-    StringBuilder sb = 
-      new StringBuilder("  " + (verbose ? "FAIL: " : "")+ "line " + lineOrigin 
-                        + ": " + (last_check == null ? "" : last_check) +
-                        " [" + (count + 1) + "] -- uncaught exception:");
+    StringBuffer sb = 
+      new StringBuffer("  " + (verbose ? "FAIL: " : "")+ "line " + lineOrigin 
+		       + ": " + (last_check == null ? "" : last_check) +
+		       " [" + (count + 1) + "] -- uncaught exception:");
     
     // If a full stack trace will be printed, this method returns no details.
     if (exceptions)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]