Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add test target to build.xml #240

Merged
merged 4 commits into from

2 participants

@kcooney
Collaborator

No description provided.

@kcooney
Collaborator

I recommend passing --no-ff when to "git merge"

build.xml
@@ -187,6 +187,12 @@
</sequential>
</macrodef>
+ <target name="test" depends="build">
+ <run-tests>
+ <jvmarg value="-Dignore.this=ignored" />
+ </run-tests>
+ </target>
+
<target name="dist" depends="populate-dist">
@dsaff Owner
dsaff added a note

Can you make "dist" depend on "test", then, to remove duplication? Thanks.

@kcooney Collaborator
kcooney added a note

I want "test" to be fast, so I want it to run the tests without doing a clean or building the jars. I had to clean it up a bit to get it to work (I think I originally tested it by doing a "dist" first).

If you are comfortable with "dist" and "profile" not using the built jars, then I can share the code.

@kcooney Collaborator
kcooney added a note

The other option would be to always use the jars when running the tests; jar'ing the classes is reasonably fast. I just don't want to clean or build javadoc just to run the tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@dsaff
Owner

This works for me. Thanks.

@dsaff
Owner

Can you please add a line to acknowledgements.txt? Thanks.

@kcooney
Collaborator

Don't worry about it (you did half the work, if you remember)

@dsaff
Owner

Usually, I'm a stickler for acknowledgements.txt, which doubles as thanks to the many contributors, and also a record that survives past source-control changes of contributors for licensing/legal reasons. However, since you're already well on the hook, no need.

@dsaff dsaff merged commit 8ddf4be into junit-team:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 16, 2011
  1. @kcooney

    Add test target to build.xml

    kcooney authored
Commits on Jun 1, 2011
  1. @kcooney

    Merge branch 'head-kent-beck' into fix-build-xml

    kcooney authored
    Conflicts:
    	build.xml
  2. @kcooney

    Add "test" target to build.xml

    kcooney authored
Commits on Jun 6, 2011
  1. @kcooney
This page is out of date. Refresh to see the latest.
Showing with 27 additions and 6 deletions.
  1. +27 −6 build.xml
View
33 build.xml
@@ -173,7 +173,8 @@
<copy file="build.xml" tofile="${dist}/build.xml" />
</target>
- <macrodef name="run-tests">
+ <macrodef name="run-dist-tests">
+ <!-- Runs the tests against the built jar files -->
<element name="extra-args" implicit="yes" />
<sequential>
<java classname="org.junit.runner.JUnitCore" fork="yes" failonerror="true">
@@ -187,16 +188,36 @@
</sequential>
</macrodef>
- <target name="dist" depends="populate-dist">
- <run-tests>
+ <macrodef name="run-local-tests">
+ <!-- Runs the tests against the local class files -->
+ <sequential>
+ <java classname="org.junit.runner.JUnitCore" fork="yes" failonerror="true">
+ <arg value="org.junit.tests.AllTests"/>
+ <classpath>
+ <pathelement location="${bin}" />
+ <pathelement location="${testbin}" />
+ <pathelement location="${hamcrestlib}" />
+ </classpath>
+ </java>
+ </sequential>
+ </macrodef>
+
+ <target name="test" depends="build">
+ <run-local-tests />
+ </target>
+
+ <target name="test-jars" depends="populate-dist">
+ <run-dist-tests>
<jvmarg value="-Dignore.this=ignored" />
- </run-tests>
+ </run-dist-tests>
</target>
+ <target name="dist" depends="test-jars" />
+
<target name="profile" depends="populate-dist">
- <run-tests>
+ <run-dist-tests>
<jvmarg value="-agentlib:hprof=cpu=samples"/>
- </run-tests>
+ </run-dist-tests>
</target>
<target name="zip" depends="dist">
Something went wrong with that request. Please try again.