@@ -25,8 +25,6 @@ internal sealed partial class TerminalOutputDevice : IHotReloadPlatformOutputDev
2525 IAsyncInitializableExtension
2626{
2727#pragma warning disable SA1310 // Field names should not contain underscore
28- private const string TESTINGPLATFORM_CONSOLEOUTPUTDEVICE_SKIP_BANNER = nameof ( TESTINGPLATFORM_CONSOLEOUTPUTDEVICE_SKIP_BANNER ) ;
29-
3028 // Opt-in knobs (env vars only) for the silence-driven heartbeat renderer used in non-cursor modes.
3129 private const string MTP_PROGRESS_SILENCE_SECONDS = nameof ( MTP_PROGRESS_SILENCE_SECONDS ) ;
3230 private const string MTP_PROGRESS_SLOW_TEST_SECONDS = nameof ( MTP_PROGRESS_SLOW_TEST_SECONDS ) ;
@@ -110,7 +108,7 @@ public TerminalOutputDevice(
110108
111109 _assemblyName = testApplicationModuleInfo . GetDisplayName ( ) ;
112110
113- if ( environment . GetEnvironmentVariable ( TESTINGPLATFORM_CONSOLEOUTPUTDEVICE_SKIP_BANNER ) is not null )
111+ if ( environment . GetEnvironmentVariable ( OutputDeviceBannerHelper . TESTINGPLATFORM_CONSOLEOUTPUTDEVICE_SKIP_BANNER ) is not null )
114112 {
115113 _bannerDisplayed = true ;
116114 }
@@ -371,7 +369,7 @@ public async Task DisplayBannerAsync(string? bannerMessage, CancellationToken ca
371369 // The env var propagates to any child test host the controller spawns so they also
372370 // stay quiet — important because the JSON document must be the sole stdout content.
373371 _bannerDisplayed = true ;
374- _environment . SetEnvironmentVariable ( TESTINGPLATFORM_CONSOLEOUTPUTDEVICE_SKIP_BANNER , "1" ) ;
372+ _environment . SetEnvironmentVariable ( OutputDeviceBannerHelper . TESTINGPLATFORM_CONSOLEOUTPUTDEVICE_SKIP_BANNER , "1" ) ;
375373 return ;
376374 }
377375
@@ -380,7 +378,7 @@ public async Task DisplayBannerAsync(string? bannerMessage, CancellationToken ca
380378 if ( ! _bannerDisplayed && ! _isServerMode )
381379 {
382380 // skip the banner for the children processes
383- _environment . SetEnvironmentVariable ( TESTINGPLATFORM_CONSOLEOUTPUTDEVICE_SKIP_BANNER , "1" ) ;
381+ _environment . SetEnvironmentVariable ( OutputDeviceBannerHelper . TESTINGPLATFORM_CONSOLEOUTPUTDEVICE_SKIP_BANNER , "1" ) ;
384382
385383 _bannerDisplayed = true ;
386384
@@ -390,33 +388,7 @@ public async Task DisplayBannerAsync(string? bannerMessage, CancellationToken ca
390388 }
391389 else
392390 {
393- StringBuilder stringBuilder = new ( ) ;
394- stringBuilder . Append ( _platformInformation . Name ) ;
395-
396- if ( _platformInformation . Version is { } version )
397- {
398- stringBuilder . Append ( CultureInfo . InvariantCulture , $ " v{ version } ") ;
399- if ( _platformInformation . CommitHash is { } commitHash )
400- {
401- stringBuilder . Append ( CultureInfo . InvariantCulture , $ "+{ commitHash [ .. 10 ] } ") ;
402- }
403- }
404-
405- if ( _platformInformation . BuildDate is { } buildDate )
406- {
407- stringBuilder . Append ( CultureInfo . InvariantCulture , $ " (UTC { buildDate . UtcDateTime : d} )") ;
408- }
409-
410- if ( _runtimeFeature . IsDynamicCodeSupported )
411- {
412- stringBuilder . Append ( " [" ) ;
413- stringBuilder . Append ( _longArchitecture ) ;
414- stringBuilder . Append ( " - " ) ;
415- stringBuilder . Append ( _runtimeFramework ) ;
416- stringBuilder . Append ( ']' ) ;
417- }
418-
419- _terminalTestReporter . WriteMessage ( stringBuilder . ToString ( ) ) ;
391+ _terminalTestReporter . WriteMessage ( OutputDeviceBannerHelper . BuildBannerText ( _platformInformation , _runtimeFeature , _longArchitecture , _runtimeFramework ) ) ;
420392 }
421393 }
422394
0 commit comments