View | Details | Raw Unified | Return to bug 52323
Collapse All | Expand All

(-)build.xml (-4 / +66 lines)
Lines 186-191 Link Here
186
    </fileset>
186
    </fileset>
187
  </path>
187
  </path>
188
188
189
  <path id="cobertura.classpath">
190
    <fileset dir="${cobertura.home}">
191
      <include name="cobertura.jar" />
192
      <include name="lib/**/*.jar" />
193
    </fileset>
194
  </path>
189
195
190
  <!-- Version info filter set -->
196
  <!-- Version info filter set -->
191
  <tstamp>
197
  <tstamp>
Lines 1078-1096 Link Here
1078
  </target>
1084
  </target>
1079
1085
1080
  <target name="test-bio" description="Runs the JUnit test cases for BIO. Does not stop on errors."
1086
  <target name="test-bio" description="Runs the JUnit test cases for BIO. Does not stop on errors."
1081
          depends="test-compile,deploy" if="${execute.test.bio}">
1087
          depends="test-compile,deploy,cobertura-instrument" if="${execute.test.bio}">
1082
    <runtests protocol="org.apache.coyote.http11.Http11Protocol"
1088
    <runtests protocol="org.apache.coyote.http11.Http11Protocol"
1083
              extension=".BIO" />
1089
              extension=".BIO" />
1084
  </target>
1090
  </target>
1085
1091
1086
  <target name="test-nio" description="Runs the JUnit test cases for NIO. Does not stop on errors."
1092
  <target name="test-nio" description="Runs the JUnit test cases for NIO. Does not stop on errors."
1087
          depends="test-compile,deploy" if="${execute.test.nio}">
1093
          depends="test-compile,deploy,cobertura-instrument" if="${execute.test.nio}">
1088
    <runtests protocol="org.apache.coyote.http11.Http11NioProtocol"
1094
    <runtests protocol="org.apache.coyote.http11.Http11NioProtocol"
1089
              extension=".NIO" />
1095
              extension=".NIO" />
1090
  </target>
1096
  </target>
1091
1097
1092
  <target name="test-apr" description="Runs the JUnit test cases for APR. Does not stop on errors."
1098
  <target name="test-apr" description="Runs the JUnit test cases for APR. Does not stop on errors."
1093
          depends="test-compile,deploy,test-apr-exists"
1099
          depends="test-compile,deploy,test-apr-exists,cobertura-instrument"
1094
          if="${apr.exists}">
1100
          if="${apr.exists}">
1095
    <runtests protocol="org.apache.coyote.http11.Http11AprProtocol"
1101
    <runtests protocol="org.apache.coyote.http11.Http11AprProtocol"
1096
              extension=".APR" />
1102
              extension=".APR" />
Lines 1110-1116 Link Here
1110
               description="The extension to use to distinguish the output"/>
1116
               description="The extension to use to distinguish the output"/>
1111
1117
1112
    <sequential>
1118
    <sequential>
1113
      <junit printsummary="yes" fork="yes" dir="." showoutput="yes"
1119
      <junit printsummary="yes" fork="yes" forkmode="once" dir="." showoutput="yes"
1114
        errorproperty="test.result.error"
1120
        errorproperty="test.result.error"
1115
        failureproperty="test.result.failure"
1121
        failureproperty="test.result.failure"
1116
        haltonfailure="${test.haltonfailure}" >
1122
        haltonfailure="${test.haltonfailure}" >
Lines 1119-1130 Link Here
1119
        <jvmarg value="-Djava.library.path=${test.apr.loc}"/>
1125
        <jvmarg value="-Djava.library.path=${test.apr.loc}"/>
1120
        <jvmarg value="${test.formatter}"/>
1126
        <jvmarg value="${test.formatter}"/>
1121
1127
1128
        <!-- The instrumented classes must appear first on the classpath -->
1129
        <classpath location="${tomcat.classes.instrumented}" />
1130
        <classpath refid="cobertura.classpath"/>
1122
        <classpath refid="tomcat.test.classpath" />
1131
        <classpath refid="tomcat.test.classpath" />
1123
1132
1124
        <sysproperty key="tomcat.test.temp" value="${test.temp}" />
1133
        <sysproperty key="tomcat.test.temp" value="${test.temp}" />
1125
        <sysproperty key="tomcat.test.tomcatbuild" value="${tomcat.build}" />
1134
        <sysproperty key="tomcat.test.tomcatbuild" value="${tomcat.build}" />
1126
        <sysproperty key="tomcat.test.protocol" value="@{protocol}" />
1135
        <sysproperty key="tomcat.test.protocol" value="@{protocol}" />
1127
        <sysproperty key="tomcat.test.accesslog" value="${test.accesslog}" />
1136
        <sysproperty key="tomcat.test.accesslog" value="${test.accesslog}" />
1137
        <!-- File for Cobertura to write coverage results to -->
1138
        <sysproperty key="net.sourceforge.cobertura.datafile" file="${cobertura.datafile}" />
1128
1139
1129
        <formatter type="${junit.formatter.type}" usefile="true" extension="@{extension}${junit.formatter.extension}"/>
1140
        <formatter type="${junit.formatter.type}" usefile="true" extension="@{extension}${junit.formatter.extension}"/>
1130
1141
Lines 1144-1149 Link Here
1144
    </sequential>
1155
    </sequential>
1145
  </macrodef>
1156
  </macrodef>
1146
1157
1158
  <target name="cobertura-enable" depends="download-cobertura"
1159
          description="Enables the Cobertura code coverage tool">
1160
1161
    <taskdef classpathref="cobertura.classpath" resource="tasks.properties" />
1162
    <property name="cobertura.enabled" value="true"/>
1163
    <property name="cobertura.out" value="${tomcat.build}/coverage"/>
1164
    <property name="cobertura.datafile" value="${cobertura.out}/cobertura.ser"/>
1165
    <property name="tomcat.classes.instrumented" value="${tomcat.classes}-instrumented"/>
1166
1167
  </target>
1168
1169
  <target name="cobertura-instrument"
1170
          depends="download-cobertura,compile"
1171
          if="cobertura.enabled"
1172
          description="Adds Cobertura instrumentation to the compiled bytecode">
1173
1174
    <cobertura-instrument datafile="${cobertura.datafile}" todir="${tomcat.classes.instrumented}">
1175
      <fileset dir="${tomcat.classes}">
1176
        <include name="**/*.class"/>
1177
      </fileset>
1178
    </cobertura-instrument>
1179
1180
  </target>
1181
1182
  <!-- Default Cobertura report format -->
1183
  <property name="cobertura.report.format" value="html"/>
1184
1185
  <target name="cobertura-report" depends="download-cobertura,cobertura-enable"
1186
          description="Creates report from gathered Cobertura results">
1187
1188
    <cobertura-report srcdir="${basedir}/java"
1189
                      destdir="${cobertura.out}"
1190
                      datafile="${cobertura.datafile}"
1191
                      format="${cobertura.report.format}"/>
1192
1193
  </target>
1194
1147
  <target name="extras-prepare" >
1195
  <target name="extras-prepare" >
1148
    <mkdir dir="${tomcat.extras}"/>
1196
    <mkdir dir="${tomcat.extras}"/>
1149
    <mkdir dir="${tomcat.extras.sources}"/>
1197
    <mkdir dir="${tomcat.extras.sources}"/>
Lines 2302-2308 Link Here
2302
2350
2303
  </target>
2351
  </target>
2304
2352
2353
  <target name="download-cobertura"
2354
          description="Download the Cobertura code coverage tool" >
2305
2355
2356
    <antcall target="downloadgz">
2357
      <param name="sourcefile" value="${cobertura.loc}"/>
2358
      <param name="destfile" value="${cobertura.jar}"/>
2359
    </antcall>
2360
2361
    <antcall target="downloadgz">
2362
      <param name="sourcefile" value="${cobertura.loc}"/>
2363
      <param name="destfile" value="${cobertura.lib}"/>
2364
    </antcall>
2365
2366
  </target>
2367
2306
  <!-- =============== Targets for dependencies that need to =============== -->
2368
  <!-- =============== Targets for dependencies that need to =============== -->
2307
  <!-- ================  be built rather than used directly ================ -->
2369
  <!-- ================  be built rather than used directly ================ -->
2308
2370
(-)build.properties.default (+5 lines)
Lines 197-199 Link Here
197
dojo-js.loc=http://download.dojotoolkit.org/release-1.1.1/dojo-release-1.1.1.tar.gz
197
dojo-js.loc=http://download.dojotoolkit.org/release-1.1.1/dojo-release-1.1.1.tar.gz
198
dojo-js.jar=${dojo-js.home}/dojo/dojo.js
198
dojo-js.jar=${dojo-js.home}/dojo/dojo.js
199
199
200
# ----- Cobertura code coverage tool -----
201
cobertura.home=${base.path}/cobertura-1.9.4.1
202
cobertura.jar=${cobertura.home}/cobertura.jar
203
cobertura.lib=${cobertura.home}/lib
204
cobertura.loc=${base-sf.loc}/cobertura/cobertura-1.9.4.1-bin.tar.gz

Return to bug 52323