Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions AxoCover/Models/Storage/IOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public interface IOptions
int DebuggerTimeout { get; set; }
bool IsDebugModeEnabled { get; set; }
bool IsAutoBuildEnabled { get; set; }
string RegisterAs { get; set; }

event PropertyChangedEventHandler PropertyChanged;
}
Expand Down
6 changes: 6 additions & 0 deletions AxoCover/Models/Storage/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ public int VisitorCountLimit
get { return Settings.Default.VisitorCountLimit; }
set { Settings.Default.VisitorCountLimit = value; }
}

public string RegisterAs
{
get { return Settings.Default.RegisterAs; }
set { Settings.Default.RegisterAs = value; }
}
#endregion

#region Visualization settings
Expand Down
3 changes: 2 additions & 1 deletion AxoCover/Models/Testing/Data/OpenCoverOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class OpenCoverOptions
public string ExcludeDirectories { get; set; }
public string Filters { get; set; }
public bool IsVisitorCountLimited { get; set; }
public int VisitorCountLimit { get; set; }
public int VisitorCountLimit { get; set; }
public string RegisterAs { get; set; }
}
}
5 changes: 4 additions & 1 deletion AxoCover/Models/Testing/Execution/AxoTestRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.Principal;
using System.Threading;

namespace AxoCover.Models.Testing.Execution
Expand Down Expand Up @@ -85,7 +86,9 @@ protected override TestReport RunTests(TestItem testItem, bool isCovering, bool
Filters = _options.Filters,
IsVisitorCountLimited = _options.IsVisitorCountLimited,
VisitorCountLimit = _options.VisitorCountLimit,
PdbDirectories = solution.Children.OfType<TestProject>().Select(p => p.OutputDirectory)
PdbDirectories = solution.Children.OfType<TestProject>().Select(p => p.OutputDirectory),
RegisterAs = !string.IsNullOrWhiteSpace(_options.RegisterAs) ? _options.RegisterAs :
new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator) ? "administrator" : "user"
};
hostProcessInfo = new OpenCoverProcessInfo(openCoverOptions);
}
Expand Down
2 changes: 1 addition & 1 deletion AxoCover/Models/Testing/Execution/OpenCoverProcessInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public string FilePath
public OpenCoverProcessInfo(OpenCoverOptions options)
{
CoverageReportPath = options.CoverageReportPath;
_baseArguments = GetSettingsBasedArguments(options) + $" -output:\"{options.CoverageReportPath}\" -register:user";
_baseArguments = GetSettingsBasedArguments(options) + $" -output:\"{options.CoverageReportPath}\" -register:{options.RegisterAs}";
}

private static string GetSettingsBasedArguments(OpenCoverOptions options)
Expand Down
12 changes: 12 additions & 0 deletions AxoCover/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions AxoCover/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -140,5 +140,8 @@
<Setting Name="IsShowingAnchors" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="RegisterAs" Type="System.String" Scope="User">
<Value Profile="(Default)">user</Value>
</Setting>
</Settings>
</SettingsFile>
18 changes: 18 additions & 0 deletions AxoCover/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions AxoCover/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -672,4 +672,10 @@
<data name="OpenCoverageFailed" xml:space="preserve">
<value>Cannot import OpenCover coverage file {0}.</value>
</data>
<data name="RegisterAs" xml:space="preserve">
<value>Register coverage profiler as</value>
</data>
<data name="RegisterAsDescription" xml:space="preserve">
<value>User under which OpenCover coverage profiler gets registered. Empty value will setup type of user "administrator" or "user" based on IDE current user.</value>
</data>
</root>
5 changes: 5 additions & 0 deletions AxoCover/Views/SettingsView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,11 @@
<TextBlock Text="{x:Static res:Resources.IsSkippingAutoPropsDescription}" Style="{StaticResource Description}"/>
<Separator/>

<TextBlock Text="{x:Static res:Resources.RegisterAs}" Style="{StaticResource SubHeader}"/>
<TextBlock Text="{x:Static res:Resources.RegisterAsDescription}" Style="{StaticResource Description}"/>
<controls:ListEditor Margin="3" Value="{Binding Options.RegisterAs}"/>
<Separator/>

<DockPanel>
<TextBox Text="{Binding Options.VisitorCountLimit, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center" DockPanel.Dock="Right" IsEnabled="{Binding IsChecked, ElementName=_IsVisitorCountLimitedCheckBox}"/>
<CheckBox x:Name="_IsVisitorCountLimitedCheckBox" Content="{x:Static res:Resources.IsVisitorCountLimited}" IsChecked="{Binding Options.IsVisitorCountLimited}" Margin="3"/>
Expand Down
3 changes: 3 additions & 0 deletions AxoCover/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@
<setting name="IsShowingAnchors" serializeAs="String">
<value>True</value>
</setting>
<setting name="RegisterAs" serializeAs="String">
<value>user</value>
</setting>
</AxoCover.Properties.Settings>
</userSettings>
<applicationSettings>
Expand Down