@@ -18,6 +18,11 @@ namespace BenchmarkDotNet.Tests
1818 public class CsProjGeneratorTests
1919 {
2020 private FileInfo TestAssemblyFileInfo = new FileInfo ( typeof ( CsProjGeneratorTests ) . Assembly . Location ) ;
21+ private const string runtimeHostConfigurationOptionChunk = """
22+ <ItemGroup>
23+ <RuntimeHostConfigurationOption Include="System.Runtime.Loader.UseRidGraph" Value="true" />
24+ </ItemGroup>
25+ """ ;
2126
2227 [ Theory ]
2328 [ InlineData ( "net471" , false ) ]
@@ -68,7 +73,7 @@ private void AssertParsedSdkName(string csProjContent, string targetFrameworkMon
6873
6974 private static void AssertCustomProperties ( string expected , string actual )
7075 {
71- Assert . Equal ( expected . Replace ( Environment . NewLine , "\n " ) . Replace ( "\n " , Environment . NewLine ) , actual ) ;
76+ Assert . Equal ( expected . Replace ( " \r " , "" ) . Replace ( "\n " , Environment . NewLine ) , actual ) ;
7277 }
7378
7479 [ Fact ]
@@ -158,6 +163,24 @@ public void SettingsFromPropsFileImportedUsingRelativePathGetCopies()
158163 File . Delete ( propsFilePath ) ;
159164 }
160165
166+ [ Fact ]
167+ public void RuntimeHostConfigurationOptionIsCopied ( )
168+ {
169+ string source = $@ "
170+ <Project Sdk=""Microsoft.NET.Sdk"">
171+ { runtimeHostConfigurationOptionChunk }
172+ </Project>" ;
173+
174+ var sut = new CsProjGenerator ( "netcoreapp3.0" , null , null , null , true ) ;
175+
176+ var xmlDoc = new XmlDocument ( ) ;
177+ xmlDoc . LoadXml ( source ) ;
178+ var ( customProperties , sdkName ) = sut . GetSettingsThatNeedToBeCopied ( xmlDoc , TestAssemblyFileInfo ) ;
179+
180+ AssertCustomProperties ( runtimeHostConfigurationOptionChunk , customProperties ) ;
181+ Assert . Equal ( "Microsoft.NET.Sdk" , sdkName ) ;
182+ }
183+
161184 [ Fact ]
162185 public void TheDefaultFilePathShouldBeUsedWhenAnAssemblyLocationIsEmpty ( )
163186 {
0 commit comments