Add results directory arg to dotnet test
This commit is contained in:
parent
49c2a4b6b6
commit
44b14f987e
2 changed files with 12 additions and 0 deletions
|
@ -55,5 +55,7 @@
|
|||
|
||||
public const string RunSettingsArgsHelpText = @"Any extra commandline runsettings arguments that should be passed to vstest. See 'dotnet vstest --help' for available options.
|
||||
Example: -- RunConfiguration.ResultsDirectory=""C:\users\user\desktop\Results Directory"" MSTest.DeploymentEnabled=false";
|
||||
public const string CmdResultsDirectoryDescription = @"Test results directory will be created in specified path if not exists.
|
||||
Example: --results-directory <PATH_TO_RESULTS_DIRECTORY>";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,6 +83,11 @@ namespace Microsoft.DotNet.Tools.Test
|
|||
LocalizableStrings.CmdNoBuildDescription,
|
||||
CommandOptionType.NoValue);
|
||||
|
||||
var resultsDirectoryOption = cmd.Option(
|
||||
"-r|--results-directory",
|
||||
LocalizableStrings.CmdResultsDirectoryDescription,
|
||||
CommandOptionType.SingleValue);
|
||||
|
||||
CommandOption verbosityOption = MSBuildForwardingApp.AddVerbosityOption(cmd);
|
||||
|
||||
cmd.OnExecute(() =>
|
||||
|
@ -129,6 +134,11 @@ namespace Microsoft.DotNet.Tools.Test
|
|||
msbuildArgs.Add($"/p:TargetFramework={frameworkOption.Value()}");
|
||||
}
|
||||
|
||||
if (resultsDirectoryOption.HasValue())
|
||||
{
|
||||
msbuildArgs.Add($"/p:VSTestResultsDirectory={resultsDirectoryOption.Value()}");
|
||||
}
|
||||
|
||||
if (outputOption.HasValue())
|
||||
{
|
||||
msbuildArgs.Add($"/p:OutputPath={outputOption.Value()}");
|
||||
|
|
Loading…
Reference in a new issue