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]

Harness fix


This patch moves DetectBootclasspath from
gnu/testlet/DetectBootclasspath to an inner class of Harness which
indirectly fixes a problem found by Tom Fitzsimmons where
DetectBootclasspath wasn't being compiled by default, leading to
problems setting up the compiler.

2006-05-18  Anthony Balkissoon  <abalkiss@redhat.com>

	* Harness.java:
	(getBootClassPath): Changed location of DetectBootclasspath because it
	is now an inner class of Harness rather than a separate source file
	in gnu/testlet.
	(Harness.DetectBootclasspath): New inner class.
	* gnu/testlet/DetectBootclasspath.java: Removed this file.

--Tony
Index: Harness.java
===================================================================
RCS file: /cvs/mauve/mauve/Harness.java,v
retrieving revision 1.6
diff -u -r1.6 Harness.java
--- Harness.java	26 Apr 2006 19:49:31 -0000	1.6
+++ Harness.java	18 May 2006 20:00:30 -0000
@@ -389,8 +389,7 @@
       ("compile", new Class[] 
           { String.class, PrintWriter.class, PrintWriter.class });    
     ecjWriterOut = new PrintWriter(new FileOutputStream(".ecjOut"));
-    ecjWriterErr = new PrintWriter(new FileOutputStream(".ecjErr"));
-    
+    ecjWriterErr = new PrintWriter(new FileOutputStream(".ecjErr"));        
     
     // Set up the compiler options now that we know whether or not we are
     // compiling, and print a header to the compiler error file.
@@ -474,7 +473,7 @@
   }
   
   /**
-   * Forks a process to run gnu/testlet/DetectBootclasspath on the VM that is
+   * Forks a process to run DetectBootclasspath on the VM that is
    * being tested.  This program detects the bootclasspath so we can use
    * it for the compiler's bootclasspath.
    * @return the bootclasspath as found, or null if none could be found.
@@ -483,8 +482,8 @@
   {
     try
     {
-      String c = vmCommand + " gnu.testlet.DetectBootclasspath";
-      Process p = Runtime.getRuntime().exec(c);      
+      String c = vmCommand + " Harness$DetectBootclasspath";
+      Process p = Runtime.getRuntime().exec(c);
       BufferedReader br = 
         new BufferedReader
         (new InputStreamReader(p.getInputStream()));
@@ -1031,8 +1030,7 @@
               if (temp.indexOf("gnu" + File.separatorChar + "testlet") != - 1
                   && temp.indexOf(folderName) == - 1)
                 break;
-              
-              
+                            
               // Look for test names for failing tests, so we can exclude
               // them from the run.  
               loc = temp.indexOf("gnu" + File.separatorChar + "testlet");
@@ -1296,4 +1294,57 @@
         }
     }
   }
+  
+  /**
+   * This tiny class is used for finding the bootclasspath of the VM used
+   * to run the tests.
+   * @author Anthony Balkissoon abalkiss at redhat dot com
+   *
+   */
+  public static class DetectBootclasspath
+  {
+    /**
+     * Look in the system properties for the bootclasspath of the VM and return
+     * it to the process that forked this process via the System.out stream.
+     * 
+     * Tries first to get the property "sun.boot.class.path", if there is none,
+     * then it tries "java.boot.class.path", if there is still no match, looks
+     * to see if there is a unique property key that contains "boot.class.path".
+     * If this fails too, prints an error message.
+     */
+    public static void main (String[] args)
+    {
+      String result = "BCP_FINDER:";
+      // Sun's VM stores the bootclasspath as "sun.boot.class.path".
+      String temp = System.getProperty("sun.boot.class.path");
+      if (temp == null)
+        // JamVM stores it as "boot.class.path"
+        temp = System.getProperty("java.boot.class.path");
+      if (temp == null)
+        {        
+          String[] s = (String[])(System.getProperties().keySet().toArray());
+          int count = 0;
+          String key = null;
+          for (int i = 0; i < s.length; i++)
+            {
+              if (s[i].indexOf("boot.class.path") != -1)
+                {
+                  count ++;
+                  key = s[i];                
+                }
+            }
+          if (count == 1)
+            temp = System.getProperty(key);
+          else
+            {
+              System.out.println("WARNING: Cannot auto-detect the " +
+                      "bootclasspath for your VM, please file a bug report" +
+                      " specifying which VM you are testing.");
+              return;
+            }
+        }
+      System.out.println(result + temp);
+    }
+  }
+
 }
Index: gnu/testlet/DetectBootclasspath.java
===================================================================
RCS file: gnu/testlet/DetectBootclasspath.java
diff -N gnu/testlet/DetectBootclasspath.java
--- gnu/testlet/DetectBootclasspath.java	26 Apr 2006 18:11:11 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,54 +0,0 @@
-package gnu.testlet;
-
-
-/**
- * This tiny class is used for finding the bootclasspath of the VM used
- * to run the tests.
- * @author Anthony Balkissoon abalkiss at redhat dot com
- *
- */
-public class DetectBootclasspath
-{
-  /**
-   * Look in the system properties for the bootclasspath of the VM and return
-   * it to the process that forked this process via the System.out stream.
-   * 
-   * Tries first to get the property "sun.boot.class.path", if there is none,
-   * then it tries "java.boot.class.path", if there is still no match, looks
-   * to see if there is a unique property key that contains "boot.class.path".
-   * If this fails too, prints an error message.
-   */
-  public static void main (String[] args)
-  {
-    String result = "BCP_FINDER:";
-    // Sun's VM stores the bootclasspath as "sun.boot.class.path".
-    String temp = System.getProperty("sun.boot.class.path");
-    if (temp == null)
-      // JamVM stores it as "boot.class.path"
-      temp = System.getProperty("java.boot.class.path");
-    if (temp == null)
-      {        
-        String[] s = (String[])(System.getProperties().keySet().toArray());
-        int count = 0;
-        String key = null;
-        for (int i = 0; i < s.length; i++)
-          {
-            if (s[i].indexOf("boot.class.path") != -1)
-              {
-                count ++;
-                key = s[i];                
-              }
-          }
-        if (count == 1)
-          temp = System.getProperty(key);
-        else
-          {
-            System.out.println("WARNING: Cannot auto-detect the " +
-                    "bootclasspath for your VM, please file a bug report" +
-                    " specifying which VM you are testing.");
-            return;
-          }
-      }
-    System.out.println(result + temp);
-  }
-}

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