diff --git a/build/test/TestPackageProjects.targets b/build/test/TestPackageProjects.targets index bb280358a..260eda2c8 100644 --- a/build/test/TestPackageProjects.targets +++ b/build/test/TestPackageProjects.targets @@ -39,7 +39,7 @@ $(CliVersionPrefix) $(VersionSuffix) False - /p:TargetFramework=netstandard2.0 + /p:TargetFramework=netstandard2.0 /p:NoWarn=NU5104 Microsoft.DotNet.InternalAbstractions diff --git a/src/dotnet/commands/dotnet-sln/LocalizableStrings.resx b/src/dotnet/commands/dotnet-sln/LocalizableStrings.resx index 942139ebe..a2f52ea07 100644 --- a/src/dotnet/commands/dotnet-sln/LocalizableStrings.resx +++ b/src/dotnet/commands/dotnet-sln/LocalizableStrings.resx @@ -150,4 +150,7 @@ Create a solution file. + + Project(s) + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-sln/list/Program.cs b/src/dotnet/commands/dotnet-sln/list/Program.cs index 3b82bd255..d0dd20eb0 100644 --- a/src/dotnet/commands/dotnet-sln/list/Program.cs +++ b/src/dotnet/commands/dotnet-sln/list/Program.cs @@ -36,9 +36,9 @@ namespace Microsoft.DotNet.Tools.Sln.List } else { - Reporter.Output.WriteLine($"{CommonLocalizableStrings.ProjectReferenceOneOrMore}"); - Reporter.Output.WriteLine(new string('-', CommonLocalizableStrings.ProjectReferenceOneOrMore.Length)); - foreach (var slnProject in slnFile.Projects) + Reporter.Output.WriteLine($"{LocalizableStrings.ProjectsHeader}"); + Reporter.Output.WriteLine(new string('-', LocalizableStrings.ProjectsHeader.Length)); + foreach (var slnProject in slnFile.Projects.Where(p => p.TypeGuid != ProjectTypeGuids.SolutionFolderGuid)) { Reporter.Output.WriteLine(slnProject.FilePath); } diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.cs.xlf index 88a3a115a..96165f37a 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.cs.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.cs.xlf @@ -57,6 +57,11 @@ Vytvoří soubor řešení. + + Project(s) + Project(s) + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.de.xlf index 8673c2b00..0077f2d30 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.de.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.de.xlf @@ -57,6 +57,11 @@ Erstellt eine Projektmappendatei. + + Project(s) + Project(s) + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.es.xlf index 0a96eadd5..809a3f51e 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.es.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.es.xlf @@ -57,6 +57,11 @@ Cree un archivo de la solución. + + Project(s) + Project(s) + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.fr.xlf index ad2ad2afd..dc2a8891f 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.fr.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.fr.xlf @@ -57,6 +57,11 @@ Créez un fichier solution. + + Project(s) + Project(s) + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.it.xlf index f59c02961..d4444ea85 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.it.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.it.xlf @@ -57,6 +57,11 @@ Consente di creare un file di soluzione. + + Project(s) + Project(s) + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ja.xlf index 09fccb7fc..eba876be4 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ja.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ja.xlf @@ -57,6 +57,11 @@ ソリューション ファイルを作成します。 + + Project(s) + Project(s) + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ko.xlf index acf0c651c..e6bdc9f31 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ko.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ko.xlf @@ -57,6 +57,11 @@ 솔루션 파일을 만듭니다. + + Project(s) + Project(s) + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.pl.xlf index 3136a922d..0ebb5ff31 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.pl.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.pl.xlf @@ -57,6 +57,11 @@ Utwórz plik rozwiązania. + + Project(s) + Project(s) + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.pt-BR.xlf index 3cc6b2861..225dac34b 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.pt-BR.xlf @@ -57,6 +57,11 @@ Criar um arquivo de solução. + + Project(s) + Project(s) + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ru.xlf index 348f82bba..f27ca8a9a 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ru.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ru.xlf @@ -57,6 +57,11 @@ Создает файл решения. + + Project(s) + Project(s) + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.tr.xlf index 92fa7d50a..318a59362 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.tr.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.tr.xlf @@ -57,6 +57,11 @@ Bir çözüm dosyası oluşturun. + + Project(s) + Project(s) + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.zh-Hans.xlf index 9b8bc98d6..560874572 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.zh-Hans.xlf @@ -57,6 +57,11 @@ 创建解决方案文件。 + + Project(s) + Project(s) + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.zh-Hant.xlf index 95a752f0c..389803b2d 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.zh-Hant.xlf @@ -57,6 +57,11 @@ 建立方案檔。 + + Project(s) + Project(s) + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-test/TestCommandParser.cs b/src/dotnet/commands/dotnet-test/TestCommandParser.cs index 4568e402d..7236a1545 100644 --- a/src/dotnet/commands/dotnet-test/TestCommandParser.cs +++ b/src/dotnet/commands/dotnet-test/TestCommandParser.cs @@ -40,19 +40,19 @@ namespace Microsoft.DotNet.Cli Create.Option( "-a|--test-adapter-path", LocalizableStrings.CmdTestAdapterPathDescription, - Accept.ExactlyOneArgument() + Accept.OneOrMoreArguments() .With(name: LocalizableStrings.CmdTestAdapterPath) - .ForwardAsSingle(o => $"-property:VSTestTestAdapterPath={o.Arguments.Single()}")), + .ForwardAsSingle(o => $"-property:VSTestTestAdapterPath=\"{string.Join(";", o.Arguments)}\"")), Create.Option( "-l|--logger", LocalizableStrings.CmdLoggerDescription, - Accept.ExactlyOneArgument() + Accept.OneOrMoreArguments() .With(name: LocalizableStrings.CmdLoggerOption) .ForwardAsSingle(o => { var loggersString = string.Join(";", GetSemiColonEscapedArgs(o.Arguments)); - return $"-property:VSTestLogger={loggersString}"; + return $"-property:VSTestLogger=\"{loggersString}\""; })), CommonOptions.ConfigurationOption(), CommonOptions.FrameworkOption(), @@ -116,4 +116,4 @@ namespace Microsoft.DotNet.Cli return array; } } -} \ No newline at end of file +} diff --git a/src/redist/redist.csproj b/src/redist/redist.csproj index dd8035a1d..a03bbac1e 100644 --- a/src/redist/redist.csproj +++ b/src/redist/redist.csproj @@ -86,7 +86,7 @@ + ProjectPath="$(SrcDirectory)/tool_fsharp/tool_fsc.csproj" MSBuildArgs="/p:PublishDir=$(FSharpDirectory)" /> - $(CliVersionPrefix) $(CliTargetFramework) true - $(FSharpDirectory) - $(CommitCount) diff --git a/test/dotnet-sln-list.Tests/GivenDotnetSlnList.cs b/test/dotnet-sln-list.Tests/GivenDotnetSlnList.cs index fdc2d9a55..41f0af182 100644 --- a/test/dotnet-sln-list.Tests/GivenDotnetSlnList.cs +++ b/test/dotnet-sln-list.Tests/GivenDotnetSlnList.cs @@ -9,6 +9,7 @@ using System; using System.IO; using System.Linq; using Xunit; +using CommandLocalizableStrings = Microsoft.DotNet.Tools.Sln.LocalizableStrings; namespace Microsoft.DotNet.Cli.Sln.List.Tests { @@ -160,7 +161,7 @@ Commands: } [Fact] - public void WhenNoProjectReferencesArePresentInTheSolutionItPrintsANoProjectMessage() + public void WhenNoProjectsArePresentInTheSolutionItPrintsANoProjectMessage() { var projectDirectory = TestAssets .Get("TestAppWithEmptySln") @@ -177,11 +178,10 @@ Commands: } [Fact] - public void WhenProjectReferencesArePresentInTheSolutionItListsThem() + public void WhenProjectsPresentInTheSolutionItListsThem() { - string OutputText = CommonLocalizableStrings.ProjectReferenceOneOrMore; - OutputText += $@" -{new string('-', OutputText.Length)} + var expectedOutput = $@"{CommandLocalizableStrings.ProjectsHeader} +{new string('-', CommandLocalizableStrings.ProjectsHeader.Length)} {Path.Combine("App", "App.csproj")} {Path.Combine("Lib", "Lib.csproj")}"; @@ -196,7 +196,7 @@ Commands: .WithWorkingDirectory(projectDirectory) .ExecuteWithCapturedOutput("sln list"); cmd.Should().Pass(); - cmd.StdOut.Should().BeVisuallyEquivalentTo(OutputText); + cmd.StdOut.Should().BeVisuallyEquivalentTo(expectedOutput); } } } diff --git a/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs b/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs index 8120df7c9..1a8dddf88 100644 --- a/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs +++ b/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs @@ -131,6 +131,39 @@ namespace Microsoft.DotNet.Cli.Test.Tests } } + [Fact] + public void ItAcceptsMultipleLoggersAsCliArguments() + { + // Copy and restore VSTestCore project in output directory of project dotnet-vstest.Tests + var testProjectDirectory = this.CopyAndRestoreVSTestDotNetCoreTestApp("10"); + + string trxLoggerDirectory = Path.Combine(testProjectDirectory, "RD"); + + // Delete trxLoggerDirectory if it exist + if (Directory.Exists(trxLoggerDirectory)) + { + Directory.Delete(trxLoggerDirectory, true); + } + + // Call test with logger enable + CommandResult result = new DotnetTestCommand() + .WithWorkingDirectory(testProjectDirectory) + .ExecuteWithCapturedOutput("--logger \"trx;logfilename=custom.trx\" --logger console;verbosity=normal -- RunConfiguration.ResultsDirectory=" + trxLoggerDirectory); + + // Verify + var trxFilePath = Path.Combine(trxLoggerDirectory, "custom.trx"); + Assert.True(File.Exists(trxFilePath)); + result.StdOut.Should().Contain(trxFilePath); + result.StdOut.Should().Contain("Passed VSTestPassTest"); + result.StdOut.Should().Contain("Failed VSTestFailTest"); + + // Cleanup trxLoggerDirectory if it exist + if (Directory.Exists(trxLoggerDirectory)) + { + Directory.Delete(trxLoggerDirectory, true); + } + } + [Fact] public void TestWillNotBuildTheProjectIfNoBuildArgsIsGiven() {