This is the mail archive of the
mauve-patches@sourceware.org
mailing list for the Mauve project.
FYI: small fixlet for harness to allow gij testing
- From: Anthony Balkissoon <abalkiss at redhat dot com>
- To: mauve-patches at sources dot redhat dot com
- Date: Wed, 26 Apr 2006 15:51:14 -0400
- Subject: FYI: small fixlet for harness to allow gij testing
gij didn't like the "/" in "gnu/testlet/DetectBootclasspath" so I
changed it to ".". This patch also includes a bug fix where multiple
compile errors in one test were being counted as multiple tests and
multiple fails.
2006-04-26 Anthony Balkissoon <abalkiss@redhat.com>
* Harness.java:
(getBootClassPath): Changed "/" to "." in exec command so it works with
gij.
(compileFolder): Count multiple compile errors for the same test as
just one total test and one total fail, and print the FAIL header info
only once.
--Tony
Index: Harness.java
===================================================================
RCS file: /cvs/mauve/mauve/Harness.java,v
retrieving revision 1.5
diff -u -r1.5 Harness.java
--- Harness.java 26 Apr 2006 18:40:37 -0000 1.5
+++ Harness.java 26 Apr 2006 19:46:12 -0000
@@ -483,8 +483,7 @@
{
try
{
- String c = vmCommand + " gnu" + File.separator + "testlet"
- + File.separator + "DetectBootclasspath";
+ String c = vmCommand + " gnu.testlet.DetectBootclasspath";
Process p = Runtime.getRuntime().exec(c);
BufferedReader br =
new BufferedReader
@@ -1005,6 +1004,7 @@
new BufferedReader(new FileReader(".ecjErr"));
String lastFailingTest = null;
String temp;
+ String prev = null;
int loc;
// Go to the part in the file that relates to this folder
@@ -1038,36 +1038,42 @@
loc = temp.indexOf("gnu" + File.separatorChar + "testlet");
if (loc != - 1)
{
- String name = temp.substring(loc);
- String shortName =
- stripPrefix(name).replace(File.separatorChar, '.');
- if (shortName.endsWith(".java"))
- shortName = shortName.substring(0, shortName.length() - 5);
- if (verbose && lastFailingTest != null)
- System.out.println
- ("TEST FAILED: compilation failed " + lastFailingTest);
- lastFailingTest = shortName;
-
- if (verbose)
- System.out.println
- ("TEST: " + shortName + "\n FAIL: compilation failed.");
- else
- System.out.println("FAIL: " + shortName
- + ": compilation failed");
- if (!showCompilationErrors)
- System.out.println
- (" Read .ecjErr for details or run with " +
- "-showcompilefails");
-
- // When a test fails to compile, we count it as failing
- // but we do not run it.
compileFailsInFolder++;
- total_test_fails++;
- total_tests++;
- excludeTests.add(name);
+ String name = temp.substring(loc);
+ if (!name.equals(prev))
+ {
+ String shortName =
+ stripPrefix(name).replace(File.separatorChar, '.');
+ if (shortName.endsWith(".java"))
+ shortName =
+ shortName.substring(0, shortName.length() - 5);
+ if (verbose && lastFailingTest != null)
+ System.out.println
+ ("TEST FAILED: compilation failed " + lastFailingTest);
+ lastFailingTest = shortName;
+
+ if (verbose)
+ System.out.println
+ ("TEST: " + shortName + "\n FAIL: " +
+ "compilation failed.");
+ else
+ System.out.println("FAIL: " + shortName
+ + ": compilation failed");
+ if (!showCompilationErrors)
+ System.out.println
+ (" Read .ecjErr for details or don't run with" +
+ " -hidecompilefails");
+
+ // When a test fails to compile, we count it as failing
+ // but we do not run it.
+ total_test_fails++;
+ total_tests++;
+ excludeTests.add(name);
+ }
+ prev = name;
}
- // If -showcompilefails was used, print out the info. Do not
+ // Unless -hidecompilefails was used, print out the info. Do not
// print the compiler summer (e.g. '3 problems (3 errors)').
if (showCompilationErrors &&
temp.indexOf(problemsString(compileFailsInFolder)) == -1)
@@ -1178,7 +1184,7 @@
+ ": compilation failed");
if (!showCompilationErrors)
System.out.println
- (" Read .ecjErr for details or run with -showcompilefails");
+ (" Read .ecjErr for details or don't run with -hidecompilefails");
else
{
try