test.xml 3.0 KB

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