| 1 |
<?xml version="1.0"?> |
|---|
| 2 |
|
|---|
| 3 |
<project name="Propel Tests" default="phpunit" basedir="."> |
|---|
| 4 |
|
|---|
| 5 |
<!-- |
|---|
| 6 |
========================================================================================= |
|---|
| 7 |
Global Properties |
|---|
| 8 |
~~~~~~~~~~~~~~~~~ |
|---|
| 9 |
|
|---|
| 10 |
========================================================================================= |
|---|
| 11 |
--> |
|---|
| 12 |
<property name="tests.dir" value="./tests"/> |
|---|
| 13 |
<property name="tests.phpunit.dir" value="."/> |
|---|
| 14 |
<property name="tests.reports.dir" value="${tests.phpunit.dir}/reports"/> |
|---|
| 15 |
<property file="./test.properties" /> |
|---|
| 16 |
|
|---|
| 17 |
<!-- |
|---|
| 18 |
========================================================================================= |
|---|
| 19 |
PHPUnit2 Targets |
|---|
| 20 |
~~~~~~~~~~~~~~~~ |
|---|
| 21 |
|
|---|
| 22 |
========================================================================================= |
|---|
| 23 |
--> |
|---|
| 24 |
|
|---|
| 25 |
<property name="test.class" value="${test}"/> |
|---|
| 26 |
|
|---|
| 27 |
<resolvepath propertyName="tests.dir.resolved" file="${tests.phpunit.dir}"/> |
|---|
| 28 |
<resolvepath propertyName="tests.classes.dir.resolved" file="${tests.phpunit.dir}/classes"/> |
|---|
| 29 |
<resolvepath propertyName="propel-generator.classes.dir.resolved" file="../classes"/> |
|---|
| 30 |
<resolvepath propertyName="propel-runtime.classes.dir.resolved" file="../../runtime/classes"/> |
|---|
| 31 |
<resolvepath propertyName="bookstore.classes.dir.resolved" file="../projects/bookstore/build/classes"/> |
|---|
| 32 |
<resolvepath propertyName="bookstore.conf.dir.resolved" file="../projects/bookstore/build/conf"/> |
|---|
| 33 |
|
|---|
| 34 |
<path id="incthis"> |
|---|
| 35 |
<pathelement dir="${tests.dir.resolved}"/> |
|---|
| 36 |
<pathelement dir="${tests.classes.dir.resolved}"/> |
|---|
| 37 |
<pathelement dir="${propel-generator.classes.dir.resolved}"/> |
|---|
| 38 |
<pathelement dir="${propel-runtime.classes.dir.resolved}"/> |
|---|
| 39 |
<pathelement dir="${bookstore.classes.dir.resolved}"/> |
|---|
| 40 |
<pathelement dir="${bookstore.conf.dir.resolved}"/> |
|---|
| 41 |
</path> |
|---|
| 42 |
|
|---|
| 43 |
<target name="configure"> |
|---|
| 44 |
<echo>-------------------------------------------------</echo> |
|---|
| 45 |
<echo> +++++ Running Propel unit tests</echo> |
|---|
| 46 |
<echo>-------------------------------------------------</echo> |
|---|
| 47 |
<adhoc><![CDATA[ |
|---|
| 48 |
require_once 'propel/Propel.php'; |
|---|
| 49 |
Propel::init('bookstore-conf.php'); |
|---|
| 50 |
]]></adhoc> |
|---|
| 51 |
|
|---|
| 52 |
<fileset dir="${tests.classes.dir.resolved}" id="relevant-tests"> |
|---|
| 53 |
<include name="**/*${test.class}Test.php"/> |
|---|
| 54 |
</fileset> |
|---|
| 55 |
</target> |
|---|
| 56 |
|
|---|
| 57 |
<includepath classpathRef="incthis"/> |
|---|
| 58 |
|
|---|
| 59 |
<target name="reports" depends="configure"> |
|---|
| 60 |
|
|---|
| 61 |
<phpunit2 haltonerror="true" haltonfailure="false" printsummary="true"> |
|---|
| 62 |
<formatter type="xml" usefile="true" todir="${tests.reports.dir}" outfile="test-results.xml" /> |
|---|
| 63 |
<formatter type="plain" usefile="false"/> |
|---|
| 64 |
<batchtest> |
|---|
| 65 |
<fileset refid="relevant-tests"/> |
|---|
| 66 |
</batchtest> |
|---|
| 67 |
</phpunit2> |
|---|
| 68 |
<phpunit2report format="noframes" todir="${tests.reports.dir}" infile="${tests.reports.dir}/test-results.xml" styledir="${tests.phpunit.dir}/etc/xsl"/> |
|---|
| 69 |
</target> |
|---|
| 70 |
|
|---|
| 71 |
<!-- run the insert-sql target of the build.xml unless we are doing this for one specific test --> |
|---|
| 72 |
<target name="initialize" unless="test"> |
|---|
| 73 |
<!-- |
|---|
| 74 |
<phing phingFile="build.xml" target="insert-sql"/> |
|---|
| 75 |
--> |
|---|
| 76 |
<property name="test.class" value="" override="true"/> |
|---|
| 77 |
</target> |
|---|
| 78 |
|
|---|
| 79 |
<target name="phpunit" depends="initialize,reports" description="Executes the PHPUnit2 test suite"/> |
|---|
| 80 |
|
|---|
| 81 |
</project> |
|---|