File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
test/dotnet.Tests/CommandTests/Run Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -1091,6 +1091,31 @@ public void BinaryLog_EvaluationData()
1091
1091
records . Count ( static r => r . Args is ProjectEvaluationFinishedEventArgs ) . Should ( ) . BeGreaterThanOrEqualTo ( 2 ) ;
1092
1092
}
1093
1093
1094
+ [ Theory , CombinatorialData ]
1095
+ public void TerminalLogger ( bool on )
1096
+ {
1097
+ var testInstance = _testAssetsManager . CreateTestDirectory ( ) ;
1098
+ var programFile = Path . Join ( testInstance . Path , "Program.cs" ) ;
1099
+ File . WriteAllText ( programFile , s_program ) ;
1100
+
1101
+ var result = new DotnetCommand ( Log , "run" , "Program.cs" , "--no-cache" )
1102
+ . WithWorkingDirectory ( testInstance . Path )
1103
+ . WithEnvironmentVariable ( "MSBUILDTERMINALLOGGER" , on ? "on" : "off" )
1104
+ . Execute ( )
1105
+ . Should ( ) . Pass ( )
1106
+ . And . HaveStdOutContaining ( "Hello from Program" ) ;
1107
+
1108
+ const string terminalLoggerSubstring = "\x1b " ;
1109
+ if ( on )
1110
+ {
1111
+ result . And . HaveStdOutContaining ( terminalLoggerSubstring ) ;
1112
+ }
1113
+ else
1114
+ {
1115
+ result . And . NotHaveStdOutContaining ( terminalLoggerSubstring ) ;
1116
+ }
1117
+ }
1118
+
1094
1119
/// <summary>
1095
1120
/// Default projects include embedded resources by default.
1096
1121
/// </summary>
You can’t perform that action at this time.
0 commit comments