junit

 

<?xml version="1.0" encoding="UTF-8"?>
<project default="setup" name="baseconfig">
  <property environment="env" />
  <property name="common-config.basedir" value="${env.ICP_CI}/plugins/common-config" />
  <import file="${common-config.basedir}/ci-common-config.xml" />
  <property name="master.project.path" value="C:/icp-code/CDECalculate" />
  <property name="reports" value="reports" />
  <if>
    <isset property="agent.project.path" />
    <then>
      <property name="project.path" value="${agent.project.path}" />
    </then>
    <else>
      <property name="project.path" value="${master.project.path}" />
    </else>
  </if>
  <target depends="ci.common.config, setup.properties, setup.paths,import.properties" name="setup" />
  <target name="setup.properties" />
  <target name="setup.paths">
    <path id="path.id.project">
      <pathelement location="${project.path}" />
    </path>
    <path id="path.id.project4pclint">
      <fileset dir="${project.path}">
        <include name="**/*.cpp" />
        <include name="**/*.h" />
        <include name="**/*.hpp" />
        <include name="**/*.c" />
      </fileset>
    </path>
    <path id="path.junit.project">
      <fileset dir="C:\icp-code/CDECalculate\lib">
        <include name="*.jar" />
      </fileset>
      <fileset dir="C:\icp-code/CDECalculate\target\lib">
        <include name="*.jar" />
      </fileset>
    </path>
    <path id="path.class.project">
      <pathelement location="C:\icp-code/CDECalculate\bin\classes" />
    </path>
    <!--
  <path id="path.id.classpath.main">
   <pathelement location="${project.path}/classes/main"/>
  </path>
  <path id="path.id.classpath.test">
   <pathelement location="${project.path}/classes/test"/>
   <path refid="path.id.classpath"/>
  </path>
  <path id="path.id.classpath">
   <fileset dir="${project.path}">
    <include name="**/*.jar"/>
   </fileset>
   <path refid="path.id.classpath.main"/>
  </path>
  -->
    <patternset id="java.pattern">
      <include name="**/*.java" />
    </patternset>
    <patternset id="cpp.pattern">
      <include name="**/*.h" />
      <include name="**/*.hpp" />
      <include name="**/*.c" />
      <include name="**/*.cpp" />
    </patternset>
    <patternset id="c.pattern">
      <include name="**/*.h" />
      <include name="**/*.c" />
    </patternset>
    <patternset id="javatest.pattern">
      <include name="**/*Test*.java" />
      <exclude name="**/AllTests.java" />
    </patternset>
  </target>
  <target name="import.properties">
    <echo message="${project.path}" />
    <property file="conf/project.properties" />
  </target>
</project>


junit

<?xml version="1.0"?>
<project basedir="../" default="junit" name="junit">
<description>This is junit tool which we're putting on CruiseControl</description>
<property environment="env"/>
<import file="baseconfig.xml" optional="true"/>
<import file="${plugins.root}/junit/macro/junit_macro.xml" optional="true"/>
<!-- JUnit       -->
<target depends="setup" name="junit">
  <!--
The notification of this script configuration.
====================================================================================
param  layerpath
type  string   
value  Such as:/a/b  
note  The name of the report layer.
====================================================================================
param  classpathId
type  string   
value     
note  Path ID of the class file (.class).
====================================================================================
param  srcTestDir
type  string   
value     
note  The path of the source file (.java).
====================================================================================
param  patternsetId
type  string   
value     
note  Set which files to run.such as:
   <patternset id="java.pattern">
    <include name="**/*.java"/>
    </patternset>
====================================================================================
-->
  <property name="reports.junit" value="${reports}/junit"/>
  <delete dir="${reports.junit}" failοnerrοr="false"/>
  <mkdir dir="${reports.junit}"/>
  <property name="layerpath" value=""/>
  <property name="classpathId" value="path.junit.project"/>
  <property name="srcTestDir" value="${project.path}/src/junit"/>
  <property name="patternsetId" value="javatest.pattern"/>
  <junit-layer-macro classpathId="${classpathId}" layerpath="${layerpath}" patternsetId="${patternsetId}" srcTestDir="${srcTestDir}"/>
  <fail if="tests.failed" message="Some unit tests failed"/>
</target>
</project>


cobertr

<?xml version="1.0"?>
<project basedir="../" default="cobertura" name="cobertura">
<description>This is cobertura tool which we're putting on CruiseControl</description>
<property environment="env"/>
<import file="baseconfig.xml" optional="true"/>
<import file="${plugins.root}/cobertura/macro/cobertura_macro.xml" optional="true"/>
<target depends="setup" name="cobertura">
  <!--
The notification of this script configuration.
====================================================================================
param  layerpath
type  string   
value  Such as:/a/b  
note  The name of the report layer.
====================================================================================
param  classpathRefid
type  string   
value     
note  Path ID of the source class (.class).
====================================================================================
param  classpathRefidOfTestcases
type  string   
value  [C++,java]   
note  Path ID of the codes class and libs.
====================================================================================
param  sourceFilesetDir
type  string   
value     
note  Source code(.java) path.
====================================================================================
param  testClassFilesetDir
type  string   
value      
note  Path of the test class(.class).
====================================================================================
-->
  <property name="reports.cobertura" value="${reports}/cobertura"/>
  <property name="layerpath" value=""/>
  <property name="classpathRefid" value="path.class.project"/>
  <property name="classpathRefidOfTestcases" value="path.junit.project"/>
  <property name="sourceFilesetDir" value="${project.path}/src/main"/>
  <property name="testClassFilesetDir" value="${project.path}/target/test"/>
  <delete dir="${reports.cobertura}" failοnerrοr="false"/>
  <mkdir dir="${reports.cobertura}"/>
  <cobertura-layer-macro classpathRefid="${classpathRefid}" classpathRefidOfTestcases="${classpathRefidOfTestcases}" layerpath="${layerpath}">
   <source-filesets>
    <fileset dir="${sourceFilesetDir}">
     <include name="**/*.java"/>
    </fileset>
   </source-filesets>
   <test-filesets>
    <fileset dir="${testClassFilesetDir}">
     <include name="**/*Test*.class"/>
     <exclude name="**/AllTests.class"/>
    </fileset>
   </test-filesets>
  </cobertura-layer-macro>
</target>
</project>


emma

<?xml version="1.0"?>
<project basedir="../" default="emma" name="emma">
<property environment="env"/>
<import file="baseconfig.xml" optional="true"/>
<import file="${plugins.root}/emma/macro/emma_macro.xml" optional="true"/>
<target depends="setup" name="emma">
  <!--
The notification of this script configuration.
====================================================================================
param  layerpath
type  string   
value  Such as:/a/b  
note  The name of the report layer.
====================================================================================
param  sourceDir
type  path   
value     
note  The path of source files.
====================================================================================
param  classDir
type  path   
value     
note  The path of class files.
====================================================================================
param  testClassDir
type  path   
value     
note  The path of testclass files.
====================================================================================
param  libDir
type  path   
value     
note  The path of lib files.
====================================================================================
param  dependLibPathID
type  string   
value     
note  The pathID of lib files.
   
====================================================================================
param  emma.patternsetId
type  string   
value     
note  The patternsetId for emma to choose which files to run.
   If property of emma.patternsetId,then the will be set
   by emma_macro with default such as:
   
   <patternset id="emma.patternsetId">
    <include name="**/*Test*.class"/>
    <exclude name="**/AllTests.class"/>
   </patternset>
====================================================================================
param  classPath.exclude
type  string   
value  such as:com.huawei.icp.ci.ant.*,org.*
note  The classes that you want not to checked by emma.
====================================================================================
param  method.threshold
type  int   
value  0~100   
note  Who's coverage(%) is large than threshold,then will be not report.
====================================================================================
param  line.threshold
type  0~100   
value     
note  Who's coverage(%) is large than threshold,then will be not report.
====================================================================================
param  class.threshold
type  0~100   
value     
note  Who's coverage(%) is large than threshold,then will be not report.
====================================================================================
param  block.threshold
type  0~100   
value     
note  Who's coverage(%) is large than threshold,then will be not report.
====================================================================================
-->
  <property name="layerpath" value=""/>
  <property name="reports.emma" value="${reports}/emma"/>
  <property name="sourceDir" value=""/>
  <property name="classDir" value="${project.path}/bin"/>
  <property name="testClassDir" value="${project.path}/target/test"/>
  <property name="libDir" value="${project.path}/lib"/>
  <property name="dependLibPathID" value="Libs.pathID"/>
  <path id="Libs.pathID">
   <fileset dir="${libDir}">
    <include name="**/*.jar"/>
   </fileset>
   <!--
  If the dependLibs are standing in more than 2 ways.
  You can have the dependLib.pathID like:
  <fileset dir="${libDir}">
   <include name="**/*.jar"/>
  </fileset>
  <fileset dir="${project.path}/webapps/lib">
   <include name="**/*.jar"/>
   <include name="**/*.class"/>
  </fileset>
  -->
  </path>
  <property name="emma.patternsetId" value=""/>
  <!--
<patternset id="emma.patternsetId">
  <include name="**/*Test*.class"/>
  <exclude name="**/AllTests.class"/>
</patternset>
-->
  <property name="classPath.exclude" value=""/>
  <property name="method.threshold" value="0"/>
  <property name="line.threshold" value="0"/>
  <property name="class.threshold" value="0"/>
  <property name="block.threshold" value="0"/>
  <delete dir="${reports.emma}" failοnerrοr="false"/>
  <mkdir dir="${reports.emma}"/>
  <emma-layer-macro block.threshold="${block.threshold}" class.threshold="${class.threshold}" classDir="${classDir}" classPath.exclude="${classPath.exclude}" dependLibPathID="${dependLibPathID}" emma.patternsetId="${emma.patternsetId}" layerpath="${layerpath}" line.threshold="${line.threshold}" method.threshold="${method.threshold}" sourceDir="${sourceDir}" testClassDir="${testClassDir}"/>
</target>
</project>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值