ant02---加入junit来自动化测试 并 生成测试报告
2012-06-16 22:00
357 查看
样例文件:
<?xml version="1.0" encoding="UTF-8" ?> - <project name="junit-test"> <property name="src.dir" location="src" /> <property name="test.src.dir" location="test" /> <property name="lib.dir" location="lib" /> <property name="build.dir" location="build" /> <property name="build.classes" location="${build.dir}/classes" /> <property name="build.test.dir" location="${build.dir}/test" /> <property name="build.test.classes" location="${build.test.dir}/classes" /> <property name="build.test.report" location="${build.test.dir}/report" /> <property name="run.test.class" value="**/Test*.class" /> - <path id="compile-path"> <fileset dir="${lib.dir}" includes="*.jar" /> </path> - <path id="compile-test-path"> <path refid="compile-path" /> <pathelement location="${build.classes}" /> </path> - <path id="run-test-path"> <path refid="compile-test-path" /> <pathelement location="${build.test.classes}" /> </path> - <target name="clean"> <echo>进行项目的清理工作</echo> <delete dir="${build.dir}" /> </target> - <target name="init"> <echo>进行项目的初始化</echo> <mkdir dir="${build.dir}" /> <mkdir dir="${build.classes}" /> <mkdir dir="${build.test.dir}" /> <mkdir dir="${build.test.classes}" /> <mkdir dir="${build.test.report}" /> </target> - <target name="compile" depends="init"> <echo>编译源文件</echo> <javac failonerror="true" includeantruntime="true" srcdir="${src.dir}" destdir="${build.classes}" classpathref="compile-path" /> </target> - <target name="compile-test" depends="compile"> <echo>编译测试文件</echo> <javac failonerror="true" includeantruntime="true" srcdir="${test.src.dir}" destdir="${build.test.classes}" classpathref="compile-test-path" /> </target> - <target name="run-test" depends="compile-test"> <echo>运行单元测试</echo> - <junit printsummary="false" haltonfailure="false"> <classpath refid="run-test-path" /> <formatter type="brief" usefile="false" /> <!-- <test name="${run.test.class}"></test> --> <formatter type="xml" /> - <batchtest todir="${build.test.report}"> <fileset dir="${build.test.classes}" includes="${run.test.class}" /> </batchtest> </junit> - <junitreport todir="${build.test.report}"> <fileset dir="${build.test.report}" includes="TEST-*.xml" /> <report format="frames" todir="${build.test.report}/html" /> </junitreport> </target> - <target name="end" depends="run-test"> <echo>整个过程结束</echo> </target> </project>
相关文章推荐
- jenkins+maven+junit构建自动化测试,整合junit xml生成直观的测试报告
- jenkins+maven+junit构建自动化测试,整合junit xml生成直观的测试报告[留存]
- Android-Junit-Report测试报告生成——Android自动化测试学习历程
- jenkins+maven+junit构建自动化测试,整合junit xml生成直观的测试报告
- Appium基于python unittest自动化测试并生成html测试报告
- junit + ant + emma生成代码测试覆盖率报告
- Android 自动化测试—robotium(九) Junit_report测试报告重定向输出到终端SDCard
- Ant执行JUnit测试并生成报告
- ant 构建junit 测试生成报告
- ruby+selenium-webdriver一步一步完成自动化测试(6)—-生成测试报告
- android-junit-report工具实现android下junit框架测试自动生成报告
- Java单元测试Junit(六)使用Cobertura生成测试覆盖率报告
- Ant结合Junit生成测试报告
- 利用ant 和 Junit 生成测试报告
- jenkins junit测试报告生成
- Android 自动化测试—robotium(七) 使用Junit_report测试报告
- nose测试中修改nose_html_reporting插件,使生成的html报告加入显示截图功能
- python接口自动化测试(八)-unittest-生成测试报告
- Selenium自动化测试在PageObject下的架构与测试报告生成
- ant学习笔记(三)ant整合junit做测试并生成测试报告