Skip to content

Commit

Permalink
Merge pull request OpenCover#472 from OpenCover/master
Browse files Browse the repository at this point in the history
create a release-candidate
  • Loading branch information
sawilde committed Jan 13, 2016
2 parents ab1148e + 7246fa2 commit 7c36a1e
Show file tree
Hide file tree
Showing 105 changed files with 3,025 additions and 1,487 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,10 @@ ReleaseNotes.txt
/fakes/**/FakesAssemblies/**/*
/fakes/packages
!fakes/packages/repositories.config

#Coverity
cov-int*
coverity.zip

#SharpDevelop
/**/OpenCover/coverage.xml
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ The latest releases can be downloaded from [releases](https://github.com/opencov

[![Build status](https://img.shields.io/appveyor/ci/sawilde/opencover.svg)](https://ci.appveyor.com/project/sawilde/opencover)
[![Coverage](https://img.shields.io/coveralls/OpenCover/opencover/master.svg)](https://coveralls.io/r/OpenCover/opencover)
[![Coverity](https://scan.coverity.com/projects/3921/badge.svg)](https://scan.coverity.com/projects/opencover-opencover)
[![Nuget](https://img.shields.io/nuget/dt/opencover.svg)](http://nuget.org/packages/opencover)
[![Nuget](https://img.shields.io/nuget/v/opencover.svg)](http://nuget.org/packages/opencover)
[![Nuget](https://img.shields.io/nuget/vpre/opencover.svg)](http://nuget.org/packages/opencover)
Expand Down Expand Up @@ -31,7 +32,7 @@ If anyone is aware of any licence violations that this code may be making please
OpenCover was initially created to support unit testing techniques such as TDD and tools like NUnit and MSTest. Over time others have found ways to use OpenCover for integration testing especially in tricky scenarios such as IIS and Windows Services. I'll put links here as to how people have achieved this however as they say YMMV (You Mileage May Vary).

#### Mono support
It isn't sorry - this tool uses the profiler API that is currently only available to .NET Frameworks running on the windows platform.
It isn't, sorry - this tool uses the profiler API that is currently only available to .NET Frameworks running on the Windows platform.

#### IIS support
Please refer to the wiki - [IIS Support](https://github.com/OpenCover/opencover/wiki/IIS-Support)
Expand All @@ -40,20 +41,20 @@ Please refer to the wiki - [IIS Support](https://github.com/OpenCover/opencover/
Please refer to the wiki - [DNX Support](https://github.com/OpenCover/opencover/wiki/DNX-Support)

#### Win8/Win10 Application Support
Note yet [implemented](https://github.com/OpenCover/opencover/issues/144). Sorry no call for it I assume the WPF way of separating model and UI has led to people getting all they need from unit-tests; I know how that is how it works for me.
Not yet [implemented](https://github.com/OpenCover/opencover/issues/144). Sorry no call for it I assume the WPF way of separating model and UI has led to people getting all they need from unit-tests; I know how that is how it works for me.

#### Service support
please refer to the wiki - [Service Support](https://github.com/OpenCover/opencover/wiki/Service-Support)
Please refer to the wiki - [Service Support](https://github.com/OpenCover/opencover/wiki/Service-Support)

#### Silverlight support
Please refer to wiki - [Silverlight support](https://github.com/OpenCover/opencover/wiki/Silverlight-Support)
Please refer to the wiki - [Silverlight support](https://github.com/OpenCover/opencover/wiki/Silverlight-Support)

### Building
You will need:

1. Visual Studio VS2013 (Community Edition) or later with C# and C++
2. WiX 3.9 or later (http://wix.codeplex.com/releases/view/136891)
3. Specflow (http://visualstudiogallery.msdn.microsoft.com/9915524d-7fb0-43c3-bb3c-a8a14fbd40ee)
3. SpecFlow (http://visualstudiogallery.msdn.microsoft.com/9915524d-7fb0-43c3-bb3c-a8a14fbd40ee)
4. Windows SDK 8 and .NET Framework Tools (https://msdn.microsoft.com/en-us/windows/desktop/bg162891.aspx)

All other software should be included with this repository.
Expand Down
4 changes: 3 additions & 1 deletion ReleaseNotes.tmp
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Version [[version]]
#376 protect buffer allocation in multithreaded environment (fix)
#335 allow short wait timeout to be configured (feature)
#310 improved reporting - hide branches due to iterators (feature)
#352 improved reporting - hide branches due to async (feature)
#363 calculate npath comlexity (feature)

Version 4.6.210 (rc - remove)
#282 exclude by process (feature)
Expand All @@ -9,7 +12,6 @@ Version 4.6.210 (rc - remove)
#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)
Expand Down
18 changes: 15 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
version: 4.6.{build}
skip_tags: true
os: Unstable
os: Visual Studio 2015
shallow_clone: true
environment:
COVERALLS_REPO_TOKEN:
secure: BBBH4QgZXCnE6nFrux34cLWWO5GXrnMU9OZJGJdNePovxJZFzBcm3FsaESNA6zWj
COVERITY_TOKEN:
secure: rw3Pk+YPWTG7xG7AaJx8wpxnYAOXM1/7HTRahQGuCHc=
COVERITY_EMAIL:
secure: lgy4M/uQ9jMlxmPzTIYWVE2GggvPntq6kfpO6Z0pjAs=
cache:
- build/Version/opencover.snk
- build/Version/opencover.public.snk
nuget:
disable_publish_on_pr: true
build_script:
- build create-release
- ps: >-
if ($env:APPVEYOR_SCHEDULED_BUILD -eq "True" -or $env:APPVEYOR_REPO_BRANCH -eq "coverity") {
& .\build.bat create-coverity-release
} else {
& .\build.bat create-release
}
test: off
artifacts:
- path: main/bin/installer/*.msi
Expand Down Expand Up @@ -61,4 +70,7 @@ notifications:
on_build_failure: true
on_build_status_changed: true
on_success:
- build dogfood-release
- ps: >-
if ($env:APPVEYOR_SCHEDULED_BUILD -ne "True" -and $env:APPVEYOR_REPO_BRANCH -ne "coverity") {
& .\build.bat dogfood-release
}
19 changes: 19 additions & 0 deletions build/coverity/coverity_model.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* Coverity Scan model
*
* This is a modeling file for Coverity Scan. Modeling helps to avoid false
* positives.
*
* - A model file can't import any header files.
* - Therefore only some built-in primitives like int, char and void are
* available but not wchar_t, NULL etc.
* - Modeling doesn't need full structs and typedefs. Rudimentary structs
* and similar types are sufficient.
* - An uninitialized local pointer is not an error. It signifies that the
* variable could be either NULL or have some data.
*
* Coverity Scan doesn't pick up modifications automatically. The model file
* must be uploaded by an admin in the analysis settings of
* http://scan.coverity.com/projects/3921
*/

/* empty modeling file for now */
24 changes: 17 additions & 7 deletions build/opencover.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?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"/>
Expand All @@ -9,7 +9,11 @@
<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="appveyor" value="" />
<property name="appveyor" value="${environment::get-variable('appveyor')}" if="${environment::variable-exists('appveyor')}"/>
<property name="exclude-admin-only" value="/exclude:AdminOnly" />
<property name="exclude-admin-only" value="" if="${appveyor=='True'}" />

<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')}"/>

Expand Down Expand Up @@ -72,6 +76,12 @@
<call target="build.opencover" />
</target>

<target name="build-release-platforms-x64" description="Build x64 release platform">
<property name="configuration" value="release" />
<property name="platform" value="x64" />
<call target="build.opencover" />
</target>

<target name="build-debug-platforms" description="Build all debug platform flavours">
<property name="configuration" value="debug" />
<property name="platform" value="x64" />
Expand Down Expand Up @@ -106,8 +116,8 @@

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

Expand All @@ -119,8 +129,8 @@

<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="/framework=4.5.2" />
<arg value="${exclude-admin-only}" />
<arg value="/xml=${solution.folder}/bin/${configuration}/TestResult.xml" />
</exec>

Expand Down Expand Up @@ -172,7 +182,7 @@

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

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

<exec program="${solution.folder}/bin/${configuration}/uitest.opencover.cmd"
Expand Down
24 changes: 24 additions & 0 deletions default.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,16 @@
<property name="netfx4.folder" value="${netfx.framework.folder}/v4.0.30319" />
<property name="ci.buildNumber" value="${environment::get-variable('APPVEYOR_BUILD_NUMBER')}" if="${environment::variable-exists('APPVEYOR_BUILD_NUMBER')}"/>
<property name="ci.buildNumber" value="0" unless="${property::exists('ci.buildNumber')}" />
<property name="coverity.folder" value="C:\Projects\cov-analysis-win64-7.7.0.4\cov-analysis-win64-7.7.0.4\bin" if="${directory::exists('C:\Projects\cov-analysis-win64-7.7.0.4\cov-analysis-win64-7.7.0.4\bin')}" />

<property name="coverity.exe" value="${coverity.folder}/cov-build.exe" if="${property::exists('coverity.folder')}" />
<property name="coverity.exe" value="cov-build.exe" unless="${property::exists('coverity.exe')}" />

<property name="coverity.token" value="" />
<property name="coverity.token" value="${environment::get-variable('COVERITY_TOKEN')}" if="${environment::variable-exists('COVERITY_TOKEN')}" />
<property name="coverity.email" value="" />
<property name="coverity.email" value="${environment::get-variable('COVERITY_EMAIL')}" if="${environment::variable-exists('COVERITY_EMAIL')}" />

<property name="buildnumber.major" value="4" />
<property name="buildnumber.minor" value="6" />
<property name="buildnumber.build" value="${ci.buildNumber}" />
Expand Down Expand Up @@ -58,6 +67,21 @@
<call target="test-bdd" />
</target>

<target name="create-coverity-release" depends="clean-all, build-environment" if="${property::exists('coverity.exe')}">

<exec program="${coverity.exe}" commandline="--dir cov-int --encoding=UTF-8 build.bat build-release-platforms-x64" />

<exec program="${tools.folder}/7-Zip/7za.exe">
<arg value="a" />
<arg value="coverity.zip" />
<arg value="cov-int" />
</exec>

<exec program="${curl.exe}"
commandline='--form token=${coverity.token} --insecure --form email=${coverity.email} --form file=@coverity.zip --form version="${ci.buildNumber}" --form description="${ci.buildNumber}" https://scan.coverity.com/builds?project=OpenCover%2Fopencover' />

</target>

<target name="set-rc-property" >
<property name="buildnumber.ci" value="-rc" />
</target>
Expand Down
2 changes: 1 addition & 1 deletion main/.nuget/NuGet.targets
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>

Expand Down
4 changes: 2 additions & 2 deletions main/OpenCover.3rdParty.Signer/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
6 changes: 2 additions & 4 deletions main/OpenCover.3rdParty.Signer/CrashReporterSigner.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.IO;
using System.Linq;
using System.Reflection;
using Mono.Cecil;

namespace OpenCover.ThirdParty.Signer
Expand Down Expand Up @@ -45,8 +43,8 @@ public static void SignAssembly(string baseFolder)

File.Copy(assembly, newAssembly, true);
var definition = AssemblyDefinition.ReadAssembly(newAssembly);
var keyPair = new StrongNameKeyPair(new FileStream(key, FileMode.Open, FileAccess.Read));
definition.Write(newAssembly, new WriterParameters() { StrongNameKeyPair = keyPair });

definition.SignFile(newAssembly, key);
}
}
}
9 changes: 3 additions & 6 deletions main/OpenCover.3rdParty.Signer/GendarmeSigner.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.IO;
using System.Linq;
using System.Reflection;
using Mono.Cecil;

namespace OpenCover.ThirdParty.Signer
Expand Down Expand Up @@ -67,9 +66,7 @@ public static void SignGendarmeRulesMaintainability(string baseFolder)
definition.MainModule.AssemblyReferences.Add(frameworkAssemblyRef);
}

var keyPair = new StrongNameKeyPair(new FileStream(key, FileMode.Open, FileAccess.Read));
definition.Write(newAssembly, new WriterParameters() { StrongNameKeyPair = keyPair });

definition.SignFile(newAssembly, key);
}

public static void SignGendarmeFramework(string baseFolder)
Expand All @@ -83,8 +80,8 @@ public static void SignGendarmeFramework(string baseFolder)

File.Copy(assembly, newAssembly, true);
var definition = AssemblyDefinition.ReadAssembly(newAssembly);
var keyPair = new StrongNameKeyPair(new FileStream(key, FileMode.Open, FileAccess.Read));
definition.Write(newAssembly, new WriterParameters() { StrongNameKeyPair = keyPair });

definition.SignFile(newAssembly, key);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand All @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenCover.ThirdParty.Signer</RootNamespace>
<AssemblyName>OpenCover.3rdParty.Signer</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
Expand Down Expand Up @@ -69,6 +69,7 @@
<Compile Include="GendarmeSigner.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SigningExtensions.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
Expand Down
18 changes: 18 additions & 0 deletions main/OpenCover.3rdParty.Signer/SigningExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System.IO;
using System.Reflection;
using Mono.Cecil;

namespace OpenCover.ThirdParty.Signer
{
internal static class SigningExtensions
{
public static void SignFile(this AssemblyDefinition definition, string outputPath, string key)
{
using (var stream = new FileStream(key, FileMode.Open, FileAccess.Read))
{
var keyPair = new StrongNameKeyPair(stream);
definition.Write(outputPath, new WriterParameters() { StrongNameKeyPair = keyPair });
}
}
}
}
11 changes: 9 additions & 2 deletions main/OpenCover.Console/CrashReporter/SendRequestState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,17 @@ static private ExceptionInfo ConvertToExceptionInfo(Exception e, bool anonymous)
};
}

static private IPAddress GetGoogleDnsAddress()
{
using (var googleDns = new System.Net.Sockets.UdpClient("8.8.8.8", 53))
{
return ((IPEndPoint) googleDns.Client.LocalEndPoint).Address;
}
}

static private System.Net.NetworkInformation.PhysicalAddress GetMacAddress()
{
var googleDns = new System.Net.Sockets.UdpClient("8.8.8.8", 53);
var localAddress = ((IPEndPoint)googleDns.Client.LocalEndPoint).Address;
var localAddress = GetGoogleDnsAddress();

foreach (var netInterface in System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces())
{
Expand Down
7 changes: 5 additions & 2 deletions main/OpenCover.Console/OpenCover.Console.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
Expand All @@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenCover.Console</RootNamespace>
<AssemblyName>OpenCover.Console</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
Expand Down Expand Up @@ -115,6 +115,9 @@
<None Include="app.config">
<SubType>Designer</SubType>
</None>
<None Include="OpenCover.Console.ini">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
Expand Down
3 changes: 3 additions & 0 deletions main/OpenCover.Console/OpenCover.Console.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[.NET Framework Debugging Control]
GenerateTrackingInfo=1
AllowOptimize=0
Loading

0 comments on commit 7c36a1e

Please sign in to comment.