Add results directory arg to dotnet test

This commit is contained in:
Satya Madala 2017-01-19 11:27:37 +05:30
parent 49c2a4b6b6
commit 44b14f987e
2 changed files with 12 additions and 0 deletions

View file

@ -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>";
}
}

View file

@ -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()}");