Revert "SPRNET-1472 wire up opencover to run coverage on all tests aggregated together at once"
This reverts commit 6084b5d119.
This commit is contained in:
15
Spring.build
15
Spring.build
@@ -148,7 +148,6 @@ Commandline Examples:
|
||||
|
||||
<!-- Include spring helpers -->
|
||||
<include buildfile="${spring.basedir}/Spring.include"/>
|
||||
<include buildfile="${spring.basedir}/common-project.include" />
|
||||
|
||||
<property name="package.version" value="0.0.0" overwrite="false"/>
|
||||
<!-- change this to sync the sdk doc version generated -->
|
||||
@@ -510,7 +509,7 @@ Commandline Examples:
|
||||
|
||||
<!-- Main solutions and examples are compiled via task build-solutions -->
|
||||
|
||||
<!-- build coverage summary
|
||||
<!-- build coverage summary -->
|
||||
<exec program="${tool.dir}/ncoverexplorer/ncoverexplorer.console.exe" workingdir="${current.bin.dir}" failonerror="false">
|
||||
<arg value="/xml:"${current.bin.dir}/TestCoverageSummary.xml"" />
|
||||
<arg value="/report:ModuleClassFunctionSummary" />
|
||||
@@ -519,14 +518,13 @@ Commandline Examples:
|
||||
<arg value="/q" />
|
||||
<arg path="${current.bin.dir}/*-TestCoverage.xml" />
|
||||
</exec>
|
||||
-->
|
||||
|
||||
</target>
|
||||
|
||||
<target name="compile-net-2.0" description="Builds .NET Framework 2.0 version"
|
||||
depends="set-net-2.0-runtime-configuration, check-spring-basedir, clean-current-bin-dir">
|
||||
|
||||
<property name="test.withcoverage" value="false" overwrite="true"/>
|
||||
<property name="test.withcoverage" value="true" overwrite="true"/>
|
||||
|
||||
<if test="${property::exists('mstest.exe')}">
|
||||
<property name="mstest.exe.current" value="${string::replace(property::get-value('mstest.exe'), 'Microsoft Visual Studio 10.0', 'Microsoft Visual Studio 9.0')}" />
|
||||
@@ -542,7 +540,7 @@ Commandline Examples:
|
||||
<target name="compile-net-3.0" description="Builds .NET Framework 3.0 version"
|
||||
depends="set-net-3.0-runtime-configuration, check-spring-basedir, clean-current-bin-dir">
|
||||
|
||||
<property name="test.withcoverage" value="false" overwrite="true"/>
|
||||
<property name="test.withcoverage" value="true" overwrite="true"/>
|
||||
|
||||
<call target="copykeys" if="${project.build.sign}"/>
|
||||
<call target="common.generate-assemblyinfo"/>
|
||||
@@ -564,7 +562,7 @@ Commandline Examples:
|
||||
<target name="compile-net-3.5" description="Builds .NET Framework 3.5 version"
|
||||
depends="set-net-3.5-runtime-configuration, check-spring-basedir, clean-current-bin-dir">
|
||||
|
||||
<property name="test.withcoverage" value="false" overwrite="true"/>
|
||||
<property name="test.withcoverage" value="true" overwrite="true"/>
|
||||
|
||||
<property name="lib.dir" value="${spring.basedir}/lib/${framework::get-family(framework::get-target-framework())}/${framework::get-version(framework::get-target-framework())}"/>
|
||||
<property name="nh30.lib.dir" value="${spring.basedir}/lib/NHibernate30/${framework::get-family(framework::get-target-framework())}/${framework::get-version(framework::get-target-framework())}"/>
|
||||
@@ -599,7 +597,7 @@ Commandline Examples:
|
||||
<target name="compile-net-4.0" description="Builds .NET Framework 4.0 version"
|
||||
depends="set-net-4.0-runtime-configuration, check-spring-basedir, clean-current-bin-dir">
|
||||
|
||||
<property name="test.withcoverage" value="true" overwrite="true"/>
|
||||
<property name="test.withcoverage" value="false" overwrite="true"/>
|
||||
|
||||
<if test="${property::exists('mstest.exe')}">
|
||||
<property name="mstest.exe.current" value="${string::replace(property::get-value('mstest.exe'), 'Microsoft Visual Studio 9.0', 'Microsoft Visual Studio 10.0')}" />
|
||||
@@ -618,9 +616,6 @@ Commandline Examples:
|
||||
<property name="build-msmq-tests" value="true" overwrite="true" />
|
||||
<property name="build-velocity" value="true" overwrite="true" />
|
||||
<call target="compile-test" />
|
||||
|
||||
<call target="common.run-tests.aggregated.opencover" />
|
||||
|
||||
</target>
|
||||
|
||||
<target name="compile-mono-2.0" description="Builds MONO Framework 2.0 version"
|
||||
|
||||
@@ -190,11 +190,9 @@ ${test.withcoverage}: flag indicating whether to invoke tests with test-coverage
|
||||
<call target="common.run-tests.nunit" />
|
||||
</if>
|
||||
|
||||
<!-- if coverage, don't run ANY tests at all b/c all tests will be invoked AFTER all compilation is completed...
|
||||
<if test="${test.withcoverage}" >
|
||||
<if test="${test.withcoverage}" >
|
||||
<call target="common.run-tests.ncover" />
|
||||
</if>
|
||||
-->
|
||||
|
||||
</target>
|
||||
|
||||
@@ -349,105 +347,6 @@ ${tool.dir} : dir for tools
|
||||
</exec>
|
||||
|
||||
</target>
|
||||
|
||||
|
||||
|
||||
<!-- NOTE: Depends on XmlInsertNode custom task to function properly -->
|
||||
<target name="common.run-tests.aggregated.opencover" description="Run all NUnit Tests together with OpenCover coverage">
|
||||
|
||||
<property name="test.bin.dir" value="${current.bin.dir}" if="${not property::exists('test.bin.dir')}" />
|
||||
|
||||
<property name="spring.tests.nunit.filename" value="${test.bin.dir}/Spring.Tests.nunit" />
|
||||
|
||||
<!-- write the empty NUNIT project file contents to disk -->
|
||||
<echo file="${spring.tests.nunit.filename}">
|
||||
<NUnitProject>
|
||||
<Settings activeconfig="Default" />
|
||||
<Config name="Default" binpathtype="Auto">
|
||||
</Config>
|
||||
</NUnitProject>
|
||||
</echo>
|
||||
|
||||
<!-- append the node for each test assembly to the NUNIT project file -->
|
||||
<foreach item="File" property="filename">
|
||||
<in>
|
||||
<items basedir="${test.bin.dir}">
|
||||
<include name="*.Tests.dll" />
|
||||
</items>
|
||||
</in>
|
||||
<do>
|
||||
<echo message="Adding file to NUNIT project file ${spring.tests.nunit.filename}: ${filename}" />
|
||||
<xmlinsertnode filename="${spring.tests.nunit.filename}" xpath="//NUnitProject/Config" fragment="<assembly path="${filename}" />" />
|
||||
</do>
|
||||
</foreach>
|
||||
|
||||
<!-- invoke OpenCover passing the NUNIT project file to the NUNIT test runner -->
|
||||
<exec program="${tool.dir}/opencover/OpenCover.Console.exe" workingdir="${test.bin.dir}" verbose="true">
|
||||
<arg value="-register:user" />
|
||||
<arg value="-mergebyhash" />
|
||||
<arg value="-target:${tool.dir}/nunit/net-2.0/nunit-console-x86.exe" />
|
||||
<arg value="-targetargs:${spring.tests.nunit.filename} /xml:Spring.Tests-TestResults.xml /noshadow /nologo /framework:${nant.settings.currentframework}" />
|
||||
<arg value="-filter:"+[Spring*]* -[*Tests*]*"" />
|
||||
<arg value="-output:${test.bin.dir}/Spring.Tests-TestCoverage.xml" />
|
||||
</exec>
|
||||
|
||||
<!-- invoke the report generator to convert the aggregated test coverage results into a single HTML report -->
|
||||
<exec program="${tool.dir}\ReportGenerator\bin\ReportGenerator.exe" workingdir="${test.bin.dir}" verbose="true">
|
||||
<arg value="${test.bin.dir}/Spring.Tests-TestCoverage.xml" />
|
||||
<arg path="${test.bin.dir}/CoverageReport" />
|
||||
</exec>
|
||||
|
||||
</target>
|
||||
|
||||
<!-- script that appends new XML nodes to an existing xml file -->
|
||||
<script language="C#" prefix="test" >
|
||||
<references>
|
||||
<include name="System.Xml.dll" />
|
||||
</references>
|
||||
<code>
|
||||
<![CDATA[
|
||||
[TaskName("xmlinsertnode")]
|
||||
public class TestTask : Task {
|
||||
#region Private Instance Fields
|
||||
private string _filename;
|
||||
private string _xpath;
|
||||
private string _fragment;
|
||||
#endregion Private Instance Fields
|
||||
|
||||
#region Public Instance Properties
|
||||
[TaskAttribute("filename", Required=true)]
|
||||
public string FileName {
|
||||
get { return _filename; }
|
||||
set { _filename = value; }
|
||||
}
|
||||
|
||||
[TaskAttribute("xpath", Required=true)]
|
||||
public string XPath {
|
||||
get { return _xpath; }
|
||||
set { _xpath = value; }
|
||||
}
|
||||
|
||||
[TaskAttribute("fragment", Required=true)]
|
||||
public string Fragment {
|
||||
get { return _fragment; }
|
||||
set { _fragment = value; }
|
||||
}
|
||||
|
||||
#endregion Public Instance Properties
|
||||
|
||||
#region Override implementation of Task
|
||||
protected override void ExecuteTask() {
|
||||
System.Xml.XmlDocument document = new System.Xml.XmlDocument();
|
||||
document.Load(_filename);
|
||||
System.Xml.XPath.XPathNavigator navigator = document.CreateNavigator();
|
||||
navigator.SelectSingleNode(_xpath).AppendChild(_fragment);
|
||||
document.Save(_filename);
|
||||
}
|
||||
#endregion Override implementation of Task
|
||||
}
|
||||
]]>
|
||||
</code>
|
||||
</script>
|
||||
|
||||
<readregistry property="net35.install.dir" key="SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5\InstallPath" hive="LocalMachine" failonerror="true"/>
|
||||
<property name="msbuild.exe" value="${net35.install.dir}\msbuild.exe"/>
|
||||
|
||||
Reference in New Issue
Block a user