@@ -18,6 +18,11 @@ namespace BenchmarkDotNet.Tests
18
18
public class CsProjGeneratorTests
19
19
{
20
20
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
+ """ ;
21
26
22
27
[ Theory ]
23
28
[ InlineData ( "net471" , false ) ]
@@ -68,7 +73,7 @@ private void AssertParsedSdkName(string csProjContent, string targetFrameworkMon
68
73
69
74
private static void AssertCustomProperties ( string expected , string actual )
70
75
{
71
- Assert . Equal ( expected . Replace ( Environment . NewLine , "\n " ) . Replace ( "\n " , Environment . NewLine ) , actual ) ;
76
+ Assert . Equal ( expected . Replace ( " \r " , "" ) . Replace ( "\n " , Environment . NewLine ) , actual ) ;
72
77
}
73
78
74
79
[ Fact ]
@@ -158,6 +163,24 @@ public void SettingsFromPropsFileImportedUsingRelativePathGetCopies()
158
163
File . Delete ( propsFilePath ) ;
159
164
}
160
165
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
+
161
184
[ Fact ]
162
185
public void TheDefaultFilePathShouldBeUsedWhenAnAssemblyLocationIsEmpty ( )
163
186
{
0 commit comments