Path: blob/aarch64-shenandoah-jdk8u272-b10/nashorn/make/code_coverage.xml
32278 views
<?xml version="1.0" encoding="UTF-8"?>1<!--2Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.3DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.45This code is free software; you can redistribute it and/or modify it6under the terms of the GNU General Public License version 2 only, as7published by the Free Software Foundation.89This code is distributed in the hope that it will be useful, but WITHOUT10ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12version 2 for more details (a copy is included in the LICENSE file that13accompanied this code).1415You should have received a copy of the GNU General Public License version162 along with this work; if not, write to the Free Software Foundation,17Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.1819Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20or visit www.oracle.com if you need additional information or have any21questions.22-->23<project name="code-coverage" default="generate-code-coverage-report" basedir="..">2425<!-- CODE COVERAGE -->26<target name="init-cc-enabled" if="${cc.enabled}">2728<echo message="initialize [${jcov}] java coverage"/>293031<property name="cc.report.dir" value="${cc.dir}/CC_${jcov}_report"/>32<property name="cc.merged.xml" value="${cc.dir}/CC_${jcov}_result-merged.xml"/>3334<condition property="run.test.cc.jvmargs" value="${cc.dynamic.args}">35<equals arg1="${jcov}" arg2="dynamic" trim="true"/>36</condition>3738<condition property="cc.generate.template" value="true">39<equals arg1="${cc.dynamic.genereate.template}" arg2="true" trim="true"/>40</condition>4142<mkdir dir="${cc.dir}"/>43<mkdir dir="${build.dir}/to_be_instrumented"/>4445<!-- info -->46<echo message="jcov=${jcov}"/>47<echo message="cc.generate.template=${cc.generate.template}"/>48<echo message="cc.instrument=${cc.instrument}"/>49<echo message="run.test.cc.jvmargs=${run.test.cc.jvmargs}"/>50<echo message="cc.report.dir=${cc.report.dir}"/>51<echo message="cc.merged.xml=${cc.merged.xml}"/>52</target>5354<target name="init-cc-disabled" unless="${cc.enabled}">55<property name="run.test.cc.jvmargs" value=""/>56</target>5758<target name="prepare-to-be-instrumented" depends="compile" description="Prepares to_be_instrumented dir">59<copy todir="${build.dir}/to_be_instrumented">60<fileset dir="${build.classes.dir}">61<include name="**/*.class"/>62</fileset>63</copy>64</target>6566<target name="generate-cc-template" depends="prepare-to-be-instrumented" description="Generates code coverage template for dynamic CC" if="cc.generate.template">67<property name="cc.instrumented.path" location="${build.dir}/to_be_instrumented"/>68<java classname="com.sun.tdk.jcov.TmplGen">69<arg value="-verbose"/>70<arg line="-include ${cc.include}"/>71<arg line="-type all"/>72<arg line="-template ${cc.template}"/>73<arg value="${cc.instrumented.path}"/>74<classpath>75<pathelement location="${jcov.jar}"/>76</classpath>77</java>7879<java classname="com.sun.tdk.jcov.RepGen">80<arg value="-verbose"/>81<arg line="-output ${cc.dir}/CC_template_report"/>82<arg value="${cc.template}"/>83<classpath>84<pathelement location="${jcov.jar}"/>85</classpath>86</java>87</target>8889<target name="init-cc" depends="init-cc-disabled, init-cc-enabled">90<property name="run.test.cc.jvmargs" value=""/>91</target>9293<target name="init-cc-cleanup" if="${cc.enabled}">94<delete dir="${cc.dir}" failonerror="false" />95<delete dir="${build.dir}/to_be_instrumented" failonerror="false" />96</target>9798<target name="check-merging-files" depends="init">99<echo message="checking avalibility of ${cc.template}"/>100<condition property="nothing-to-merge" value="true">101<not>102<available file="${cc.template}"/>103</not>104</condition>105<echo message="nothing-to-merge = ${nothing-to-merge}"/>106</target>107108<target name="fix-merging-files" depends="check-merging-files" if="${nothing-to-merge}">109<echo message="making pre-merge workaround due to missed template"/>110<move todir="${cc.dir}" includeemptydirs="false">111<fileset dir="${cc.dir}">112<include name="*.xml"/>113</fileset>114<mapper type="glob" from="*.xml" to="CC_${jcov}_result-merged.xml"/>115</move>116</target>117118<target name="merge-code-coverage" depends="fix-merging-files" unless="${nothing-to-merge}">119<echo message="merging files"/>120<fileset dir="${cc.dir}" id="cc.xmls">121<include name="**/*_${jcov}_*.xml"/>122<include name="**/CC_template.xml"/>123</fileset>124125<pathconvert pathsep=" " property="cc.all.xmls" refid="cc.xmls"/>126<echo message="merging files - ${cc.all.xmls}" />127<java classname="com.sun.tdk.jcov.Merger">128<arg value="-verbose"/>129<arg value="-output"/>130<arg value="${cc.merged.xml}"/>131<arg value="-exclude"/>132<arg value="com\.oracle\.nashorn\.runtime\.ScriptRuntime*"/>133<arg value="-exclude"/>134<arg value="jdk\.nashorn\.javaadapters*"/>135<arg value="-exclude"/>136<arg value="jdk\.nashorn\.internal\.objects\.annotations*"/>137<arg value="-exclude"/>138<arg value="jdk\.nashorn\.internal\.scripts*"/>139<arg value="-exclude"/>140<arg value="jdk\.nashorn\.internal\.lookup\.MethodHandleFactory*"/>141<arg value="-exclude"/>142<arg value="jdk\.nashorn\.internal\.test\.framework*"/>143<arg value="-exclude"/>144<arg value="jdk\.nashorn\.test\.models*"/>145<arg value="-exclude"/>146<arg value="jdk\.nashorn\.internal\.ir\.debug*"/>147<arg value="-exclude"/>148<arg value="jdk\.nashorn\.internal\.runtime\.regexp\.joni\.bench*"/>149<arg value="-exclude"/>150<arg value="jdk\.nashorn\.internal\.runtime\.DebugLogger*"/>151<arg value="-exclude"/>152<arg value="jdk\.nashorn\.internal\.runtime\.Timing*"/>153<arg value="-exclude"/>154<arg value="jdk\.nashorn\.internal\.runtime\.Logging*"/>155<arg value="-exclude"/>156<arg value="jdk\.nashorn\.internal\.runtime\.Debug*"/>157<arg value="-exclude"/>158<arg value="jdk\.nashorn\.internal\.objects\.NativeDebug*"/>159<arg line="${cc.all.xmls}"/>160<classpath>161<pathelement location="${jcov.jar}"/>162</classpath>163</java>164165</target>166167<target name="generate-code-coverage-report" depends="merge-code-coverage">168<java classname="com.sun.tdk.jcov.RepGen">169<arg value="-verbose"/>170<!-- <arg line ="-exclude_list CC.report.exclude"/> -->171<arg line="-output ${cc.report.dir}"/>172<arg value="${cc.merged.xml}"/>173<classpath>174<pathelement location="${jcov.jar}"/>175</classpath>176</java>177</target>178179180</project>181182183