Skip to content
This repository was archived by the owner on Nov 15, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
79e0805
some readability refactoring and tidy up
sawilde Feb 13, 2015
fc68f07
wip
sawilde Mar 10, 2015
c4f901d
don't build on a tag update
sawilde Jul 18, 2015
83a942a
Update ReleaseNotes.tmp
sawilde Jul 20, 2015
d1f07d4
Fix an access violation at AddVisitPointToThreadBuffer
urasandesu Jul 27, 2015
1d90a63
Merge pull request #330 from urasandesu/master
sawilde Aug 3, 2015
09b7b84
remove dependency on static libs [makes future platform SDK upgrades …
sawilde Aug 5, 2015
374295a
Merge branch 'master' into launch_244
sawilde Aug 8, 2015
4cde072
Merge branch 'master' into corefx_1103
sawilde Aug 8, 2015
1452818
#329 address ArgumentOutOfRangeException (potentially related to #274)
sawilde Aug 8, 2015
69b39e2
quick tidy up, keep send buffer functionality in one place
sawilde Aug 8, 2015
77752f3
fix up release build
sawilde Aug 8, 2015
95495b7
error on unrecognized arguments/prefixes #335
sawilde Aug 8, 2015
66b0344
exclude nested types when declared type is excluded #328
sawilde Aug 8, 2015
65611d3
ignore branches in known autogenerated sequences #310
sawilde Aug 9, 2015
98bd0f0
ignore branches in known autogenerated sequences #302
sawilde Aug 9, 2015
99a9528
Merge branch 'master' of github.com:sawilde/opencover
sawilde Aug 9, 2015
15c47b8
Merge pull request #336 from sawilde/master
sawilde Aug 9, 2015
d8c2f2d
#310 skip first switch (if applicable) in a generated MoveNext
sawilde Aug 10, 2015
f9101aa
Merge pull request #337 from sawilde/master
sawilde Aug 10, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ReleaseNotes.tmp
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
Version [[version]]
#329 address ArgumentOutOfRangeException (potentially related to #274) (fix for VS2015)
#335 error on unrecognized arguments/prefixes (fix)
#328 exclude types when declaredtype is excluded (fix-feature)
#302 ignore branches in known autogenerated sequences (feature)
#310 skip first switch (if applicable) in a generated MoveNext (feature)

Version 4.6.166
#323 push releases and candidates to github via appveyor (prj-mgmt)
#315 update nuget package (fix for VS2015)
#320 update packages (fix for VS2015)
Expand Down
3 changes: 2 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
version: 4.6.{build}
skip_tags: true
os: Unstable
shallow_clone: true
environment:
Expand Down Expand Up @@ -60,4 +61,4 @@ notifications:
on_build_failure: true
on_build_status_changed: true
on_success:
- build dogfood-release
- build dogfood-release
230 changes: 111 additions & 119 deletions build/opencover.build
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
<?xml version="1.0"?>
<project name="OpenCover" >

<property name="configuration" value="debug" unless="${property::exists('configuration')}" />
<property name="platform" value="x86" unless="${property::exists('platform')}" />
<property name="nunit.path" value="${solution.folder}/packages/NUnit.Runners.2.6.4/tools"/>
<property name="windows-path" value="${string::to-lower(environment::get-variable('PATH'))}"/>
<property name="nunit-in-path" value="${string::contains(windows-path, 'nunit')}"/>
<property name="open-cover-test-console" value="${solution.folder}/bin/${configuration}/OpenCover.Test.Profiler.exe"/>
<property name="curl.exe" value="${solution.folder}/packages/curl.7.30.0.2/tools/native/v110/Win32/Release/static/curl.exe" />
<property name="coveralls.exe" value="${solution.folder}/packages/coveralls.io.1.3.4/tools/coveralls.net.exe"/>
<property name="configuration" value="debug" unless="${property::exists('configuration')}" />
<property name="platform" value="x86" unless="${property::exists('platform')}" />
<property name="nunit.path" value="${solution.folder}/packages/NUnit.Runners.2.6.4/tools"/>
<property name="windows-path" value="${string::to-lower(environment::get-variable('PATH'))}"/>
<property name="nunit-in-path" value="${string::contains(windows-path, 'nunit')}"/>
<property name="open-cover-test-console" value="${solution.folder}/bin/${configuration}/OpenCover.Test.Profiler.exe"/>
<property name="curl.exe" value="${solution.folder}/packages/curl.7.30.0.2/tools/native/v110/Win32/Release/static/curl.exe" />
<property name="coveralls.exe" value="${solution.folder}/packages/coveralls.io.1.3.4/tools/coveralls.net.exe"/>

<property name="msbuild.exe" value="${program.files.x86}/MSBuild/12.0/Bin/MSBuild.exe" if="${directory::exists(program.files.x86 + '/MSBuild/12.0/Bin')}" />
<property name="msbuild.exe" value="${netfx4.folder}/MSBuild.exe" unless="${property::exists('msbuild.exe')}"/>

<property name="teamcity.dotnet.nunitaddin" value="" unless="${property::exists('teamcity.dotnet.nunitaddin')}" />


<choose>
<when test="${nunit-in-path}">
<property name="nunit-console" value="nunit-console" if="${platform=='x64'}" />
Expand All @@ -26,40 +24,40 @@
</otherwise>
</choose>

<target name="clean" description="Delete all previously compiled binaries.">
<delete>
<fileset>
<include name="${solution.folder}/**/bin/**" />
<include name="${solution.folder}/**/obj/**" />
<include name="${solution.folder}/**/*.suo" />
<include name="${solution.folder}/**/*.user" />
<include name="${solution.folder}/**/x86/**" />
<include name="${solution.folder}/**/x64/**" />
<include name="${solution.folder}/**/Win32/**" />
<include name="${solution.folder}/Docs/**" />
<include name="${solution.folder}/**/Debug/**" />
<include name="${solution.folder}/**/Release/**" />
</fileset>
</delete>
</target>
<target name="clean" description="Delete all previously compiled binaries.">
<delete>
<fileset>
<include name="${solution.folder}/**/bin/**" />
<include name="${solution.folder}/**/obj/**" />
<include name="${solution.folder}/**/*.suo" />
<include name="${solution.folder}/**/*.user" />
<include name="${solution.folder}/**/x86/**" />
<include name="${solution.folder}/**/x64/**" />
<include name="${solution.folder}/**/Win32/**" />
<include name="${solution.folder}/Docs/**" />
<include name="${solution.folder}/**/Debug/**" />
<include name="${solution.folder}/**/Release/**" />
</fileset>
</delete>
</target>

<target name="clean-all" description="Delete all other files" depends="clean">
<delete>
<fileset>
<include name="${solution.folder}/ipch/**" />
<include name="${solution.folder}/opencover.sdf" />
</fileset>
</delete>
</target>
<target name="clean-all" description="Delete all other files" depends="clean">
<delete>
<fileset>
<include name="${solution.folder}/ipch/**" />
<include name="${solution.folder}/opencover.sdf" />
</fileset>
</delete>
</target>

<target name="build" description="Build all targets.">
<property name="configuration" value="debug" />
<property name="platform" value="x64" />
<call target="build.opencover" />
<property name="configuration" value="debug" />
<property name="platform" value="x86" />
<call target="build.opencover" />
</target>
<target name="build" description="Build all targets.">
<property name="configuration" value="debug" />
<property name="platform" value="x64" />
<call target="build.opencover" />
<property name="configuration" value="debug" />
<property name="platform" value="x86" />
<call target="build.opencover" />
</target>

<target name="build-all-platforms"
depends="build-debug-platforms, build-release-platforms"
Expand Down Expand Up @@ -92,105 +90,99 @@
<target name="build.opencover" depends="fetch.solution.packages">

<exec program="${msbuild.exe}">
<arg value="${solution.folder}/opencover.sln" />
<arg value="/t:Clean,Rebuild" />
<arg value="/p:Configuration=${configuration},Platform=${platform}" />
<arg value="${solution.folder}/opencover.sln" />
<arg value="/t:Clean,Rebuild" />
<arg value="/p:Configuration=${configuration},Platform=${platform}" />
</exec>

<property name="expected.output" value="${solution.folder}/bin/${configuration}/OpenCover.Console.exe"/>
<fail unless="${file::exists(expected.output)}">Output file doesn't exist in ${expected.output}</fail>
</target>
<property name="expected.output" value="${solution.folder}/bin/${configuration}/OpenCover.Console.exe"/>
<fail unless="${file::exists(expected.output)}">Output file doesn't exist in ${expected.output}</fail>

<target name="copy-teamcity-nunit-plugin" >
<!-- from http://legeronline.blogspot.com/2009/05/team-city-addin-for-nunit.html -->
<mkdir dir="${nunit.path}\addins" />
<property name="teamcity-nunit-add-in" value="{teamcity.dotnet.nunitaddin}-2.6.0.dll" />
<copy file="${teamcity-nunit-add-in}" todir="${nunit.path}\addins" if="${file::exists(teamcity-nunit-add-in)}" />
</target>

<target name="test" description="Run unit tests" >

<call target="copy-teamcity-nunit-plugin" unless="${teamcity.dotnet.nunitaddin==''}" />

</target>

<target name="test" description="Run unit tests" >

<echo message="test: ${solution.folder}/bin/${configuration}/OpenCover.Test.dll" />

<exec program="${nunit-console}">
<arg value="${solution.folder}/bin/${configuration}/OpenCover.Test.dll" />
<arg value="/framework=4.0" />
<arg value="/exclude=AdminOnly" />
<arg value="/xml=${solution.folder}/bin/${configuration}/TestResult.xml" />
</exec>
<exec program="${nunit-console}">
<arg value="${solution.folder}/bin/${configuration}/OpenCover.Test.dll" />
<arg value="/framework=4.0" />
<arg value="/exclude=AdminOnly" />
<arg value="/xml=${solution.folder}/bin/${configuration}/TestResult.xml" />
</exec>

</target>
</target>

<target name="test-bdd" description="Run BDD tests" >
<target name="test-bdd" description="Run BDD tests" >

<call target="copy-teamcity-nunit-plugin" unless="${teamcity.dotnet.nunitaddin==''}" />

<echo message="test-bdd: ${solution.folder}/OpenCover.Specs/bin/${configuration}/OpenCover.Specs.dll" />

<exec program="${nunit-console}">
<arg value="${solution.folder}/OpenCover.Specs/bin/${configuration}/OpenCover.Specs.dll" />
<arg value="/framework=4.0" />
<arg value="/exclude=AdminOnly" />
<arg value="/xml=${solution.folder}/bin/${configuration}/TestResult.xml" />
</exec>
<exec program="${nunit-console}">
<arg value="${solution.folder}/OpenCover.Specs/bin/${configuration}/OpenCover.Specs.dll" />
<arg value="/framework=4.0" />
<arg value="/exclude=AdminOnly" />
<arg value="/xml=${solution.folder}/bin/${configuration}/TestResult.xml" />
</exec>

</target>
</target>

<target name="test-cpp" depends="register, test-cpp-internal, unregister" />
<target name="test-cpp" depends="register, test-cpp-internal, unregister" />

<target name="test-cpp-internal" description="Run C++ tests" >
<exec program="${open-cover-test-console}" if="${file::exists(open-cover-test-console)}" />
</target>
<target name="test-cpp-internal" description="Run C++ tests" >
<exec program="${open-cover-test-console}" if="${file::exists(open-cover-test-console)}" />
</target>

<target name="unregister" description="Unregister the profiler assembly (per-user)" >
<echo message="unregister: ${solution.folder}/bin/${configuration}/${platform}/OpenCover.Profiler.dll" />
<exec program="regsvr32" >
<arg value="/u" />
<arg value="/n" />
<arg value="/i:user" />
<arg value="/s" />
<arg value="${solution.folder}/bin/${configuration}/${platform}/OpenCover.Profiler.dll" />
</exec>
</target>
<target name="unregister" description="Unregister the profiler assembly (per-user)" >
<echo message="unregister: ${solution.folder}/bin/${configuration}/${platform}/OpenCover.Profiler.dll" />
<exec program="regsvr32" >
<arg value="/u" />
<arg value="/n" />
<arg value="/i:user" />
<arg value="/s" />
<arg value="${solution.folder}/bin/${configuration}/${platform}/OpenCover.Profiler.dll" />
</exec>
</target>

<target name="register" description="Register the profiler assembly (per-user)" >
<echo message="register: ${solution.folder}/bin/${configuration}/${platform}/OpenCover.Profiler.dll" />
<exec program="regsvr32" >
<arg value="/n" />
<arg value="/i:user" />
<arg value="/s" />
<arg value="${solution.folder}/bin/${configuration}/${platform}/OpenCover.Profiler.dll" />
</exec>
</target>
<target name="register" description="Register the profiler assembly (per-user)" >
<echo message="register: ${solution.folder}/bin/${configuration}/${platform}/OpenCover.Profiler.dll" />
<exec program="regsvr32" >
<arg value="/n" />
<arg value="/i:user" />
<arg value="/s" />
<arg value="${solution.folder}/bin/${configuration}/${platform}/OpenCover.Profiler.dll" />
</exec>
</target>

<target name="dogfood">
<target name="dogfood">

<exec program="${solution.folder}/bin/${configuration}/dogfood.cmd"
workingdir="${solution.folder}/bin/${configuration}" />
<exec program="${solution.folder}/bin/${configuration}/dogfood.cmd"
workingdir="${solution.folder}/bin/${configuration}" />

<exec program="${coveralls.exe}"
workingdir="${solution.folder}/bin/${configuration}">
<arg value="--opencover" />
<arg value="opencovertests.xml" />
</exec>
<exec program="${solution.folder}/bin/${configuration}/uitest.opencover.cmd"
workingdir="${solution.folder}/bin/${configuration}" />

<exec program="${coveralls.exe}" workingdir="${solution.folder}/bin/${configuration}">
<arg value="--opencover" />
<arg value="opencovertests.xml" />
</exec>

</target>
</target>

<target name="dogfood-release">
<target name="dogfood-release">

<property name="configuration" value="release" />
<property name="configuration" value="release" />

<exec program="${solution.folder}/bin/${configuration}/dogfood.cmd"
workingdir="${solution.folder}/bin/${configuration}" />
<exec program="${solution.folder}/bin/${configuration}/dogfood.cmd"
workingdir="${solution.folder}/bin/${configuration}" />

<exec program="${coveralls.exe}"
workingdir="${solution.folder}/bin/${configuration}">
<arg value="--opencover" />
<arg value="opencovertests.xml" />
</exec>
<exec program="${solution.folder}/bin/${configuration}/uitest.opencover.cmd"
workingdir="${solution.folder}/bin/${configuration}" />

<exec program="${coveralls.exe}" workingdir="${solution.folder}/bin/${configuration}">
<arg value="--opencover" />
<arg value="opencovertests.xml" />
</exec>

</target>
</target>

</project>
11 changes: 3 additions & 8 deletions default.build
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
tofile="${solution.folder}/bin/zip/opencover.${buildnumber.major}.${buildnumber.minor}.${buildnumber.build}.zip" />
</target>

<target name="create-release" depends="build-environment, build-release-platforms, test, test-cpp, create-zip-package">
<target name="create-release" depends="clean-all, build-environment, build-release-platforms, test, test-cpp, create-zip-package">
<call target="nuget-package" />
<call target="set-rc-property" />
<call target="nuget-package" />
Expand All @@ -61,12 +61,7 @@
<target name="set-rc-property" >
<property name="buildnumber.ci" value="-rc" />
</target>

<target name="create-release-candidate" depends="build-environment, build-release-platforms, test, test-cpp, set-rc-property, nuget-package, create-zip-package">
<call target="copy-artefacts" />
<call target="test-bdd" />
</target>


<target name="generate-release-notes" depends="get-version-number" >
<delete file="ReleaseNotes.txt" />
<copy file="ReleaseNotes.tmp" tofile="ReleaseNotes.txt" >
Expand Down Expand Up @@ -95,6 +90,6 @@
<replacestring from="[[version]]" to="${buildnumber.major}.${buildnumber.minor}.${buildnumber.build}" />
</filterchain>
</copy>
</target>
</target>

</project>
2 changes: 2 additions & 0 deletions main/OpenCover.Console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,9 @@ private static bool ParseCommandLine(string[] args, out CommandLineParser parser
}
catch (Exception ex)
{
System.Console.WriteLine("");
System.Console.WriteLine("Incorrect Arguments: {0}", ex.Message);
System.Console.WriteLine("");
System.Console.WriteLine(parser.Usage());
return false;
}
Expand Down
4 changes: 3 additions & 1 deletion main/OpenCover.Framework/CommandLineParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ public string Usage()
/// </summary>
public void ExtractAndValidateArguments()
{
ParseArguments();

foreach (var key in ParsedArguments.Keys)
{
var lower = key.ToLowerInvariant();
Expand Down Expand Up @@ -247,7 +249,7 @@ public void ExtractAndValidateArguments()
PrintVersion = true;
break;
default:
throw new InvalidOperationException(string.Format("The argument {0} is not recognised", key));
throw new InvalidOperationException(string.Format("The argument '-{0}' is not recognised", key));
}
}

Expand Down
16 changes: 12 additions & 4 deletions main/OpenCover.Framework/CommandLineParserBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,29 @@ protected CommandLineParserBase(string[] arguments)
{
_arguments = arguments;
ParsedArguments = new Dictionary<string, string>();
ParseArguments();
}

protected IDictionary<string, string> ParsedArguments { get; private set; }

private void ParseArguments()

/// <summary>
/// Parse the arguments
/// </summary>
protected void ParseArguments()
{
if (_arguments == null) return;
if (ParsedArguments.Count > 0) return;

foreach (var argument in _arguments)
{
var trimmed = argument.Trim();
if (!trimmed.StartsWith("-")) continue;
if (string.IsNullOrEmpty(trimmed)) continue;

if (!trimmed.StartsWith("-"))
throw new InvalidOperationException(string.Format("The argument '{0}' is not recognised", argument));

trimmed = trimmed.Substring(1);
if (string.IsNullOrEmpty(trimmed)) continue;

var colonidx = trimmed.IndexOf(':');
if (colonidx>0)
{
Expand Down
Loading