build.xml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <project name="OpenCV-Test">
  2. <property environment="env"/>
  3. <property file="ant-${opencv.build.type}.properties"/>
  4. <property name="test.dir" value="testResults"/>
  5. <property name="build.dir" value="build"/>
  6. <property name="opencv.test.package" value="*"/>
  7. <property name="opencv.test.class" value="*"/>
  8. <property name="opencv.test.exclude" value=""/>
  9. <path id="master-classpath">
  10. <fileset dir="lib">
  11. <include name="*.jar"/>
  12. </fileset>
  13. <fileset dir="bin">
  14. <include name="*.jar"/>
  15. </fileset>
  16. </path>
  17. <target name="clean">
  18. <delete dir="build"/>
  19. <delete dir="${test.dir}"/>
  20. </target>
  21. <target name="compile">
  22. <mkdir dir="build/classes"/>
  23. <javac sourcepath="" srcdir="src" destdir="build/classes" debug="on" includeantruntime="false" >
  24. <include name="**/*.java"/>
  25. <classpath refid="master-classpath"/>
  26. </javac>
  27. </target>
  28. <target name="jar" depends="compile">
  29. <mkdir dir="build/jar"/>
  30. <jar destfile="build/jar/opencv-test.jar" basedir="build/classes">
  31. <manifest>
  32. <attribute name="Main-Class" value="org.opencv.test.OpenCVTestRunner"/>
  33. </manifest>
  34. </jar>
  35. </target>
  36. <target name="test" depends="jar">
  37. <mkdir dir="${test.dir}"/>
  38. <junit printsummary="withOutAndErr" haltonfailure="false" haltonerror="false" showoutput="true" logfailedtests="true" maxmemory="256m">
  39. <sysproperty key="java.library.path" path="${opencv.lib.path}"/>
  40. <env key="PATH" path="${opencv.lib.path}:${env.PATH}:${env.Path}"/>
  41. <env key="DYLD_LIBRARY_PATH" path="${env.OPENCV_SAVED_DYLD_LIBRARY_PATH}"/> <!-- https://github.com/opencv/opencv/issues/14353 -->
  42. <classpath refid="master-classpath"/>
  43. <classpath>
  44. <pathelement location="build/classes"/>
  45. </classpath>
  46. <formatter type="xml"/>
  47. <batchtest fork="yes" todir="${test.dir}">
  48. <zipfileset src="build/jar/opencv-test.jar" includes="**/${opencv.test.package}/${opencv.test.class}.class" excludes="**/OpenCVTest*, ${opencv.test.exclude}">
  49. <exclude name="**/*$*.class"/>
  50. </zipfileset>
  51. </batchtest>
  52. </junit>
  53. <junitreport todir="${test.dir}">
  54. <fileset dir="${test.dir}">
  55. <include name="TEST-*.xml"/>
  56. </fileset>
  57. <report format="noframes" todir="${test.dir}"/>
  58. </junitreport>
  59. </target>
  60. <target name="build" depends="jar">
  61. </target>
  62. <target name="buildAndTest" depends="test">
  63. </target>
  64. </project>