diff --git a/README.md b/README.md index e8b2e06de..4d671b5d4 100644 --- a/README.md +++ b/README.md @@ -12,35 +12,36 @@ The primary repo for the project is [on GitHub](https://github.com/opencover/ope ### Team communication [![Join the chat at https://gitter.im/OpenCover/opencover](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/OpenCover/opencover?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -Team communications can also be done via [slack](http://slack.com), raise an issue to request access (include your email - obfuscated if you wish) and we will send you an invite then just visit the [team page](https://opencover.slack.com/) to sign up and join the conversation. +### WIKI +Please review the [wiki pages](https://github.com/opencover/opencover/wiki/_pages) on how to use OpenCover and take particular interest in the [Usage guide](https://github.com/opencover/opencover/wiki/Usage). + +### Issues +Please raise issues on GitHub, if you can repeat the issue then please provide a sample to make it easier for us to also repeat it and then implement a fix. Please do not hijack unrelated issues, I would rather you create a new issue than add noise to an unrelated issue. + +[Dropbox](http://db.tt/VanqFDn) is very useful for sharing files alternatively you could create a [gist](https://gist.github.com/). ### Licence All Original Software is licensed under the [MIT Licence](https://github.com/opencover/opencover/blob/master/License.md) and does not apply to any other 3rd party tools, utilities or code which may be used to develop this application. If anyone is aware of any licence violations that this code may be making please inform the developers so that the issue can be investigated and rectified. -### WIKI -Please review the [wiki pages](https://github.com/opencover/opencover/wiki/_pages) on how to use OpenCover and take particular interest in the [Usage guide](https://github.com/opencover/opencover/wiki/Usage). +### Integration Test support +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). -### Service support -Note that .zip and .nuget packages (at least) will not ACL files so that a low-privilege service can execute them -- manually add the service principal with read/execute privilege to the OpenCover.Profiler.dll ACLs, either through explorer properties or by a `Get-Acl`/`Set-Acl` PowerShell script. +#### IIS support +Please refer to the wiki - [IIS Support](https://github.com/OpenCover/opencover/wiki/IIS-Support) -Launching the profiling operation must be done with Administrator privilege -- this is required to even start the service, and is also needed to create the global objects and set the per-service environment that registers the COM object. Assuming that the COM objects have been pre-registered, the command line to use is like +#### DNX support +Please refer to the wiki - [DNX Support](https://github.com/OpenCover/opencover/wiki/DNX-Support) - OpenCover.console.exe -service:byname -target: -output:coverage.xml - -As this is a blocking operation, launching the coverage gathering a separate process as +#### 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. - start-process OpenCover.console.exe @("-target:", "-service:byName", "-output:coverage.xml") - -or equivalent in your test scripts. +#### Service support +please refer to the wiki - [Service Support](https://github.com/OpenCover/opencover/wiki/Service-Support) -The `byname` qualifier is used to prevent races if multiple services are being started concurrently by injecting the OpenCover profiling information to the service specific environment. - -### Issues -Please raise issues on GitHub, if you can repeat the issue then please provide a sample to make it easier for us to also repeat it and then implement a fix. Please do not hijack unrelated issues, I would rather you create a new issue than add noise to an unrelated issue. - -[Dropbox](http://db.tt/VanqFDn) is very useful for sharing files alternatively you could create a [gist](https://gist.github.com/). +#### Silverlight support +Please refer to wiki - [Silverlight support](https://github.com/OpenCover/opencover/wiki/Silverlight-Support) ### Building You will need: @@ -85,7 +86,7 @@ I would like to thank * JetBrains for my Open Source [ReSharper licence](http://www.jetbrains.com/resharper/), * [AppVeyor](https://ci.appveyor.com/project/sawilde/opencover) for allowing free build CI services for Open Source projects, * [Coveralls](https://coveralls.io/r/OpenCover/opencover) for allowing free services for Open Source projects, -* NDepend for my [NDepend licence](http://www.ndepend.com/). +* NDepend for my [NDepend licence](http://www.ndepend.com/), * the guys at [CodeBetter](http://codebetter.com/), [Devlicious](http://devlicio.us/) and [Los Techies](http://lostechies.com/) who orignally arranged my MSDN licence all those years ago without which I doubt I'd have been able to start OpenCover (now no longer needed as we can build OpenCover using the VS2013 Community Edition), * the [NextGenUG](http://www.nxtgenug.net/) and their free swag from where I got lots of useful tools, diff --git a/ReleaseNotes.tmp b/ReleaseNotes.tmp index 3cc108b09..b32197fc1 100644 --- a/ReleaseNotes.tmp +++ b/ReleaseNotes.tmp @@ -1,4 +1,6 @@ Version [[version]] +#282 exclude by process (feature) +#246 auto crash reports (feature) #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) diff --git a/build/Version/opencover.gendarme.snk b/build/Version/opencover.3rdparty.snk similarity index 100% rename from build/Version/opencover.gendarme.snk rename to build/Version/opencover.3rdparty.snk diff --git a/main/.nuget/packages.config b/main/.nuget/packages.config index 6a2daf408..0d36bd4f6 100644 --- a/main/.nuget/packages.config +++ b/main/.nuget/packages.config @@ -1,5 +1,6 @@  + diff --git a/main/OpenCover.Gendarme.Signer/App.config b/main/OpenCover.3rdParty.Signer/App.config similarity index 100% rename from main/OpenCover.Gendarme.Signer/App.config rename to main/OpenCover.3rdParty.Signer/App.config diff --git a/main/OpenCover.3rdParty.Signer/CrashReporterSigner.cs b/main/OpenCover.3rdParty.Signer/CrashReporterSigner.cs new file mode 100644 index 000000000..e4e2f4bbc --- /dev/null +++ b/main/OpenCover.3rdParty.Signer/CrashReporterSigner.cs @@ -0,0 +1,52 @@ +using System.IO; +using System.Linq; +using System.Reflection; +using Mono.Cecil; + +namespace OpenCover.ThirdParty.Signer +{ + internal static class CrashReporterSigner + { + + private const string Version = "1.5"; + + private static readonly string GendarmeAssemblyName = string.Format("CrashReporterdotNet.{0}", Version); + + public static readonly string TargetFolder = Path.Combine("..", "tools", "CrashReporterSigned"); + private static readonly string SourceFolder = Path.Combine("packages", GendarmeAssemblyName, "lib", "net20"); + private static readonly string StrongNameKey = Path.Combine("..", "build", "Version", "opencover.3rdparty.snk"); + + + public static bool AlreadySigned(string baseFolder) + { + var frameworkAssembly = Path.Combine(baseFolder, TargetFolder, "CrashReporter.NET.dll"); + if (File.Exists(frameworkAssembly)) + { + try + { + var frameworkDefinition = AssemblyDefinition.ReadAssembly(frameworkAssembly); + return frameworkDefinition.Name.HasPublicKey; + } + catch + { + } + } + return false; + } + + public static void SignAssembly(string baseFolder) + { + var key = Path.Combine(baseFolder, StrongNameKey); + var assembly = Path.Combine(baseFolder, SourceFolder, "CrashReporter.NET.dll"); + var newAssembly = Path.Combine(baseFolder, TargetFolder, "CrashReporter.NET.dll"); + + assembly = Path.GetFullPath(assembly); + newAssembly = Path.GetFullPath(newAssembly); + + 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 }); + } + } +} \ No newline at end of file diff --git a/main/OpenCover.Gendarme.Signer/Program.cs b/main/OpenCover.3rdParty.Signer/GendarmeSigner.cs similarity index 67% rename from main/OpenCover.Gendarme.Signer/Program.cs rename to main/OpenCover.3rdParty.Signer/GendarmeSigner.cs index 8ae24e077..cc88103d8 100644 --- a/main/OpenCover.Gendarme.Signer/Program.cs +++ b/main/OpenCover.3rdParty.Signer/GendarmeSigner.cs @@ -1,48 +1,23 @@ -using System; -using System.Collections.Generic; -using System.IO; +using System.IO; using System.Linq; using System.Reflection; -using System.Text; -using System.Threading.Tasks; using Mono.Cecil; -namespace OpenCover.Gendarme.Signer +namespace OpenCover.ThirdParty.Signer { - class Program + internal static class GendarmeSigner { - private const string GendarmeVersion = "2.11.0.20121120"; - private static readonly string GendarmeAssemblyName = string.Format("Mono.Gendarme.{0}", GendarmeVersion); + private const string GendarmeVersion = "2.11.0.20121120"; - private static readonly string TargetFolder = Path.Combine("..", "tools", "GendarmeSigned"); - private static readonly string SourceFolder = Path.Combine("packages", GendarmeAssemblyName, "tools"); - private static readonly string StrongNameKey = Path.Combine("..", "build", "Version", "opencover.gendarme.snk"); - - static void Main(string[] args) - { - var assemblyLocation = Assembly.GetAssembly (typeof(Program)).Location; - var assemblyFolder = Path.GetDirectoryName(assemblyLocation); - var baseFolder = Path.Combine(assemblyFolder, "..", "..", ".."); + private static readonly string GendarmeAssemblyName = string.Format("Mono.Gendarme.{0}", GendarmeVersion); - var targetDirectory = Path.Combine (baseFolder, TargetFolder); - if (!Directory.Exists(targetDirectory)) - Directory.CreateDirectory (targetDirectory); - - if (AlreadySigned(baseFolder)) - { - Console.WriteLine("Gendarme Framework is already Signed"); - return; - } - - Console.WriteLine("Signing Gendarme Framework"); - SignGendarmeFramework(baseFolder); + public static readonly string TargetFolder = Path.Combine("..", "tools", "GendarmeSigned"); + private static readonly string SourceFolder = Path.Combine("packages", GendarmeAssemblyName, "tools"); + private static readonly string StrongNameKey = Path.Combine("..", "build", "Version", "opencover.3rdparty.snk"); - Console.WriteLine("Signing Gendarme Rules Maintainability"); - SignGendarmeRulesMaintainability(baseFolder); - } - private static bool AlreadySigned(string baseFolder) + public static bool AlreadySigned(string baseFolder) { var frameworkAssembly = Path.Combine(baseFolder, TargetFolder, "Gendarme.Framework.dll"); if (File.Exists(frameworkAssembly)) @@ -59,7 +34,7 @@ private static bool AlreadySigned(string baseFolder) return false; } - private static void SignGendarmeRulesMaintainability(string baseFolder) + public static void SignGendarmeRulesMaintainability(string baseFolder) { var frameworkAssembly = Path.Combine(baseFolder, TargetFolder, "Gendarme.Framework.dll"); var frameworkDefinition = AssemblyDefinition.ReadAssembly(frameworkAssembly); @@ -97,7 +72,7 @@ private static void SignGendarmeRulesMaintainability(string baseFolder) } - private static void SignGendarmeFramework(string baseFolder) + public static void SignGendarmeFramework(string baseFolder) { var key = Path.Combine(baseFolder, StrongNameKey); var assembly = Path.Combine(baseFolder, SourceFolder, "Gendarme.Framework.dll"); @@ -112,4 +87,4 @@ private static void SignGendarmeFramework(string baseFolder) definition.Write(newAssembly, new WriterParameters() { StrongNameKeyPair = keyPair }); } } -} +} \ No newline at end of file diff --git a/main/OpenCover.Gendarme.Signer/OpenCover.Gendarme.Signer.csproj b/main/OpenCover.3rdParty.Signer/OpenCover.3rdParty.Signer.csproj similarity index 90% rename from main/OpenCover.Gendarme.Signer/OpenCover.Gendarme.Signer.csproj rename to main/OpenCover.3rdParty.Signer/OpenCover.3rdParty.Signer.csproj index 7582c303e..484dbfabb 100644 --- a/main/OpenCover.Gendarme.Signer/OpenCover.Gendarme.Signer.csproj +++ b/main/OpenCover.3rdParty.Signer/OpenCover.3rdParty.Signer.csproj @@ -7,8 +7,8 @@ {0B94C4BF-762B-4722-BF5A-30E7F6D2CB7E} Exe Properties - OpenCover.Gendarme.Signer - OpenCover.Gendarme.Signer + OpenCover.ThirdParty.Signer + OpenCover.3rdParty.Signer v4.0 512 ..\ @@ -65,6 +65,8 @@ + + @@ -79,6 +81,10 @@ $(SolutionDir)OpenCover.Gendarme.Signer\bin\$(ConfigurationName)\OpenCover.Gendarme.Signer.exe mono OpenCover.Gendarme.Signer.exe + + cd $(SolutionDir)OpenCover.3rdParty.Signer\bin\$(ConfigurationName) +$(SolutionDir)OpenCover.3rdParty.Signer\bin\$(ConfigurationName)\OpenCover.3rdParty.Signer.exe +