You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NuGetFrameworksVersion is defined here https://github.com/microsoft/vstest/blob/9a0c41811637edf4afe0e265e08fdd1cb18109ed/eng/Versions.props#L94C1-L94C1
Copy file name to clipboardexpand all lines: src/coverlet.console/Program.cs
+60-53
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,8 @@
4
4
usingSystem;
5
5
usingSystem.Collections.Generic;
6
6
usingSystem.CommandLine;
7
+
usingSystem.CommandLine.Help;
8
+
usingSystem.CommandLine.Parsing;
7
9
usingSystem.ComponentModel;
8
10
usingSystem.Diagnostics;
9
11
usingSystem.Globalization;
@@ -25,32 +27,33 @@ namespace Coverlet.Console
25
27
{
26
28
publicstaticclassProgram
27
29
{
28
-
staticintMain(string[]args)
30
+
staticasyncTaskMain(string[]args)
29
31
{
30
-
varmoduleOrAppDirectory=newArgument<string>("path","Path to the test assembly or application directory.");
31
-
vartarget=newOption<string>(new[]{"--target","-t"},"Path to the test runner application."){Arity=ArgumentArity.ZeroOrOne,IsRequired=true};
32
-
vartargs=newOption<string>(new[]{"--targetargs","-a"},"Arguments to be passed to the test runner."){Arity=ArgumentArity.ZeroOrOne};
33
-
varoutput=newOption<string>(new[]{"--output","-o"},"Output of the generated coverage report"){Arity=ArgumentArity.ZeroOrOne};
34
-
varverbosity=newOption<LogLevel>(new[]{"--verbosity","-v"},()=>LogLevel.Normal,"Sets the verbosity level of the command. Allowed values are quiet, minimal, normal, detailed."){Arity=ArgumentArity.ZeroOrOne};
35
-
varformats=newOption<string[]>(new[]{"--format","-f"},()=>new[]{"json"},"Format of the generated coverage report."){Arity=ArgumentArity.ZeroOrMore,AllowMultipleArgumentsPerToken=true};
36
-
varthreshold=newOption<string>("--threshold","Exits with error if the coverage % is below value."){Arity=ArgumentArity.ZeroOrOne};
37
-
varthresholdTypes=newOption<List<string>>("--threshold-type",()=>newList<string>(newstring[]{"line","branch","method"}),"Coverage type to apply the threshold to.").FromAmong("line","branch","method");
38
-
varthresholdStat=newOption<ThresholdStatistic>("--threshold-stat",()=>ThresholdStatistic.Minimum,"Coverage statistic used to enforce the threshold value."){Arity=ArgumentArity.ZeroOrOne};
39
-
varexcludeFilters=newOption<string[]>("--exclude","Filter expressions to exclude specific modules and types."){Arity=ArgumentArity.ZeroOrMore,AllowMultipleArgumentsPerToken=true};
40
-
varincludeFilters=newOption<string[]>("--include","Filter expressions to include only specific modules and types."){Arity=ArgumentArity.ZeroOrMore,AllowMultipleArgumentsPerToken=true};
41
-
varexcludedSourceFiles=newOption<string[]>("--exclude-by-file","Glob patterns specifying source files to exclude."){Arity=ArgumentArity.ZeroOrMore,AllowMultipleArgumentsPerToken=true};
42
-
varincludeDirectories=newOption<string[]>("--include-directory","Include directories containing additional assemblies to be instrumented."){Arity=ArgumentArity.ZeroOrMore,AllowMultipleArgumentsPerToken=true};
43
-
varexcludeAttributes=newOption<string[]>("--exclude-by-attribute","Attributes to exclude from code coverage."){Arity=ArgumentArity.ZeroOrMore,AllowMultipleArgumentsPerToken=true};
44
-
varincludeTestAssembly=newOption<bool>("--include-test-assembly","Specifies whether to report code coverage of the test assembly."){Arity=ArgumentArity.Zero};
45
-
varsingleHit=newOption<bool>("--single-hit","Specifies whether to limit code coverage hit reporting to a single hit for each location"){Arity=ArgumentArity.Zero};
46
-
varskipAutoProp=newOption<bool>("--skipautoprops","Neither track nor record auto-implemented properties."){Arity=ArgumentArity.Zero};
47
-
varmergeWith=newOption<string>("--merge-with","Path to existing coverage result to merge."){Arity=ArgumentArity.ZeroOrOne};
48
-
varuseSourceLink=newOption<bool>("--use-source-link","Specifies whether to use SourceLink URIs in place of file system paths."){Arity=ArgumentArity.Zero};
49
-
vardoesNotReturnAttributes=newOption<string[]>("--does-not-return-attribute","Attributes that mark methods that do not return"){Arity=ArgumentArity.ZeroOrMore,AllowMultipleArgumentsPerToken=true};
50
-
varexcludeAssembliesWithoutSources=newOption<string>("--exclude-assemblies-without-sources","Specifies behaviour of heuristic to ignore assemblies with missing source documents."){Arity=ArgumentArity.ZeroOrOne};
51
-
varsourceMappingFile=newOption<string>("--source-mapping-file","Specifies the path to a SourceRootsMappings file."){Arity=ArgumentArity.ZeroOrOne};
52
-
53
-
RootCommandrootCommand=new()
32
+
CliArgument<string>moduleOrAppDirectory=new("path"){Description="Path to the test assembly or application directory."};
33
+
CliOption<string>target=new("--target",aliases:new[]{"--target","-t"}){Description="Path to the test runner application.",Arity=ArgumentArity.ZeroOrOne,Required=true};
34
+
CliOption<string>targs=new("--targetargs",aliases:new[]{"--targetargs","-a"}){Description="Arguments to be passed to the test runner.",Arity=ArgumentArity.ZeroOrOne};
35
+
CliOption<string>output=new("--output",aliases:new[]{"--output","-o"}){Description="Output of the generated coverage report",Arity=ArgumentArity.ZeroOrOne};
36
+
CliOption<LogLevel>verbosity=new("--verbosity",aliases:new[]{"--verbosity","-v"}){DefaultValueFactory=(_)=>LogLevel.Normal,Description="Sets the verbosity level of the command. Allowed values are quiet, minimal, normal, detailed.",Arity=ArgumentArity.ZeroOrOne};
37
+
CliOption<string[]>formats=new("--format",aliases:new[]{"--format","-f"}){DefaultValueFactory=(_)=>new[]{"json"},Description="Format of the generated coverage report.",Arity=ArgumentArity.ZeroOrMore,AllowMultipleArgumentsPerToken=true};
38
+
CliOption<string>threshold=new("--threshold"){Description="Exits with error if the coverage % is below value.",Arity=ArgumentArity.ZeroOrOne};
39
+
CliOption<List<string>>thresholdTypes=new("--threshold-type"){DefaultValueFactory=(_)=>newList<string>(newstring[]{"line","branch","method"}),Description=("Coverage type to apply the threshold to.")};
CliOption<ThresholdStatistic>thresholdStat=new("--threshold-stat"){DefaultValueFactory=(_)=>ThresholdStatistic.Minimum,Description="Coverage statistic used to enforce the threshold value.",Arity=ArgumentArity.ZeroOrOne};
42
+
CliOption<string[]>excludeFilters=new("--exclude"){Description="Filter expressions to exclude specific modules and types.",Arity=ArgumentArity.ZeroOrMore,AllowMultipleArgumentsPerToken=true};
43
+
CliOption<string[]>includeFilters=new("--include"){Description="Filter expressions to include only specific modules and types.",Arity=ArgumentArity.ZeroOrMore,AllowMultipleArgumentsPerToken=true};
44
+
CliOption<string[]>excludedSourceFiles=new("--exclude-by-file"){Description="Glob patterns specifying source files to exclude.",Arity=ArgumentArity.ZeroOrMore,AllowMultipleArgumentsPerToken=true};
45
+
CliOption<string[]>includeDirectories=new("--include-directory"){Description="Include directories containing additional assemblies to be instrumented.",Arity=ArgumentArity.ZeroOrMore,AllowMultipleArgumentsPerToken=true};
46
+
CliOption<string[]>excludeAttributes=new("--exclude-by-attribute"){Description="Attributes to exclude from code coverage.",Arity=ArgumentArity.ZeroOrMore,AllowMultipleArgumentsPerToken=true};
47
+
CliOption<bool>includeTestAssembly=new("--include-test-assembly"){Description="Specifies whether to report code coverage of the test assembly.",Arity=ArgumentArity.Zero};
48
+
CliOption<bool>singleHit=new("--single-hit"){Description="Specifies whether to limit code coverage hit reporting to a single hit for each location",Arity=ArgumentArity.Zero};
49
+
CliOption<bool>skipAutoProp=new("--skipautoprops"){Description="Neither track nor record auto-implemented properties.",Arity=ArgumentArity.Zero};
50
+
CliOption<string>mergeWith=new("--merge-with"){Description="Path to existing coverage result to merge.",Arity=ArgumentArity.ZeroOrOne};
51
+
CliOption<bool>useSourceLink=new("--use-source-link"){Description="Specifies whether to use SourceLink URIs in place of file system paths.",Arity=ArgumentArity.Zero};
52
+
CliOption<string[]>doesNotReturnAttributes=new("--does-not-return-attribute"){Description="Attributes that mark methods that do not return",Arity=ArgumentArity.ZeroOrMore,AllowMultipleArgumentsPerToken=true};
53
+
CliOption<string>excludeAssembliesWithoutSources=new("--exclude-assemblies-without-sources"){Description="Specifies behaviour of heuristic to ignore assemblies with missing source documents.",Arity=ArgumentArity.ZeroOrOne};
54
+
CliOption<string>sourceMappingFile=new("--source-mapping-file"){Description="Specifies the path to a SourceRootsMappings file.",Arity=ArgumentArity.ZeroOrOne};
0 commit comments