Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ internal sealed class TerminalTestReporterCommandLineOptionsProvider : ICommandL
{
public const string NoProgressOption = "no-progress";
public const string NoAnsiOption = "no-ansi";
public const string OutputOption = "output";
public const string OutputOptionNormalArgument = "normal";
public const string OutputOptionDetailedArgument = "detailed";

/// <inheritdoc />
public string Uid { get; } = nameof(TerminalTestReporterCommandLineOptionsProvider);
Expand All @@ -32,12 +35,21 @@ internal sealed class TerminalTestReporterCommandLineOptionsProvider : ICommandL
public IReadOnlyCollection<CommandLineOption> GetCommandLineOptions()
=>
[
new(NoProgressOption, PlatformResources.TerminalNoProgressOptionDescription, ArgumentArity.Zero, false),
new(NoAnsiOption, PlatformResources.TerminalNoAnsiOptionDescription, ArgumentArity.Zero, false)
new(NoProgressOption, PlatformResources.TerminalNoProgressOptionDescription, ArgumentArity.Zero, isHidden: false),
new(NoAnsiOption, PlatformResources.TerminalNoAnsiOptionDescription, ArgumentArity.Zero, isHidden: false),
new(OutputOption, PlatformResources.TerminalOutputOptionDescription, ArgumentArity.ExactlyOne, isHidden: false),
];

public Task<ValidationResult> ValidateOptionArgumentsAsync(CommandLineOption commandOption, string[] arguments)
=> ValidationResult.ValidTask;
=> commandOption.Name switch
{
NoProgressOption => ValidationResult.ValidTask,
NoAnsiOption => ValidationResult.ValidTask,
OutputOption => OutputOptionNormalArgument.Equals(arguments[0], StringComparison.OrdinalIgnoreCase) || OutputOptionDetailedArgument.Equals(arguments[0], StringComparison.OrdinalIgnoreCase)
? ValidationResult.ValidTask
: ValidationResult.InvalidTask(PlatformResources.TerminalOutputOptionInvalidArgument),
_ => throw ApplicationStateGuard.Unreachable(),
};

public Task<ValidationResult> ValidateCommandLineOptionsAsync(ICommandLineOptions commandLineOptions)
=> // No problem found
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@ public TerminalOutputDevice(ITestApplicationCancellationTokenSource testApplicat
bool noAnsi = parseResult.IsOptionSet(TerminalTestReporterCommandLineOptionsProvider.NoAnsiOption);
bool noProgress = parseResult.IsOptionSet(TerminalTestReporterCommandLineOptionsProvider.NoProgressOption);

bool showPassed = false;
OptionRecord? output = parseResult.Options.FirstOrDefault(o => o.Option == TerminalTestReporterCommandLineOptionsProvider.OutputOption);
if (output != null && output.Arguments.Length > 0 && TerminalTestReporterCommandLineOptionsProvider.OutputOptionDetailedArgument.Equals(output.Arguments[0], StringComparison.OrdinalIgnoreCase))
{
showPassed = true;
}

Func<bool?> shouldShowProgress = noProgress
// User preference is to not show progress.
? () => false
Expand All @@ -110,15 +117,13 @@ public TerminalOutputDevice(ITestApplicationCancellationTokenSource testApplicat
// func.
: () => testHostControllerInfo.IsCurrentProcessTestHostController == null ? null : !testHostControllerInfo.IsCurrentProcessTestHostController;

// This is single exe run, don't show all the details of assemblies and their summaries
// and don't show passed tests.
bool verbose = false;
// This is single exe run, don't show all the details of assemblies and their summaries.
_terminalTestReporter = new TerminalTestReporter(console, new()
{
BaseDirectory = null,
ShowAssembly = verbose,
ShowAssemblyStartAndComplete = verbose,
ShowPassedTests = verbose,
ShowAssembly = false,
ShowAssemblyStartAndComplete = false,
ShowPassedTests = showPassed,
MinimumExpectedTests = minimumExpectedTest,
UseAnsi = !noAnsi,
ShowProgress = shouldShowProgress,
Expand Down

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

Original file line number Diff line number Diff line change
Expand Up @@ -596,4 +596,10 @@ Read more about Microsoft Testing Platform telemetry: https://aka.ms/testingplat
<data name="TerminalTestReporterDisplayName" xml:space="preserve">
<value>Terminal test reporter</value>
</data>
<data name="TerminalOutputOptionDescription" xml:space="preserve">
<value>Output verbosity when reporting tests. Valid values are 'Normal', 'Detailed'. Default is 'Normal'.</value>
Comment thread
Evangelink marked this conversation as resolved.
Resolved
</data>
<data name="TerminalOutputOptionInvalidArgument" xml:space="preserve">
<value>--output expects a single parameter with value 'Normal' or 'Detailed'.</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,16 @@ Přečtěte si další informace o telemetrii Microsoft Testing Platform: https:
<target state="new">Disable reporting progress to screen.</target>
<note />
</trans-unit>
<trans-unit id="TerminalOutputOptionDescription">
<source>Output verbosity when reporting tests. Valid values are 'Normal', 'Detailed'. Default is 'Normal'.</source>
<target state="new">Output verbosity when reporting tests. Valid values are 'Normal', 'Detailed'. Default is 'Normal'.</target>
<note />
</trans-unit>
<trans-unit id="TerminalOutputOptionInvalidArgument">
<source>--output expects a single parameter with value 'Normal' or 'Detailed'.</source>
<target state="new">--output expects a single parameter with value 'Normal' or 'Detailed'.</target>
<note />
</trans-unit>
<trans-unit id="TerminalTestReporterDescription">
<source>Writes test results to terminal.</source>
<target state="new">Writes test results to terminal.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,16 @@ Weitere Informationen zu Microsoft Testing Platform-Telemetriedaten: https://aka
<target state="new">Disable reporting progress to screen.</target>
<note />
</trans-unit>
<trans-unit id="TerminalOutputOptionDescription">
<source>Output verbosity when reporting tests. Valid values are 'Normal', 'Detailed'. Default is 'Normal'.</source>
<target state="new">Output verbosity when reporting tests. Valid values are 'Normal', 'Detailed'. Default is 'Normal'.</target>
<note />
</trans-unit>
<trans-unit id="TerminalOutputOptionInvalidArgument">
<source>--output expects a single parameter with value 'Normal' or 'Detailed'.</source>
<target state="new">--output expects a single parameter with value 'Normal' or 'Detailed'.</target>
<note />
</trans-unit>
<trans-unit id="TerminalTestReporterDescription">
<source>Writes test results to terminal.</source>
<target state="new">Writes test results to terminal.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,16 @@ Más información sobre la telemetría de la Plataforma de pruebas de Microsoft:
<target state="new">Disable reporting progress to screen.</target>
<note />
</trans-unit>
<trans-unit id="TerminalOutputOptionDescription">
<source>Output verbosity when reporting tests. Valid values are 'Normal', 'Detailed'. Default is 'Normal'.</source>
<target state="new">Output verbosity when reporting tests. Valid values are 'Normal', 'Detailed'. Default is 'Normal'.</target>
<note />
</trans-unit>
<trans-unit id="TerminalOutputOptionInvalidArgument">
<source>--output expects a single parameter with value 'Normal' or 'Detailed'.</source>
<target state="new">--output expects a single parameter with value 'Normal' or 'Detailed'.</target>
<note />
</trans-unit>
<trans-unit id="TerminalTestReporterDescription">
<source>Writes test results to terminal.</source>
<target state="new">Writes test results to terminal.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,16 @@ En savoir plus sur la télémétrie de la plateforme de tests Microsoft : https:
<target state="new">Disable reporting progress to screen.</target>
<note />
</trans-unit>
<trans-unit id="TerminalOutputOptionDescription">
<source>Output verbosity when reporting tests. Valid values are 'Normal', 'Detailed'. Default is 'Normal'.</source>
<target state="new">Output verbosity when reporting tests. Valid values are 'Normal', 'Detailed'. Default is 'Normal'.</target>
<note />
</trans-unit>
<trans-unit id="TerminalOutputOptionInvalidArgument">
<source>--output expects a single parameter with value 'Normal' or 'Detailed'.</source>
<target state="new">--output expects a single parameter with value 'Normal' or 'Detailed'.</target>
<note />
</trans-unit>
<trans-unit id="TerminalTestReporterDescription">
<source>Writes test results to terminal.</source>
<target state="new">Writes test results to terminal.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,16 @@ Altre informazioni sulla telemetria della piattaforma di test Microsoft: https:/
<target state="new">Disable reporting progress to screen.</target>
<note />
</trans-unit>
<trans-unit id="TerminalOutputOptionDescription">
<source>Output verbosity when reporting tests. Valid values are 'Normal', 'Detailed'. Default is 'Normal'.</source>
<target state="new">Output verbosity when reporting tests. Valid values are 'Normal', 'Detailed'. Default is 'Normal'.</target>
<note />
</trans-unit>
<trans-unit id="TerminalOutputOptionInvalidArgument">
<source>--output expects a single parameter with value 'Normal' or 'Detailed'.</source>
<target state="new">--output expects a single parameter with value 'Normal' or 'Detailed'.</target>
<note />
</trans-unit>
<trans-unit id="TerminalTestReporterDescription">
<source>Writes test results to terminal.</source>
<target state="new">Writes test results to terminal.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,16 @@ Microsoft Testing Platform テレメトリの詳細: https://aka.ms/testingplatf
<target state="new">Disable reporting progress to screen.</target>
<note />
</trans-unit>
<trans-unit id="TerminalOutputOptionDescription">
<source>Output verbosity when reporting tests. Valid values are 'Normal', 'Detailed'. Default is 'Normal'.</source>
<target state="new">Output verbosity when reporting tests. Valid values are 'Normal', 'Detailed'. Default is 'Normal'.</target>
<note />
</trans-unit>
<trans-unit id="TerminalOutputOptionInvalidArgument">
<source>--output expects a single parameter with value 'Normal' or 'Detailed'.</source>
<target state="new">--output expects a single parameter with value 'Normal' or 'Detailed'.</target>
<note />
</trans-unit>
<trans-unit id="TerminalTestReporterDescription">
<source>Writes test results to terminal.</source>
<target state="new">Writes test results to terminal.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,16 @@ Microsoft 테스트 플랫폼 원격 분석에 대해 자세히 알아보기: ht
<target state="new">Disable reporting progress to screen.</target>
<note />
</trans-unit>
<trans-unit id="TerminalOutputOptionDescription">
<source>Output verbosity when reporting tests. Valid values are 'Normal', 'Detailed'. Default is 'Normal'.</source>
<target state="new">Output verbosity when reporting tests. Valid values are 'Normal', 'Detailed'. Default is 'Normal'.</target>
<note />
</trans-unit>
<trans-unit id="TerminalOutputOptionInvalidArgument">
<source>--output expects a single parameter with value 'Normal' or 'Detailed'.</source>
<target state="new">--output expects a single parameter with value 'Normal' or 'Detailed'.</target>
<note />
</trans-unit>
<trans-unit id="TerminalTestReporterDescription">
<source>Writes test results to terminal.</source>
<target state="new">Writes test results to terminal.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,16 @@ Więcej informacji o telemetrii platformy testowej firmy Microsoft: https://aka.
<target state="new">Disable reporting progress to screen.</target>
<note />
</trans-unit>
<trans-unit id="TerminalOutputOptionDescription">
<source>Output verbosity when reporting tests. Valid values are 'Normal', 'Detailed'. Default is 'Normal'.</source>
<target state="new">Output verbosity when reporting tests. Valid values are 'Normal', 'Detailed'. Default is 'Normal'.</target>
<note />
</trans-unit>
<trans-unit id="TerminalOutputOptionInvalidArgument">
<source>--output expects a single parameter with value 'Normal' or 'Detailed'.</source>
<target state="new">--output expects a single parameter with value 'Normal' or 'Detailed'.</target>
<note />
</trans-unit>
<trans-unit id="TerminalTestReporterDescription">
<source>Writes test results to terminal.</source>
<target state="new">Writes test results to terminal.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,16 @@ Leia mais sobre a telemetria da Plataforma de Testes da Microsoft: https://aka.m
<target state="new">Disable reporting progress to screen.</target>
<note />
</trans-unit>
<trans-unit id="TerminalOutputOptionDescription">
<source>Output verbosity when reporting tests. Valid values are 'Normal', 'Detailed'. Default is 'Normal'.</source>
<target state="new">Output verbosity when reporting tests. Valid values are 'Normal', 'Detailed'. Default is 'Normal'.</target>
<note />
</trans-unit>
<trans-unit id="TerminalOutputOptionInvalidArgument">
<source>--output expects a single parameter with value 'Normal' or 'Detailed'.</source>
<target state="new">--output expects a single parameter with value 'Normal' or 'Detailed'.</target>
<note />
</trans-unit>
<trans-unit id="TerminalTestReporterDescription">
<source>Writes test results to terminal.</source>
<target state="new">Writes test results to terminal.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,16 @@ Read more about Microsoft Testing Platform telemetry: https://aka.ms/testingplat
<target state="new">Disable reporting progress to screen.</target>
<note />
</trans-unit>
<trans-unit id="TerminalOutputOptionDescription">
<source>Output verbosity when reporting tests. Valid values are 'Normal', 'Detailed'. Default is 'Normal'.</source>
<target state="new">Output verbosity when reporting tests. Valid values are 'Normal', 'Detailed'. Default is 'Normal'.</target>
<note />
</trans-unit>
<trans-unit id="TerminalOutputOptionInvalidArgument">
<source>--output expects a single parameter with value 'Normal' or 'Detailed'.</source>
<target state="new">--output expects a single parameter with value 'Normal' or 'Detailed'.</target>
<note />
</trans-unit>
<trans-unit id="TerminalTestReporterDescription">
<source>Writes test results to terminal.</source>
<target state="new">Writes test results to terminal.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,16 @@ Microsoft Test Platformu telemetrisi hakkında daha fazla bilgi edinin: https://
<target state="new">Disable reporting progress to screen.</target>
<note />
</trans-unit>
<trans-unit id="TerminalOutputOptionDescription">
<source>Output verbosity when reporting tests. Valid values are 'Normal', 'Detailed'. Default is 'Normal'.</source>
<target state="new">Output verbosity when reporting tests. Valid values are 'Normal', 'Detailed'. Default is 'Normal'.</target>
<note />
</trans-unit>
<trans-unit id="TerminalOutputOptionInvalidArgument">
<source>--output expects a single parameter with value 'Normal' or 'Detailed'.</source>
<target state="new">--output expects a single parameter with value 'Normal' or 'Detailed'.</target>
<note />
</trans-unit>
<trans-unit id="TerminalTestReporterDescription">
<source>Writes test results to terminal.</source>
<target state="new">Writes test results to terminal.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,16 @@ Microsoft 测试平台会收集使用数据,帮助我们改善体验。该数
<target state="new">Disable reporting progress to screen.</target>
<note />
</trans-unit>
<trans-unit id="TerminalOutputOptionDescription">
<source>Output verbosity when reporting tests. Valid values are 'Normal', 'Detailed'. Default is 'Normal'.</source>
<target state="new">Output verbosity when reporting tests. Valid values are 'Normal', 'Detailed'. Default is 'Normal'.</target>
<note />
</trans-unit>
<trans-unit id="TerminalOutputOptionInvalidArgument">
<source>--output expects a single parameter with value 'Normal' or 'Detailed'.</source>
<target state="new">--output expects a single parameter with value 'Normal' or 'Detailed'.</target>
<note />
</trans-unit>
<trans-unit id="TerminalTestReporterDescription">
<source>Writes test results to terminal.</source>
<target state="new">Writes test results to terminal.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,16 @@ Microsoft 測試平台會收集使用量資料,以協助我們改善您的體
<target state="new">Disable reporting progress to screen.</target>
<note />
</trans-unit>
<trans-unit id="TerminalOutputOptionDescription">
<source>Output verbosity when reporting tests. Valid values are 'Normal', 'Detailed'. Default is 'Normal'.</source>
<target state="new">Output verbosity when reporting tests. Valid values are 'Normal', 'Detailed'. Default is 'Normal'.</target>
<note />
</trans-unit>
<trans-unit id="TerminalOutputOptionInvalidArgument">
<source>--output expects a single parameter with value 'Normal' or 'Detailed'.</source>
<target state="new">--output expects a single parameter with value 'Normal' or 'Detailed'.</target>
<note />
</trans-unit>
<trans-unit id="TerminalTestReporterDescription">
<source>Writes test results to terminal.</source>
<target state="new">Writes test results to terminal.</target>
Expand Down
Loading