Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-1264

Incorrect reporting of errorful execution

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 1.0-JSR-5
    • 1.0-RC-1
    • Ant integration
    • None
    • Ubuntu 5.10 Breezy Badger ; JDK 1.5.0_06 ; Groovy CVS HEAD

    Description

      I have a small directory tree:
      .

      – Source
      – Tests
      `-- Factorial_Test.groovy
      – build.groovy
      `-- build.xml

      i.e. I have written the test but not the source of the project. The build.xml file looks like:

      <project name="BookTests.Factorial" default="test" basedir=".">

      <property name="buildDir" value="Build"/>
      <property name="sourceDir" value="Source"/>
      <property name="testsDir" value="Tests"/>

      <property name="groovyJar" value="${user.home}/lib/Java/groovy/groovy-all.jar"/>

      <path id="classpath">
      <pathelement location="${groovyJar}"/>
      </path>

      <taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpathref="classpath"/>
      <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc" classpathref="classpath"/>

      <target name="init">
      <mkdir dir="${buildDir}"/>
      </target>

      <target name="compile" depends="init">
      </target>

      <target name="compileTests" depends="compile">
      </target>

      <target name="test" depends="compileTests">
      <groovy src="${testsDir}/Factorial_Test.groovy"/>
      </target>

      <target name="clean">
      <delete dir="${buildDir}" quiet="true"/>
      <delete quiet="true">
      <fileset dir="." includes="*/~" defaultexcludes="no"/>
      </delete>
      </target>

      </project>

      The Tests/Factorial_Test.groovy file is the one from GROOVY_1263:

      #! /usr/bin/env groovy

      def factorial ( x )

      { 1 }

      class Factorial_Test extends GroovyTestCase {
      void test_zero ( )

      { assertEquals ( factorial ( 0 ) , 1 ) }

      }

      so execution is terminated with an error report. However when run via Ant:

      Buildfile: build.xml

      init:
      [mkdir] Created dir: /home/users/russel/Progs/Groovy/BookTests/Factorial/Build

      compile:

      compileTests:

      test:
      [groovy] statements executed successfully

      BUILD SUCCESSFUL
      Total time: 2 seconds

      which does not seem reasonable.

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            russel Dr. Russel Winder
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: