On 28/04/2008, Christian Thalinger <[EMAIL PROTECTED]> wrote:
> Hi!
>
> This patch disables the compilation of dependencies when using the
> -compile no option. When the dependency class does not exist it prints
> a FAIL message like:
>
> FAIL: java.lang.Character.unicode
> One of the dependencies is not compiled.
>
> We need this patch when we cross-compile Mauve for tgolem to be able to
> run it on low-performance architectures in a reasonable amount of time.
> OK to commit?
>
> - twisti
>
> ---
>
> Index: Harness.java
> ===================================================================
> RCS file: /cvs/mauve/mauve/Harness.java,v
> retrieving revision 1.29
> diff -u -3 -p -r1.29 Harness.java
> --- Harness.java 7 Apr 2007 20:14:27 -0000 1.29
> +++ Harness.java 28 Apr 2008 19:09:16 -0000
> @@ -1095,33 +1095,68 @@ public class Harness
> if (depend.endsWith(".class"))
> depend =
> depend.substring(0, depend.length() - 6);
> - if (! depend.endsWith(".java"))
> - depend += ".java";
>
> - if (compileTest(depend) != 0)
> + if (!compileTests)
> {
> - // One of the dependencies failed to
> compile,
> - // so we report the test as failing and
> don't
> - // try to run it.
> - String shortName = fullPath.substring(12,
> fullPath.length() - 5).
> - replace(File.separatorChar, '.');
> -
> - if (verbose)
> + File cf = new File(depend + ".class");
> + if (!cf.exists())
> {
> - System.out.println("TEST: " +
> shortName);
> - System.out.println(" FAIL: One of
> the " +
> - "dependencies failed to compile.");
> + // There is a dependency class
> + // missing, but the -compile no
> + // option was given so we just
> + // skip it
> + String shortName =
> fullPath.substring(12, fullPath.length() - 5).
> + replace(File.separatorChar, '.');
> +
> + if (verbose)
> + {
> + System.out.println("TEST: " +
> shortName);
> + System.out.println(" FAIL: One
> of the " +
> + "dependencies
> is not compiled.");
> + }
> + else
> + {
> + System.out.println("FAIL: " +
> shortName);
> + System.out.println(" One of the
> " +
> + "dependencies
> is not compiled.");
> + }
> + total_test_fails++;
> + total_tests++;
> + sb.setLength(sb.length() -
> fullPath.length() - 1);
> + count --;
> }
> - else
> + }
> + else
> + {
> + if (! depend.endsWith(".java"))
> + depend += ".java";
> +
> + if (compileTest(depend) != 0)
> {
> - System.out.println("FAIL: " +
> shortName);
> - System.out.println(" One of the " +
> - "dependencies failed to compile.");
> + // One of the dependencies
> + // failed to compile, so we
> + // report the test as failing
> + // and don't try to run it.
> + String shortName =
> fullPath.substring(12, fullPath.length() - 5).
> + replace(File.separatorChar, '.');
> +
> + if (verbose)
> + {
> + System.out.println("TEST: " +
> shortName);
> + System.out.println(" FAIL: One
> of the " +
> + "dependencies
> failed to compile.");
> + }
> + else
> + {
> + System.out.println("FAIL: " +
> shortName);
> + System.out.println(" One of the
> " +
> + "dependencies
> failed to compile.");
> + }
> + total_test_fails++;
> + total_tests++;
> + sb.setLength(sb.length() -
> fullPath.length() - 1);
> + count --;
> }
> - total_test_fails++;
> - total_tests++;
> - sb.setLength(sb.length() -
> fullPath.length() - 1);
> - count --;
> }
> }
> break;
>
>
>
>
Sounds like a sensible idea to me.
--
Andrew :-)
Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net
PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint: F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8