Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 35232 invoked from network); 8 Oct 2004 07:03:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 8 Oct 2004 07:03:41 -0000 Received: (qmail 58864 invoked by uid 500); 8 Oct 2004 07:03:19 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 58798 invoked by uid 500); 8 Oct 2004 07:03:18 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 58761 invoked by uid 99); 8 Oct 2004 07:03:18 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=DNS_FROM_RFC_ABUSE X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [206.190.39.182] (HELO web52905.mail.yahoo.com) (206.190.39.182) by apache.org (qpsmtpd/0.28) with SMTP; Fri, 08 Oct 2004 00:03:14 -0700 Message-ID: <20041008070311.21035.qmail@web52905.mail.yahoo.com> Received: from [212.95.183.130] by web52905.mail.yahoo.com via HTTP; Fri, 08 Oct 2004 00:03:11 PDT Date: Fri, 8 Oct 2004 00:03:11 -0700 (PDT) From: Ivan Ivanov Subject: Re: Build not failing when Junit tests fail To: Ant Users List In-Reply-To: <47E4425C970FC04391D25DEDE51F120E02AAB5BA@sf-exch1.edusoft.ad> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi Alison, I cannot tell you where your properties get confused along the three s (AFAIK antcall opens a whole new properties namespace so one should play with inherit attributes so that properties be visible in the new namespace), but here is a more concise way to do unit testing and then unit reporting: The above snippet allows you to run your junit tests and then create test reports and then if a test has failed the build process fails. HTH Ivan --- Alison Monteith wrote: > Hi, > > I'm pretty new to ant am trying to get our ant build > to fail when any > junit test fails. > > I've looked at our current build.xml and have found > the following (which > appears to be correct): > > target to run the tests contains: > > haltonfailure="false" > failureproperty="junit_test_failed"> > > later target contains: > > > > When I use the Ant -debug option the failureproperty > value is being set > to junit_test_failed as expected, but for some > reason the build being > reported as successful. If I take out the > if="junit_test_failed" > statement. ie. > just have: > then the build fails. > > I'm thinking that somehow the junit_test_failed > property is not visible > at the time of the tag. > > There are a lot of statements in my > build.xml, and it's in > one of these calls that the property is being set. > Why is this > junit_test_failed not visible when the tag is > being executed. > > Here's excepts from my build.xml, for more details: > > ------------------------------------------ > description="Runs all JUnit tests and cleans > (used for > cruisecontrol)"> > > > > > > --------------------------------------- > > ----------- > (snipped code) > ---------- > list="${rel.test.list}" /> > > > > ----------------------------------------- > > > ----------- > (snipped code) > ---------- > haltonfailure="false" > failureproperty="junit_test_failed"> > > > value="-Xrunjdwp:transport=dt_socket,server=y,suspend=n"/> > > > > > > > > > > > > > > > > --------------------------------------------- > > > > > > > > > > ---------------------------------------------- > > Any help would really be appreciated! > > Thanks, > > Alison > > > > > > > > > > _______________________________ Do you Yahoo!? Declare Yourself - Register online to vote today! http://vote.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org