From 091710e028505f39acf484293161100045ff17d5 Mon Sep 17 00:00:00 2001 From: "Jesse N. Glick" Date: Fri, 31 Jul 2009 19:28:49 +0000 Subject: [PATCH] Depending on exactly how you run 'ant test', its classpath could contain different things; legitimate for ${ant.core.lib} to be a classes dir. (Would be better if the main build script actually ensured that it was testing the classes just compiled and controlled the test CP; unless you do e.g. 'CLASSPATH=lib/optional/junit-3.8.2.jar ./bootstrap.sh test' it does not seem to work, because '/usr/bin/ant test' actually runs tests against /usr/lib/ant.jar etc. Quite a mess.) git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@799711 13f79535-47bb-0310-9956-ffa450edef68 --- .../junit/org/apache/tools/ant/taskdefs/AntTest.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/AntTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/AntTest.java index 8d418aca0..d24d59742 100644 --- a/src/tests/junit/org/apache/tools/ant/taskdefs/AntTest.java +++ b/src/tests/junit/org/apache/tools/ant/taskdefs/AntTest.java @@ -313,7 +313,13 @@ public class AntTest extends BuildFileTest { public void testAntCoreLib() { // Cf. #42263 - expectLogContaining("sub-show-ant.core.lib", "ant.jar"); + executeTarget("sub-show-ant.core.lib"); + String realLog = getLog(); + assertTrue("found ant.core.lib in: " + realLog, + // String.matches would be simpler... can we assume JDK 1.4+ yet? + realLog.indexOf("ant.jar") != -1 || + realLog.indexOf("build/classes") != 1 || + realLog.indexOf("build\\classes") != -1); } private class BasedirChecker implements BuildListener {