Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Commit

Permalink
Merge pull request #5391 from smadala/add-rd
Browse files Browse the repository at this point in the history
Add results directory arg to dotnet test
  • Loading branch information
Livar authored Jan 21, 2017
2 parents b2c51b7 + 4bd8344 commit 8af06ac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/dotnet/commands/dotnet-test/LocalizableStrings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,7 @@ internal class LocalizableStrings

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>";
}
}
10 changes: 10 additions & 0 deletions src/dotnet/commands/dotnet-test/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ public static int Run(string[] args)
LocalizableStrings.CmdNoBuildDescription,
CommandOptionType.NoValue);

var resultsDirectoryOption = cmd.Option(
"-r|--results-directory",
LocalizableStrings.CmdResultsDirectoryDescription,
CommandOptionType.SingleValue);

CommandOption verbosityOption = MSBuildForwardingApp.AddVerbosityOption(cmd);

cmd.OnExecute(() =>
Expand Down Expand Up @@ -129,6 +134,11 @@ public static int Run(string[] args)
msbuildArgs.Add($"/p:TargetFramework={frameworkOption.Value()}");
}

if (resultsDirectoryOption.HasValue())
{
msbuildArgs.Add($"/p:VSTestResultsDirectory={resultsDirectoryOption.Value()}");
}

if (outputOption.HasValue())
{
msbuildArgs.Add($"/p:OutputPath={outputOption.Value()}");
Expand Down

0 comments on commit 8af06ac

Please sign in to comment.