Pass through test options to msbuild

This commit is contained in:
Piotr Puszkiewicz 2017-03-10 13:49:49 -08:00
parent e1568bbc1e
commit df3c08b645
4 changed files with 10 additions and 6 deletions

View file

@ -13,7 +13,6 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<TestTaskEnvironmentVariables Include="PATH=$(ExecPath)" />
<TestTaskEnvironmentVariables Include="TEST_ARTIFACTS=$(TestArtifactsDir)" /> <TestTaskEnvironmentVariables Include="TEST_ARTIFACTS=$(TestArtifactsDir)" />
</ItemGroup> </ItemGroup>

View file

@ -33,7 +33,7 @@ namespace Microsoft.DotNet.Tools.Restore
result.ShowHelpIfRequested(); result.ShowHelpIfRequested();
var restore = result["dotnet"]["restore"]; var parsedRestore = result["dotnet"]["restore"];
var msbuildArgs = new List<string> var msbuildArgs = new List<string>
{ {
@ -42,9 +42,9 @@ namespace Microsoft.DotNet.Tools.Restore
"/ConsoleLoggerParameters:Verbosity=Minimal" "/ConsoleLoggerParameters:Verbosity=Minimal"
}; };
msbuildArgs.AddRange(restore.OptionValuesToBeForwarded()); msbuildArgs.AddRange(parsedRestore.OptionValuesToBeForwarded());
msbuildArgs.AddRange(restore.Arguments); msbuildArgs.AddRange(parsedRestore.Arguments);
return new RestoreCommand(msbuildArgs, msbuildPath); return new RestoreCommand(msbuildArgs, msbuildPath);
} }

View file

@ -2,10 +2,10 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System; using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Collections.Generic;
using Microsoft.DotNet.Cli; using Microsoft.DotNet.Cli;
using Microsoft.DotNet.Cli.CommandLine; using Microsoft.DotNet.Cli.CommandLine;
using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Cli.Utils;
@ -40,6 +40,10 @@ namespace Microsoft.DotNet.Tools.Test
var parsedTest = result["dotnet"]["test"]; var parsedTest = result["dotnet"]["test"];
msbuildArgs.AddRange(parsedTest.OptionValuesToBeForwarded());
msbuildArgs.AddRange(parsedTest.Arguments);
var runSettingsOptions = var runSettingsOptions =
result.UnparsedTokens result.UnparsedTokens
.Select(t => GetSemiColonEsacpedstring(t)); .Select(t => GetSemiColonEsacpedstring(t));

View file

@ -10,7 +10,8 @@ namespace Microsoft.DotNet.Cli
public static Command Test() => public static Command Test() =>
Create.Command( Create.Command(
"test", "test",
".NET Test Driver", LocalizableStrings.AppFullName,
Accept.ZeroOrMoreArguments,
CommonOptions.HelpOption(), CommonOptions.HelpOption(),
Create.Option( Create.Option(
"-s|--settings", "-s|--settings",