diff --git a/AxoCover/Models/AxoTestRunner.cs b/AxoCover/Models/AxoTestRunner.cs
index 70d9d5d..4ea41f5 100644
--- a/AxoCover/Models/AxoTestRunner.cs
+++ b/AxoCover/Models/AxoTestRunner.cs
@@ -57,6 +57,8 @@ protected override TestReport RunTests(TestItem testItem, bool isCovering, bool
IsCoveringByTest = _options.IsCoveringByTest,
IsIncludingSolutionAssemblies = _options.IsIncludingSolutionAssemblies,
IsExcludingTestAssemblies = _options.IsExcludingTestAssemblies,
+ IsMergingByHash = _options.IsMergingByHash,
+ IsSkippingAutoProps = _options.IsSkippingAutoProps,
ExcludeAttributes = _options.ExcludeAttributes,
ExcludeDirectories = _options.ExcludeDirectories,
ExcludeFiles = _options.ExcludeFiles,
diff --git a/AxoCover/Models/Data/OpenCoverOptions.cs b/AxoCover/Models/Data/OpenCoverOptions.cs
index a2b97b1..f9adf69 100644
--- a/AxoCover/Models/Data/OpenCoverOptions.cs
+++ b/AxoCover/Models/Data/OpenCoverOptions.cs
@@ -10,6 +10,8 @@ public class OpenCoverOptions
public bool IsCoveringByTest { get; set; }
public bool IsIncludingSolutionAssemblies { get; set; }
public bool IsExcludingTestAssemblies { get; set; }
+ public bool IsMergingByHash { get; set; }
+ public bool IsSkippingAutoProps { get; set; }
public string ExcludeAttributes { get; set; }
public string ExcludeFiles { get; set; }
public string ExcludeDirectories { get; set; }
diff --git a/AxoCover/Models/IOptions.cs b/AxoCover/Models/IOptions.cs
index 8404d4e..a742e63 100644
--- a/AxoCover/Models/IOptions.cs
+++ b/AxoCover/Models/IOptions.cs
@@ -1,7 +1,7 @@
-using System;
+using AxoCover.Common.Settings;
+using System;
using System.ComponentModel;
using System.Windows.Media;
-using AxoCover.Common.Settings;
namespace AxoCover.Models
{
@@ -36,6 +36,8 @@ public interface IOptions
TestPlatform TestPlatform { get; set; }
string TestRunner { get; set; }
Color UncoveredColor { get; set; }
+ bool IsMergingByHash { get; set; }
+ bool IsSkippingAutoProps { get; set; }
event PropertyChangedEventHandler PropertyChanged;
}
diff --git a/AxoCover/Models/OpenCoverProcessInfo.cs b/AxoCover/Models/OpenCoverProcessInfo.cs
index e96a29a..124f8c6 100644
--- a/AxoCover/Models/OpenCoverProcessInfo.cs
+++ b/AxoCover/Models/OpenCoverProcessInfo.cs
@@ -42,13 +42,23 @@ public string FilePath
public OpenCoverProcessInfo(OpenCoverOptions options)
{
CoverageReportPath = options.CoverageReportPath;
- _baseArguments = GetSettingsBasedArguments(options) + $"-mergebyhash -output:\"{options.CoverageReportPath}\" -register:user";
+ _baseArguments = GetSettingsBasedArguments(options) + $" -output:\"{options.CoverageReportPath}\" -register:user";
}
private static string GetSettingsBasedArguments(OpenCoverOptions options)
{
var arguments = string.Empty;
+ if (options.IsMergingByHash)
+ {
+ arguments += " -mergebyhash";
+ }
+
+ if (options.IsSkippingAutoProps)
+ {
+ arguments += " -skipautoprops";
+ }
+
if (options.IsCoveringByTest)
{
arguments += " -coverbytest:" + string.Join(";", options.TestAssemblies.Select(p => "*" + p + "*"));
diff --git a/AxoCover/Models/Options.cs b/AxoCover/Models/Options.cs
index 9e7b5bb..41848ef 100644
--- a/AxoCover/Models/Options.cs
+++ b/AxoCover/Models/Options.cs
@@ -85,6 +85,18 @@ public bool IsCoveringByTest
get { return Settings.Default.IsCoveringByTest; }
set { Settings.Default.IsCoveringByTest = value; }
}
+
+ public bool IsMergingByHash
+ {
+ get { return Settings.Default.IsMergingByHash; }
+ set { Settings.Default.IsMergingByHash = value; }
+ }
+
+ public bool IsSkippingAutoProps
+ {
+ get { return Settings.Default.IsSkippingAutoProps; }
+ set { Settings.Default.IsSkippingAutoProps = value; }
+ }
#endregion
#region Visualization settings
diff --git a/AxoCover/Properties/Settings.Designer.cs b/AxoCover/Properties/Settings.Designer.cs
index 8eb4b47..91e2683 100644
--- a/AxoCover/Properties/Settings.Designer.cs
+++ b/AxoCover/Properties/Settings.Designer.cs
@@ -346,5 +346,29 @@ public string TestSettings {
this["TestSettings"] = value;
}
}
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("True")]
+ public bool IsMergingByHash {
+ get {
+ return ((bool)(this["IsMergingByHash"]));
+ }
+ set {
+ this["IsMergingByHash"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("True")]
+ public bool IsSkippingAutoProps {
+ get {
+ return ((bool)(this["IsSkippingAutoProps"]));
+ }
+ set {
+ this["IsSkippingAutoProps"] = value;
+ }
+ }
}
}
diff --git a/AxoCover/Properties/Settings.settings b/AxoCover/Properties/Settings.settings
index 218cc6f..140979d 100644
--- a/AxoCover/Properties/Settings.settings
+++ b/AxoCover/Properties/Settings.settings
@@ -86,5 +86,11 @@
+
+ True
+
+
+ True
+
\ No newline at end of file
diff --git a/AxoCover/Resources.Designer.cs b/AxoCover/Resources.Designer.cs
index 935e942..c7f1014 100644
--- a/AxoCover/Resources.Designer.cs
+++ b/AxoCover/Resources.Designer.cs
@@ -600,6 +600,42 @@ public static string IsIncludingSolutionAssemblies {
}
}
+ ///
+ /// Looks up a localized string similar to Merge by hash.
+ ///
+ public static string IsMergingByHash {
+ get {
+ return ResourceManager.GetString("IsMergingByHash", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Under some scenarios e.g. using MSTest, an assembly may be loaded many times from different locations. This option is used to merge the coverage results for an assembly regardless of where it was loaded assuming the assembly has the same file-hash in each location..
+ ///
+ public static string IsMergingByHashDescription {
+ get {
+ return ResourceManager.GetString("IsMergingByHashDescription", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Skip auto properties.
+ ///
+ public static string IsSkippingAutoProps {
+ get {
+ return ResourceManager.GetString("IsSkippingAutoProps", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Neither track nor record auto-implemented properties. That is, skip getters and setters like these: public bool Service { get; set; }.
+ ///
+ public static string IsSkippingAutoPropsDescription {
+ get {
+ return ResourceManager.GetString("IsSkippingAutoPropsDescription", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Jump to test.
///
diff --git a/AxoCover/Resources.resx b/AxoCover/Resources.resx
index 7b0d95c..d738dee 100644
--- a/AxoCover/Resources.resx
+++ b/AxoCover/Resources.resx
@@ -480,4 +480,16 @@
Build version is {0}, please reference this in your feedback.
+
+ Merge by hash
+
+
+ Under some scenarios e.g. using MSTest, an assembly may be loaded many times from different locations. This option is used to merge the coverage results for an assembly regardless of where it was loaded assuming the assembly has the same file-hash in each location.
+
+
+ Skip auto properties
+
+
+ Neither track nor record auto-implemented properties. That is, skip getters and setters like these: public bool Service { get; set; }
+
\ No newline at end of file
diff --git a/AxoCover/Views/SettingsView.xaml b/AxoCover/Views/SettingsView.xaml
index c054572..0594f9c 100644
--- a/AxoCover/Views/SettingsView.xaml
+++ b/AxoCover/Views/SettingsView.xaml
@@ -160,6 +160,10 @@
+
+
+
+
diff --git a/AxoCover/app.config b/AxoCover/app.config
index 082f9a9..7097896 100644
--- a/AxoCover/app.config
+++ b/AxoCover/app.config
@@ -82,6 +82,12 @@
+
+ True
+
+
+ True
+
diff --git a/AxoCover/source.extension.vsixmanifest b/AxoCover/source.extension.vsixmanifest
index dd3b5f6..6eff333 100644
--- a/AxoCover/source.extension.vsixmanifest
+++ b/AxoCover/source.extension.vsixmanifest
@@ -1,7 +1,7 @@
-
+
AxoCover
Nice and free .Net code coverage support for Visual Studio with OpenCover.
https://marketplace.visualstudio.com/items?itemName=axodox1.AxoCover