From cde668a1bf18093ed10ff3ed09a1a34bb1568c24 Mon Sep 17 00:00:00 2001 From: Mayank Bansal Date: Sun, 27 Jan 2019 19:19:46 +0530 Subject: [PATCH 1/2] Vstest honor nologo --- .../dotnet-test/LocalizableStrings.resx | 3 +++ .../commands/dotnet-test/TestCommandParser.cs | 5 +++++ .../dotnet-test/xlf/LocalizableStrings.cs.xlf | 5 +++++ .../dotnet-test/xlf/LocalizableStrings.de.xlf | 5 +++++ .../dotnet-test/xlf/LocalizableStrings.es.xlf | 5 +++++ .../dotnet-test/xlf/LocalizableStrings.fr.xlf | 5 +++++ .../dotnet-test/xlf/LocalizableStrings.it.xlf | 5 +++++ .../dotnet-test/xlf/LocalizableStrings.ja.xlf | 5 +++++ .../dotnet-test/xlf/LocalizableStrings.ko.xlf | 5 +++++ .../dotnet-test/xlf/LocalizableStrings.pl.xlf | 5 +++++ .../xlf/LocalizableStrings.pt-BR.xlf | 5 +++++ .../dotnet-test/xlf/LocalizableStrings.ru.xlf | 5 +++++ .../dotnet-test/xlf/LocalizableStrings.tr.xlf | 5 +++++ .../xlf/LocalizableStrings.zh-Hans.xlf | 5 +++++ .../xlf/LocalizableStrings.zh-Hant.xlf | 5 +++++ ...enDotnetTestBuildsAndRunsTestfromCsproj.cs | 20 +++++++++++++++++++ 16 files changed, 93 insertions(+) diff --git a/src/dotnet/commands/dotnet-test/LocalizableStrings.resx b/src/dotnet/commands/dotnet-test/LocalizableStrings.resx index c07ad463ff..fe5bf7843b 100644 --- a/src/dotnet/commands/dotnet-test/LocalizableStrings.resx +++ b/src/dotnet/commands/dotnet-test/LocalizableStrings.resx @@ -208,4 +208,7 @@ Outputs a 'Sequence.xml' file in the current directory that captures the order o The configuration to use for running tests. The default for most projects is 'Debug'. + + Run the test, without displaying Microsoft Testplatform banner + \ 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 5cdd9336d8..9d65eabb1e 100644 --- a/src/dotnet/commands/dotnet-test/TestCommandParser.cs +++ b/src/dotnet/commands/dotnet-test/TestCommandParser.cs @@ -90,6 +90,11 @@ public static Command Test() => LocalizableStrings.CmdBlameDescription, Accept.NoArguments() .ForwardAsSingle(o => "-property:VSTestBlame=true")), + Create.Option( + "--nologo|/nologo", + LocalizableStrings.CmdNoLogo, + Accept.NoArguments() + .ForwardAsSingle(o => "-property:VSTestNoLogo=nologo")), CommonOptions.NoRestoreOption(), CommonOptions.VerbosityOption()); diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.cs.xlf index 7a55d4e0d4..13968b3b4b 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.cs.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.cs.xlf @@ -160,6 +160,11 @@ Výstupem je soubor Sequence.xml v aktuálním adresáři, do kterého se zaznam Konfigurace, která se má použít pro spuštění testů. Výchozí možností pro většinu projektů je Debug. + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.de.xlf index 750439f7c2..fc9ecda3e5 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.de.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.de.xlf @@ -160,6 +160,11 @@ Im aktuellen Verzeichnis wird eine Datei namens "Sequence.xml" ausgegeben, in de Die für die Testausführung zu verwendende Konfiguration. Standard für die meisten Projekte ist "Debug". + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.es.xlf index 95c2d0133d..0ce1f4fb6c 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.es.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.es.xlf @@ -160,6 +160,11 @@ Crea un archivo de salida en el directorio actual como "Sequence.xml" que captur La configuración que se usará para ejecutar pruebas. El valor predeterminado para la mayoría de los proyectos es "Debug". + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.fr.xlf index ffba40a5a5..0c67f010ee 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.fr.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.fr.xlf @@ -160,6 +160,11 @@ Elle génère dans le répertoire actif un fichier de sortie nommé 'Sequence.xm Configuration à utiliser pour l'exécution des tests. La valeur par défaut pour la plupart des projets est 'Debug'. + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.it.xlf index a212ff9873..0f1e1f195e 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.it.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.it.xlf @@ -160,6 +160,11 @@ Crea nella directory corrente un file di output denominato "Sequence.xml", in cu Configurazione da usare per eseguire i test. L'impostazione predefinita per la maggior parte dei progetti è 'Debug'. + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ja.xlf index 70da2bde2b..a82b81d3f8 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ja.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ja.xlf @@ -160,6 +160,11 @@ Outputs a 'Sequence.xml' file in the current directory that captures the order o テストの実行に使用する構成。ほとんどのプロジェクトで、既定値は 'Debug' です。 + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ko.xlf index a3e2e77058..4cb2aaefd9 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ko.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ko.xlf @@ -160,6 +160,11 @@ Outputs a 'Sequence.xml' file in the current directory that captures the order o 테스트 실행에 사용할 구성입니다. 대부분의 프로젝트에서 기본값은 'Debug'입니다. + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.pl.xlf index d32f024bf1..f2a75de50e 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.pl.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.pl.xlf @@ -160,6 +160,11 @@ Tworzy w bieżącym katalogu plik wyjściowy „Sequence.xml”, który przechwy Konfiguracja do użycia na potrzeby uruchamiania testów. W przypadku większości projektów ustawienie domyślne to „Debugowanie”. + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.pt-BR.xlf index 3200ac57a2..193e18fd27 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.pt-BR.xlf @@ -160,6 +160,11 @@ Emite um arquivo 'Sequence.xml' no diretório atual que captura a ordem de execu A configuração a ser usada para executar testes. O padrão para a maioria dos projetos é 'Debug'. + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ru.xlf index 33479e33d3..c475861765 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ru.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ru.xlf @@ -160,6 +160,11 @@ Outputs a 'Sequence.xml' file in the current directory that captures the order o Конфигурация для выполнения тестов. По умолчанию для большинства проектов используется "Debug". + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.tr.xlf index d40364c289..dc6073adfb 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.tr.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.tr.xlf @@ -160,6 +160,11 @@ Geçerli dizinde testin kilitlenmeden önceki test yürütme sırasını yakalay Testleri çalıştırmak için kullanılacak yapılandırma. Çoğu proje için varsayılan, ‘Hata Ayıklama’ seçeneğidir. + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.zh-Hans.xlf index 738146a5d9..b4500175ae 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.zh-Hans.xlf @@ -160,6 +160,11 @@ Outputs a 'Sequence.xml' file in the current directory that captures the order o 用于运行测试的配置。大多数项目的默认值是 "Debug"。 + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.zh-Hant.xlf index 30e97f4940..98ab33c322 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.zh-Hant.xlf @@ -160,6 +160,11 @@ Outputs a 'Sequence.xml' file in the current directory that captures the order o 要用於執行測試的組態。大部分的專案預設為「偵錯」。 + \ No newline at end of file diff --git a/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs b/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs index ae2eca394b..38d5745679 100644 --- a/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs +++ b/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs @@ -332,6 +332,26 @@ public void ItUsesVerbosityPassedToDefineVerbosityOfConsoleLoggerOfTheTests() result.ExitCode.Should().Be(1); } + [Fact] + public void ItAcceptsNoLogoAsCliArguments() + { + // Copy and restore VSTestCore project in output directory of project dotnet-vstest.Tests + var testProjectDirectory = this.CopyAndRestoreVSTestDotNetCoreTestApp("11"); + + // Call test with logger enable + CommandResult result = new DotnetTestCommand() + .WithWorkingDirectory(testProjectDirectory) + .ExecuteWithCapturedOutput("--nologo"); + + // Verify + if (!DotnetUnderTest.IsLocalized()) + { + result.StdOut.Should().NotContain("Microsoft (R) Test Execution Command Line Tool Version"); + result.StdOut.Should().Contain("Passed VSTestPassTest"); + result.StdOut.Should().Contain("Failed VSTestFailTest"); + } + } + [WindowsOnlyFact] public void ItCreatesCoverageFileWhenCodeCoverageEnabledByRunsettings() From 85f3de4da8eb868546835feb003a042fdba737f2 Mon Sep 17 00:00:00 2001 From: Mayank Bansal Date: Tue, 29 Jan 2019 14:59:23 +0530 Subject: [PATCH 2/2] Correct Assert --- .../GivenDotnetTestBuildsAndRunsTestfromCsproj.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs b/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs index 38d5745679..bb23beb949 100644 --- a/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs +++ b/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs @@ -336,7 +336,7 @@ public void ItUsesVerbosityPassedToDefineVerbosityOfConsoleLoggerOfTheTests() public void ItAcceptsNoLogoAsCliArguments() { // Copy and restore VSTestCore project in output directory of project dotnet-vstest.Tests - var testProjectDirectory = this.CopyAndRestoreVSTestDotNetCoreTestApp("11"); + var testProjectDirectory = this.CopyAndRestoreVSTestDotNetCoreTestApp("14"); // Call test with logger enable CommandResult result = new DotnetTestCommand() @@ -347,8 +347,7 @@ public void ItAcceptsNoLogoAsCliArguments() if (!DotnetUnderTest.IsLocalized()) { result.StdOut.Should().NotContain("Microsoft (R) Test Execution Command Line Tool Version"); - result.StdOut.Should().Contain("Passed VSTestPassTest"); - result.StdOut.Should().Contain("Failed VSTestFailTest"); + result.StdOut.Should().Contain("Total tests: 2. Passed: 1. Failed: 1. Skipped: 0."); } }