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
7 changes: 5 additions & 2 deletions TUnit.Engine/Capabilities/BannerCapability.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Text;
using Microsoft.Testing.Platform.Capabilities.TestFramework;
using Microsoft.Testing.Platform.CommandLine;
using Microsoft.Testing.Platform.Logging;
using Microsoft.Testing.Platform.Services;
using TUnit.Engine.CommandLineProviders;
using TUnit.Engine.Enums;
Expand All @@ -13,14 +14,16 @@
namespace TUnit.Engine.Capabilities;

#pragma warning disable TPEXP
internal class BannerCapability(IPlatformInformation platformInformation, ICommandLineOptions commandLineOptions)
internal class BannerCapability(IPlatformInformation platformInformation, ICommandLineOptions commandLineOptions,
ILoggerFactory loggerFactory)
: IBannerMessageOwnerCapability
{
const string Separator = " | ";

public Task<string?> GetBannerMessageAsync()
{
if (commandLineOptions.IsOptionSet(DisableLogoCommandProvider.DisableLogo))
if (commandLineOptions.IsOptionSet(DisableLogoCommandProvider.DisableLogo)
|| loggerFactory.CreateLogger(nameof(BannerCapability)).IsEnabled(LogLevel.Information))
{
return Task.FromResult<string?>(GetRuntimeDetails());
}
Expand Down
5 changes: 3 additions & 2 deletions TUnit.Engine/Extensions/TestApplicationBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public static void AddTUnit(this ITestApplicationBuilder testApplicationBuilder)
testApplicationBuilder.CommandLine.AddProvider(() => new ParametersCommandProvider(extension));
testApplicationBuilder.CommandLine.AddProvider(() => new FailFastCommandProvider(extension));
testApplicationBuilder.CommandLine.AddProvider(() => new ReflectionModeCommandProvider(extension));

testApplicationBuilder.CommandLine.AddProvider(() => new DisableLogoCommandProvider(extension));

// Unified verbosity control (replaces HideTestOutput, DisableLogo, DetailedStacktrace)
testApplicationBuilder.CommandLine.AddProvider(() => new VerbosityCommandProvider(extension));

Expand All @@ -44,7 +45,7 @@ private static IReadOnlyCollection<ITestFrameworkCapability> CreateCapabilities(
return
[
new TrxReportCapability(),
new BannerCapability(serviceProvider.GetRequiredService<IPlatformInformation>(), serviceProvider.GetCommandLineOptions()),
new BannerCapability(serviceProvider.GetRequiredService<IPlatformInformation>(), serviceProvider.GetCommandLineOptions(), serviceProvider.GetLoggerFactory()),
new StopExecutionCapability(),
];
}
Expand Down
Loading