public inbox for mauve-patches@sourceware.org
 help / color / mirror / Atom feed
* Harness patch - do not try to compile dependencies if given '-compile no'
@ 2006-09-12 14:53 Edwin Steiner
  0 siblings, 0 replies; only message in thread
From: Edwin Steiner @ 2006-09-12 14:53 UTC (permalink / raw)
  To: mauve-patches

[-- Attachment #1: Type: text/plain, Size: 377 bytes --]

Hi!

I ran into a problem when using Harness with '-compile no': If there is
a "Uses:" line in a testlet, Harness tries to compile the dependency
unconditionally. (This fails in my case as there is no working compiler
on the system.)

The attached patch modifies compileTest so it only checks if the .class
file is available if auto-compilation is turned off.

Cheers,
-Edwin


[-- Attachment #2: DIFF --]
[-- Type: text/plain, Size: 815 bytes --]

Index: Harness.java
===================================================================
RCS file: /cvs/mauve/mauve/Harness.java,v
retrieving revision 1.25
diff -u -p -r1.25 Harness.java
--- Harness.java	16 Aug 2006 19:00:18 -0000	1.25
+++ Harness.java	12 Sep 2006 14:47:25 -0000
@@ -1224,8 +1224,19 @@ public class Harness
     // it as a test failure.
     try
       {
-        compileString = compileStringBase + " " + testName;
-        result = compile();
+      	if (compileTests)
+	  {
+	    compileString = compileStringBase + " " + testName;
+	    result = compile();
+	  }
+	else
+	  {
+	    String classfilename = testName.replaceAll("\\.java$", ".class");
+	    File classfile = new File(classfilename);
+
+	    if (classfile.exists())
+	      return 0;
+	  }
       }
     catch (Exception e)
       {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-09-12 14:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-12 14:53 Harness patch - do not try to compile dependencies if given '-compile no' Edwin Steiner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).