nashorn/make/code_coverage.xml
author katleman
Thu, 16 May 2013 12:14:19 -0700
changeset 17355 4f531492e774
parent 16529 fb3208bbd5dc
child 17742 55c938a4618a
permissions -rw-r--r--
Added tag jdk8-b90 for changeset c0cc3acd917d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16255
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
     1
<?xml version="1.0" encoding="UTF-8"?>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
     2
<!--
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
     3
 Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
     4
 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
     5
 
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
     6
 This code is free software; you can redistribute it and/or modify it
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
     7
 under the terms of the GNU General Public License version 2 only, as
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
     8
 published by the Free Software Foundation.
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
     9
 
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    10
 This code is distributed in the hope that it will be useful, but WITHOUT
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    11
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    12
 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    13
 version 2 for more details (a copy is included in the LICENSE file that
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    14
 accompanied this code).
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    15
 
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    16
 You should have received a copy of the GNU General Public License version
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    17
 2 along with this work; if not, write to the Free Software Foundation,
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    18
 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    19
 
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    20
 Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    21
 or visit www.oracle.com if you need additional information or have any
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    22
 questions.
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    23
-->
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    24
<project name="code-coverage" default="generate-code-coverage-report" basedir="..">
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    25
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    26
  <!-- CODE COVERAGE -->
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    27
  <target name="init-cc-enabled" if="${cc.enabled}">
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    28
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    29
    <echo message="initialize [${jcov}] java coverage"/>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    30
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    31
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    32
    <property name="cc.report.dir" value="${cc.dir}/CC_${jcov}_report"/>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    33
    <property name="cc.merged.xml" value="${cc.dir}/CC_${jcov}_result-merged.xml"/>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    34
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    35
    <condition property="run.test.cc.jvmargs" value="${cc.dynamic.args}">
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    36
      <equals arg1="${jcov}" arg2="dynamic" trim="true"/>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    37
    </condition>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    38
16529
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    39
    <condition property="cc.generate.template" value="true">
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    40
      <equals arg1="${cc.dynamic.genereate.template}" arg2="true" trim="true"/>
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    41
    </condition>
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    42
16255
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    43
    <mkdir dir="${cc.dir}"/>
16529
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    44
    <mkdir dir="${build.dir}/to_be_instrumented"/>
16255
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    45
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    46
    <!-- info -->
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    47
    <echo message="jcov=${jcov}"/>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    48
    <echo message="cc.generate.template=${cc.generate.template}"/>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    49
    <echo message="cc.instrument=${cc.instrument}"/>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    50
    <echo message="run.test.cc.jvmargs=${run.test.cc.jvmargs}"/>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    51
    <echo message="cc.report.dir=${cc.report.dir}"/>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    52
    <echo message="cc.merged.xml=${cc.merged.xml}"/>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    53
  </target>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    54
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    55
  <target name="init-cc-disabled" unless="${cc.enabled}">
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    56
    <property name="run.test.cc.jvmargs" value=""/>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    57
  </target>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    58
16529
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    59
  <target name="prepare-to-be-instrumented" depends="compile" description="Prepares to_be_instrumented dir">
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    60
    <copy todir="${build.dir}/to_be_instrumented">
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    61
      <fileset dir="${build.classes.dir}">
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    62
        <include name="**/*.class"/>
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    63
        <include name="**/*.clazz"/>
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    64
      </fileset>
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    65
    </copy>
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    66
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    67
    <move todir="${build.dir}/to_be_instrumented/jdk/nashorn/internal/objects">
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    68
      <fileset dir="${build.dir}/to_be_instrumented/jdk/nashorn/internal/objects">
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    69
        <include name="**/*.clazz"/>
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    70
      </fileset>
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    71
      <mapper type="glob" from="*.clazz" to="*.class"/>
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    72
    </move>
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    73
  </target>
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    74
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    75
  <target name="generate-cc-template" depends="prepare-to-be-instrumented" description="Generates code coverage template for dynamic CC" if="cc.generate.template">
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    76
    <property name="cc.instrumented.path" location="${build.dir}/to_be_instrumented"/>
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    77
    <java classname="com.sun.tdk.jcov.TmplGen">
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    78
      <arg value="-verbose"/>
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    79
      <arg line="-include ${cc.include}"/>
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    80
      <arg line="-type all"/>
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    81
      <arg line="-template ${cc.template}"/>
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    82
      <arg value="${cc.instrumented.path}"/>
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    83
      <classpath>
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    84
        <pathelement location="${jcov.jar}"/>
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    85
      </classpath>
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    86
    </java>
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    87
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    88
    <java classname="com.sun.tdk.jcov.RepGen">
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    89
      <arg value="-verbose"/>
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    90
      <arg line="-output ${cc.dir}/CC_template_report"/>
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    91
      <arg value="${cc.template}"/>
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    92
      <classpath>
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    93
        <pathelement location="${jcov.jar}"/>
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    94
      </classpath>
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    95
    </java>
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    96
  </target>
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
    97
16255
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    98
  <target name="init-cc" depends="init-cc-disabled, init-cc-enabled">
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
    99
    <property name="run.test.cc.jvmargs" value=""/>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   100
  </target>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   101
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   102
  <target name="init-cc-cleanup" if="${cc.enabled}">
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   103
    <delete dir="${cc.dir}" failonerror="false" />
16529
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
   104
    <delete dir="${build.dir}/to_be_instrumented" failonerror="false" />
16255
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   105
  </target>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   106
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   107
  <target name="check-merging-files" depends="init">
16529
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
   108
	<echo message="checking avalibility of ${cc.template}"/>
16255
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   109
    <condition property="nothing-to-merge" value="true">
16529
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
   110
		<not>
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
   111
	      <available file="${cc.template}"/>
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
   112
		</not>
16255
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   113
    </condition>
16529
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
   114
	<echo message="nothing-to-merge = ${nothing-to-merge}"/>
16255
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   115
  </target>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   116
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   117
  <target name="fix-merging-files" depends="check-merging-files" if="${nothing-to-merge}">
16529
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
   118
	<echo message="making pre-merge workaround due to missed template"/>
16255
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   119
	<move todir="${cc.dir}" includeemptydirs="false">
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   120
		<fileset dir="${cc.dir}">
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   121
			<include name="*.xml"/>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   122
		</fileset>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   123
		<mapper type="glob" from="*.xml" to="CC_${jcov}_result-merged.xml"/>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   124
	</move>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   125
  </target>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   126
 
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   127
  <target name="merge-code-coverage" depends="fix-merging-files" unless="${nothing-to-merge}">
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   128
	<echo message="merging files"/>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   129
    <fileset dir="${cc.dir}" id="cc.xmls">
16529
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
   130
      <include name="**/*_${jcov}_*.xml"/>
16255
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   131
      <include name="**/CC_template.xml"/>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   132
    </fileset>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   133
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   134
    <pathconvert pathsep=" " property="cc.all.xmls" refid="cc.xmls"/>
16529
fb3208bbd5dc 8009969: CodeCoverage should use template
jlaskey
parents: 16255
diff changeset
   135
	<echo message="merging files - ${cc.all.xmls}" />
16255
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   136
    <java classname="com.sun.tdk.jcov.Merger">
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   137
      <arg value="-verbose"/>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   138
      <arg value="-output"/>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   139
      <arg value="${cc.merged.xml}"/>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   140
      <arg value="-exclude"/>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   141
      <arg value="com\.oracle\.nashorn\.runtime\.ScriptRuntime*"/>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   142
      <arg line="${cc.all.xmls}"/>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   143
      <classpath>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   144
        <pathelement location="${jcov.jar}"/>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   145
      </classpath>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   146
    </java>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   147
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   148
  </target>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   149
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   150
  <target name="generate-code-coverage-report" depends="merge-code-coverage">
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   151
    <java classname="com.sun.tdk.jcov.RepGen">
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   152
      <arg value="-verbose"/>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   153
<!--      <arg line ="-exclude_list CC.report.exclude"/> -->
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   154
      <arg line="-output ${cc.report.dir}"/>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   155
      <arg value="${cc.merged.xml}"/>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   156
      <classpath>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   157
        <pathelement location="${jcov.jar}"/>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   158
      </classpath>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   159
    </java>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   160
  </target>
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   161
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   162
cb52a2524ca8 8008575: Re-integrate code coverage
lagergren
parents:
diff changeset
   163
</project>