@@ -98,18 +98,16 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
9898 return ;
9999 }
100100
101- bool referenceCoreLib = configOptions . GlobalOptions . ReferenceSystemPrivateCoreLib ( ) ;
102-
103101 bool isMergedTestRunnerAssembly = configOptions . GlobalOptions . IsMergedTestRunnerAssembly ( ) ;
104102
105103 // TODO: add error (maybe in MSBuild that referencing CoreLib directly from a merged test runner is not supported)
106- if ( isMergedTestRunnerAssembly && ! referenceCoreLib )
104+ if ( isMergedTestRunnerAssembly )
107105 {
108106 context . AddSource ( "FullRunner.g.cs" , GenerateFullTestRunner ( methods , aliasMap , assemblyName ) ) ;
109107 }
110108 else
111109 {
112- string consoleType = referenceCoreLib ? "Internal.Console" : "System.Console" ;
110+ string consoleType = "System.Console" ;
113111 context . AddSource ( "SimpleRunner.g.cs" , GenerateStandaloneSimpleTestRunner ( methods , aliasMap , consoleType ) ) ;
114112 }
115113 } ) ;
@@ -144,7 +142,7 @@ private static string GenerateStandaloneSimpleTestRunner(ImmutableArray<ITestInf
144142 builder . AppendLine ( string . Join ( "\n " , aliasMap . Values . Where ( alias => alias != "global" ) . Select ( alias => $ "extern alias { alias } ;") ) ) ;
145143 builder . AppendLine ( "try {" ) ;
146144 builder . AppendLine ( string . Join ( "\n " , testInfos . Select ( m => m . GenerateTestExecution ( reporter ) ) ) ) ;
147- builder . AppendLine ( $ "}} catch(System.Exception ex) {{ { consoleType } . WriteLine(ex.ToString()); return 101; } }") ;
145+ builder . AppendLine ( "} catch(System.Exception ex) { System.Console. WriteLine(ex.ToString()); return 101; }") ;
148146 builder . AppendLine ( "return 100;" ) ;
149147 return builder . ToString ( ) ;
150148 }
0 commit comments