Skip to content

Commit

Permalink
Simplify banner (#5013)
Browse files Browse the repository at this point in the history
* Simplify banner

* Fix tests
  • Loading branch information
nohwnd committed May 2, 2024
1 parent 6db171c commit 1133bec
Show file tree
Hide file tree
Showing 17 changed files with 36 additions and 117 deletions.
1 change: 0 additions & 1 deletion src/vstest.console/CommandLine/Executor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,6 @@ private void PrintSplashScreen(bool isDiag, string[]? args)
string assemblyVersionAndArchitecture = $"{assemblyVersion} ({_processHelper.GetCurrentProcessArchitecture().ToString().ToLowerInvariant()})";
string commandLineBanner = string.Format(CultureInfo.CurrentCulture, CommandLineResources.MicrosoftCommandLineTitle, assemblyVersionAndArchitecture);
Output.WriteLine(commandLineBanner, OutputLevel.Information);
Output.WriteLine(CommandLineResources.CopyrightCommandLineTitle, OutputLevel.Information);
PrintWarningIfRunningEmulatedOnArm64();
PrintWarningIfInvokedThroughDotnetVSTest(args);
Output.WriteLine(string.Empty, OutputLevel.Information);
Expand Down
11 changes: 1 addition & 10 deletions src/vstest.console/Resources/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions src/vstest.console/Resources/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,6 @@
<value>-c|--Configuration|/c|/Configuration:&lt;Configuration&gt;
The configuration the project is built for i.e. Debug/Release</value>
</data>
<data name="CopyrightCommandLineTitle" xml:space="preserve">
<value>Copyright (c) Microsoft Corporation. All rights reserved.</value>
</data>
<data name="Days" xml:space="preserve">
<value>Days</value>
</data>
Expand Down Expand Up @@ -387,7 +384,7 @@
<value>The Test Logger URI '{0}' is not valid. The Test Logger will be ignored.</value>
</data>
<data name="MicrosoftCommandLineTitle" xml:space="preserve">
<value>Microsoft (R) Test Execution Command Line Tool Version {0}</value>
<value>VSTest version {0}</value>
</data>
<data name="Minutes" xml:space="preserve">
<value>Minutes</value>
Expand Down
9 changes: 2 additions & 7 deletions src/vstest.console/Resources/xlf/Resources.cs.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,9 @@
Zobrazí tuto zprávu o používání.</target>
<note />
</trans-unit>
<trans-unit id="CopyrightCommandLineTitle">
<source>Copyright (c) Microsoft Corporation. All rights reserved.</source>
<target state="translated">Copyright (c) Microsoft Corporation. Všechna práva vyhrazena.</target>
<note />
</trans-unit>
<trans-unit id="MicrosoftCommandLineTitle">
<source>Microsoft (R) Test Execution Command Line Tool Version {0}</source>
<target state="translated">Microsoft (R) Test Execution Command Line Tool verze {0}</target>
<source>VSTest version {0}</source>
<target state="needs-review-translation">Microsoft (R) Test Execution Command Line Tool verze {0}</target>
<note />
</trans-unit>
<trans-unit id="EnableLoggersArgumentHelp">
Expand Down
9 changes: 2 additions & 7 deletions src/vstest.console/Resources/xlf/Resources.de.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,9 @@
Zeigt diese Syntaxmeldung an.</target>
<note />
</trans-unit>
<trans-unit id="CopyrightCommandLineTitle">
<source>Copyright (c) Microsoft Corporation. All rights reserved.</source>
<target state="translated">Copyright (c) Microsoft Corporation. Alle Rechte vorbehalten.</target>
<note />
</trans-unit>
<trans-unit id="MicrosoftCommandLineTitle">
<source>Microsoft (R) Test Execution Command Line Tool Version {0}</source>
<target state="translated">Microsoft (R) Testausführungs-Befehlszeilentool Version {0}</target>
<source>VSTest version {0}</source>
<target state="needs-review-translation">Microsoft (R) Testausführungs-Befehlszeilentool Version {0}</target>
<note />
</trans-unit>
<trans-unit id="EnableLoggersArgumentHelp">
Expand Down
9 changes: 2 additions & 7 deletions src/vstest.console/Resources/xlf/Resources.es.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,9 @@
Muestra este mensaje de uso.</target>
<note />
</trans-unit>
<trans-unit id="CopyrightCommandLineTitle">
<source>Copyright (c) Microsoft Corporation. All rights reserved.</source>
<target state="translated">Copyright (c) Microsoft Corporation. Todos los derechos reservados.</target>
<note />
</trans-unit>
<trans-unit id="MicrosoftCommandLineTitle">
<source>Microsoft (R) Test Execution Command Line Tool Version {0}</source>
<target state="translated">Herramienta de línea de comandos de ejecución de pruebas de Microsoft(R), versión {0}</target>
<source>VSTest version {0}</source>
<target state="needs-review-translation">Herramienta de línea de comandos de ejecución de pruebas de Microsoft(R), versión {0}</target>
<note />
</trans-unit>
<trans-unit id="EnableLoggersArgumentHelp">
Expand Down
9 changes: 2 additions & 7 deletions src/vstest.console/Resources/xlf/Resources.fr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,9 @@
Permet d'afficher ce message d'utilisation.</target>
<note />
</trans-unit>
<trans-unit id="CopyrightCommandLineTitle">
<source>Copyright (c) Microsoft Corporation. All rights reserved.</source>
<target state="translated">Copyright (c) Microsoft Corporation. Tous droits réservés.</target>
<note />
</trans-unit>
<trans-unit id="MicrosoftCommandLineTitle">
<source>Microsoft (R) Test Execution Command Line Tool Version {0}</source>
<target state="translated">Outil en ligne de commande d'exécution de tests Microsoft (R), version {0}</target>
<source>VSTest version {0}</source>
<target state="needs-review-translation">Outil en ligne de commande d'exécution de tests Microsoft (R), version {0}</target>
<note />
</trans-unit>
<trans-unit id="EnableLoggersArgumentHelp">
Expand Down
9 changes: 2 additions & 7 deletions src/vstest.console/Resources/xlf/Resources.it.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,9 @@
Visualizza questo messaggio relativo alla sintassi.</target>
<note />
</trans-unit>
<trans-unit id="CopyrightCommandLineTitle">
<source>Copyright (c) Microsoft Corporation. All rights reserved.</source>
<target state="translated">Copyright (c) Microsoft Corporation. Tutti i diritti sono riservati.</target>
<note />
</trans-unit>
<trans-unit id="MicrosoftCommandLineTitle">
<source>Microsoft (R) Test Execution Command Line Tool Version {0}</source>
<target state="translated">Strumento da riga di comando per l'esecuzione di test Microsoft (R) Versione {0}</target>
<source>VSTest version {0}</source>
<target state="needs-review-translation">Strumento da riga di comando per l'esecuzione di test Microsoft (R) Versione {0}</target>
<note />
</trans-unit>
<trans-unit id="EnableLoggersArgumentHelp">
Expand Down
9 changes: 2 additions & 7 deletions src/vstest.console/Resources/xlf/Resources.ja.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,9 @@
この使用方法に関するメッセージを表示します。</target>
<note />
</trans-unit>
<trans-unit id="CopyrightCommandLineTitle">
<source>Copyright (c) Microsoft Corporation. All rights reserved.</source>
<target state="translated">Copyright (c) Microsoft Corporation. All rights reserved.</target>
<note />
</trans-unit>
<trans-unit id="MicrosoftCommandLineTitle">
<source>Microsoft (R) Test Execution Command Line Tool Version {0}</source>
<target state="translated">Microsoft (R) Test Execution Command Line Tool Version {0}</target>
<source>VSTest version {0}</source>
<target state="needs-review-translation">Microsoft (R) Test Execution Command Line Tool Version {0}</target>
<note />
</trans-unit>
<trans-unit id="EnableLoggersArgumentHelp">
Expand Down
9 changes: 2 additions & 7 deletions src/vstest.console/Resources/xlf/Resources.ko.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,9 @@
이 사용법 메시지를 표시합니다.</target>
<note />
</trans-unit>
<trans-unit id="CopyrightCommandLineTitle">
<source>Copyright (c) Microsoft Corporation. All rights reserved.</source>
<target state="translated">Copyright (c) Microsoft Corporation. All rights reserved.</target>
<note />
</trans-unit>
<trans-unit id="MicrosoftCommandLineTitle">
<source>Microsoft (R) Test Execution Command Line Tool Version {0}</source>
<target state="translated">Microsoft (R) Test Execution Command Line Tool Version {0}</target>
<source>VSTest version {0}</source>
<target state="needs-review-translation">Microsoft (R) Test Execution Command Line Tool Version {0}</target>
<note />
</trans-unit>
<trans-unit id="EnableLoggersArgumentHelp">
Expand Down
9 changes: 2 additions & 7 deletions src/vstest.console/Resources/xlf/Resources.pl.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,9 @@
Wyświetla ten komunikat dotyczący sposobu użycia.</target>
<note />
</trans-unit>
<trans-unit id="CopyrightCommandLineTitle">
<source>Copyright (c) Microsoft Corporation. All rights reserved.</source>
<target state="translated">Copyright (c) Microsoft Corporation. Wszelkie prawa zastrzeżone.</target>
<note />
</trans-unit>
<trans-unit id="MicrosoftCommandLineTitle">
<source>Microsoft (R) Test Execution Command Line Tool Version {0}</source>
<target state="translated">Narzędzie wiersza polecenia firmy Microsoft (R) służące do wykonania testów (wersja {0})</target>
<source>VSTest version {0}</source>
<target state="needs-review-translation">Narzędzie wiersza polecenia firmy Microsoft (R) służące do wykonania testów (wersja {0})</target>
<note />
</trans-unit>
<trans-unit id="EnableLoggersArgumentHelp">
Expand Down
9 changes: 2 additions & 7 deletions src/vstest.console/Resources/xlf/Resources.pt-BR.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,9 @@
Exibe esta mensagem de uso.</target>
<note />
</trans-unit>
<trans-unit id="CopyrightCommandLineTitle">
<source>Copyright (c) Microsoft Corporation. All rights reserved.</source>
<target state="translated">Copyright (c) Microsoft Corporation. Todos os direitos reservados.</target>
<note />
</trans-unit>
<trans-unit id="MicrosoftCommandLineTitle">
<source>Microsoft (R) Test Execution Command Line Tool Version {0}</source>
<target state="translated">Ferramenta de Linha de Comando de Execução de Teste da Microsoft (R) Versão {0}</target>
<source>VSTest version {0}</source>
<target state="needs-review-translation">Ferramenta de Linha de Comando de Execução de Teste da Microsoft (R) Versão {0}</target>
<note />
</trans-unit>
<trans-unit id="EnableLoggersArgumentHelp">
Expand Down
9 changes: 2 additions & 7 deletions src/vstest.console/Resources/xlf/Resources.ru.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,9 @@
Отображение этого сообщения об использовании.</target>
<note />
</trans-unit>
<trans-unit id="CopyrightCommandLineTitle">
<source>Copyright (c) Microsoft Corporation. All rights reserved.</source>
<target state="translated">(с) Корпорация Майкрософт (Microsoft Corporation). Все права защищены.</target>
<note />
</trans-unit>
<trans-unit id="MicrosoftCommandLineTitle">
<source>Microsoft (R) Test Execution Command Line Tool Version {0}</source>
<target state="translated">Программа Microsoft (R) Test Execution Command Line Tool версии {0}</target>
<source>VSTest version {0}</source>
<target state="needs-review-translation">Программа Microsoft (R) Test Execution Command Line Tool версии {0}</target>
<note />
</trans-unit>
<trans-unit id="EnableLoggersArgumentHelp">
Expand Down
9 changes: 2 additions & 7 deletions src/vstest.console/Resources/xlf/Resources.tr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,9 @@
Bu kullanım iletisini görüntüler.</target>
<note />
</trans-unit>
<trans-unit id="CopyrightCommandLineTitle">
<source>Copyright (c) Microsoft Corporation. All rights reserved.</source>
<target state="translated">Telif Hakkı (c) Microsoft Corporation. Tüm hakları saklıdır.</target>
<note />
</trans-unit>
<trans-unit id="MicrosoftCommandLineTitle">
<source>Microsoft (R) Test Execution Command Line Tool Version {0}</source>
<target state="translated">Microsoft (R) Test Yürütmesi Komut Satırı Aracı Sürüm {0}</target>
<source>VSTest version {0}</source>
<target state="needs-review-translation">Microsoft (R) Test Yürütmesi Komut Satırı Aracı Sürüm {0}</target>
<note />
</trans-unit>
<trans-unit id="EnableLoggersArgumentHelp">
Expand Down
9 changes: 2 additions & 7 deletions src/vstest.console/Resources/xlf/Resources.zh-Hans.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,9 @@
显示此用法信息。</target>
<note />
</trans-unit>
<trans-unit id="CopyrightCommandLineTitle">
<source>Copyright (c) Microsoft Corporation. All rights reserved.</source>
<target state="translated">版权所有 (C) Microsoft Corporation。保留所有权利。</target>
<note />
</trans-unit>
<trans-unit id="MicrosoftCommandLineTitle">
<source>Microsoft (R) Test Execution Command Line Tool Version {0}</source>
<target state="translated">Microsoft (R) 测试执行命令行工具版本 {0}</target>
<source>VSTest version {0}</source>
<target state="needs-review-translation">Microsoft (R) 测试执行命令行工具版本 {0}</target>
<note />
</trans-unit>
<trans-unit id="EnableLoggersArgumentHelp">
Expand Down
9 changes: 2 additions & 7 deletions src/vstest.console/Resources/xlf/Resources.zh-Hant.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,9 @@
顯示此使用方式訊息。</target>
<note />
</trans-unit>
<trans-unit id="CopyrightCommandLineTitle">
<source>Copyright (c) Microsoft Corporation. All rights reserved.</source>
<target state="translated">Copyright (C) Microsoft Corporation. 著作權所有,並保留一切權利。</target>
<note />
</trans-unit>
<trans-unit id="MicrosoftCommandLineTitle">
<source>Microsoft (R) Test Execution Command Line Tool Version {0}</source>
<target state="translated">Microsoft (R) Test Execution Command Line Tool {0} 版</target>
<source>VSTest version {0}</source>
<target state="needs-review-translation">Microsoft (R) Test Execution Command Line Tool {0} 版</target>
<note />
</trans-unit>
<trans-unit id="EnableLoggersArgumentHelp">
Expand Down
19 changes: 8 additions & 11 deletions test/vstest.console.UnitTests/ExecutorUnitTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ public void ExecutorPrintsSplashScreenTest()
Assert.IsTrue(mockOutput.Messages.Count > 0, "Executor must print at least copyright info");
Assert.IsNotNull(mockOutput.Messages.First().Message, "First Printed Message cannot be null or empty");

// Just check first 20 characters - don't need to check whole thing as assembly version is variable
// "First Printed message must be Microsoft Copyright");
StringAssert.Contains(mockOutput.Messages.First().Message,
CommandLineResources.MicrosoftCommandLineTitle.Substring(0, 20));
CommandLineResources.MicrosoftCommandLineTitle.Split(['{'], 2)[0]);

var suffixIndex = assemblyVersion.IndexOf("-");
var version = suffixIndex == -1 ? assemblyVersion : assemblyVersion.Substring(0, suffixIndex);
Expand All @@ -71,11 +69,10 @@ public void ExecutorShouldNotPrintsSplashScreenIfNoLogoPassed()
// Verify that messages exist
Assert.IsTrue(mockOutput.Messages.Count == 1, "Executor should not print no valid arguments provided");

// Just check first 20 characters - don't need to check whole thing as assembly version is variable
// Check the part of message before the actual version because that is variable.
Assert.IsFalse(
mockOutput.Messages.First()
.Message!.Contains(CommandLineResources.MicrosoftCommandLineTitle.Substring(0, 20)),
"First Printed message must be Microsoft Copyright");
.Message!.Contains(CommandLineResources.MicrosoftCommandLineTitle.Split(['{'], 2)[0]));
}

[TestMethod]
Expand Down Expand Up @@ -333,11 +330,11 @@ public void ExecutorShouldPrintWarningIfRunningEmulatedOnARM64()
var exitCode = new Executor(mockOutput, _mockTestPlatformEventSource.Object, processHelper.Object, environment.Object).Execute();
var assemblyVersion = typeof(Executor).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()!.InformationalVersion;

Assert.AreEqual(5, mockOutput.Messages.Count);
Assert.AreEqual(4, mockOutput.Messages.Count);
Assert.AreEqual("vstest.console.exe is running in emulated mode as x64. For better performance, please consider using the native runner vstest.console.arm64.exe.",
mockOutput.Messages[2].Message);
mockOutput.Messages[1].Message);
Assert.AreEqual(OutputLevel.Warning,
mockOutput.Messages[2].Level);
mockOutput.Messages[1].Level);
}

[TestMethod]
Expand All @@ -353,8 +350,8 @@ public void ExecutorShouldPrintRunnerArchitecture()
var exitCode = new Executor(mockOutput, _mockTestPlatformEventSource.Object, processHelper.Object, environment.Object).Execute();
var assemblyVersion = typeof(Executor).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()!.InformationalVersion;

Assert.AreEqual(4, mockOutput.Messages.Count);
Assert.IsTrue(Regex.IsMatch(mockOutput.Messages[0].Message!, @"Microsoft \(R\) Test Execution Command Line Tool Version .* \(x64\)"));
Assert.AreEqual(3, mockOutput.Messages.Count);
Assert.IsTrue(Regex.IsMatch(mockOutput.Messages[0].Message!, @"VSTest version .* \(x64\)"));
Assert.IsFalse(mockOutput.Messages.Any(message => message.Message!.Contains("vstest.console.exe is running in emulated mode")));
}

Expand Down

0 comments on commit 1133bec

Please sign in to comment.