@@ -105,12 +105,19 @@ static Tester()
105
105
TesterPath = Path . GetDirectoryName ( typeof ( Tester ) . Assembly . Location ) ;
106
106
TestCasePath = Path . Combine ( TesterPath , "../../../../TestCases" ) ;
107
107
#if DEBUG
108
- testRunnerBasePath = Path . Combine ( TesterPath , "../../../../../ICSharpCode.Decompiler.TestRunner/bin/Debug/net7 .0" ) ;
108
+ testRunnerBasePath = Path . Combine ( TesterPath , "../../../../../ICSharpCode.Decompiler.TestRunner/bin/Debug/net8 .0" ) ;
109
109
#else
110
- testRunnerBasePath = Path . Combine ( TesterPath , "../../../../../ICSharpCode.Decompiler.TestRunner/bin/Release/net7 .0" ) ;
110
+ testRunnerBasePath = Path . Combine ( TesterPath , "../../../../../ICSharpCode.Decompiler.TestRunner/bin/Release/net8 .0" ) ;
111
111
#endif
112
- packagesPropsFile = Path . Combine ( TesterPath , "../../../../../packages.props" ) ;
113
- roslynLatestVersion = XDocument . Load ( packagesPropsFile ) . XPathSelectElement ( "//RoslynVersion" ) . Value ;
112
+ // To parse: <Project><ItemGroup><PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0-3.final" />
113
+ packagesPropsFile = Path . Combine ( TesterPath , "../../../../../Directory.Packages.props" ) ;
114
+ roslynLatestVersion = ( ( IEnumerable < object > ) ( XDocument
115
+ . Load ( packagesPropsFile )
116
+ . XPathEvaluate ( "//Project//ItemGroup//PackageVersion[@Include='Microsoft.CodeAnalysis.CSharp']/@Version" ) ) )
117
+ . OfType < XAttribute > ( )
118
+ . Single ( )
119
+ . Value ;
120
+
114
121
roslynToolset = new RoslynToolset ( ) ;
115
122
vswhereToolset = new VsWhereToolset ( ) ;
116
123
}
@@ -191,7 +198,7 @@ public static async Task<string> AssembleIL(string sourceFileName, AssemblerOpti
191
198
{
192
199
Console . WriteLine ( "errors:" + Environment . NewLine + result . StandardError ) ;
193
200
}
194
- Assert . AreEqual ( 0 , result . ExitCode , "ilasm failed" ) ;
201
+ Assert . That ( result . ExitCode , Is . EqualTo ( 0 ) , "ilasm failed" ) ;
195
202
196
203
return outputFile ;
197
204
}
@@ -244,7 +251,7 @@ public static async Task<string> Disassemble(string sourceFileName, string outpu
244
251
{
245
252
Console . WriteLine ( "errors:" + Environment . NewLine + result . StandardError ) ;
246
253
}
247
- Assert . AreEqual ( 0 , result . ExitCode , "ildasm failed" ) ;
254
+ Assert . That ( result . ExitCode , Is . EqualTo ( 0 ) , "ildasm failed" ) ;
248
255
249
256
// Unlike the .imagebase directive (which is a fixed value when compiling with /deterministic),
250
257
// the image base comment still varies... ildasm putting a random number here?
@@ -270,8 +277,8 @@ private static string ReplacePrivImplDetails(string il)
270
277
}
271
278
272
279
static readonly string coreRefAsmPath = new DotNetCorePathFinder ( TargetFrameworkIdentifier . NET ,
273
- new Version ( 7 , 0 ) , "Microsoft.NETCore.App" )
274
- . GetReferenceAssemblyPath ( ".NETCoreApp,Version=v7 .0" ) ;
280
+ new Version ( 8 , 0 ) , "Microsoft.NETCore.App" )
281
+ . GetReferenceAssemblyPath ( ".NETCoreApp,Version=v8 .0" ) ;
275
282
276
283
public static readonly string RefAsmPath = Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . ProgramFilesX86 ) ,
277
284
@"Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2" ) ;
@@ -309,7 +316,7 @@ private static string ReplacePrivImplDetails(string il)
309
316
310
317
const string targetFrameworkAttributeSnippet = @"
311
318
312
- [assembly: System.Runtime.Versioning.TargetFramework("".NETCoreApp,Version=v7 .0"", FrameworkDisplayName = """")]
319
+ [assembly: System.Runtime.Versioning.TargetFramework("".NETCoreApp,Version=v8 .0"", FrameworkDisplayName = """")]
313
320
314
321
" ;
315
322
@@ -345,6 +352,7 @@ public static List<string> GetPreprocessorSymbols(CompilerOptions flags)
345
352
preprocessorSymbols . Add ( "NETCORE" ) ;
346
353
preprocessorSymbols . Add ( "NET60" ) ;
347
354
preprocessorSymbols . Add ( "NET70" ) ;
355
+ preprocessorSymbols . Add ( "NET80" ) ;
348
356
}
349
357
preprocessorSymbols . Add ( "ROSLYN" ) ;
350
358
preprocessorSymbols . Add ( "CS60" ) ;
@@ -374,6 +382,7 @@ public static List<string> GetPreprocessorSymbols(CompilerOptions flags)
374
382
preprocessorSymbols . Add ( "ROSLYN4" ) ;
375
383
preprocessorSymbols . Add ( "CS100" ) ;
376
384
preprocessorSymbols . Add ( "CS110" ) ;
385
+ preprocessorSymbols . Add ( "CS120" ) ;
377
386
}
378
387
}
379
388
else if ( ( flags & CompilerOptions . UseMcsMask ) != 0 )
@@ -511,7 +520,7 @@ public static async Task<CompilerResults> CompileCSharp(string sourceFileName, C
511
520
Console . WriteLine ( "errors:" + Environment . NewLine + result . StandardError ) ;
512
521
}
513
522
514
- Assert . AreEqual ( 0 , result . ExitCode , "csc failed" ) ;
523
+ Assert . That ( result . ExitCode , Is . EqualTo ( 0 ) , "csc failed" ) ;
515
524
516
525
return results ;
517
526
}
@@ -573,7 +582,7 @@ public static async Task<CompilerResults> CompileCSharp(string sourceFileName, C
573
582
{
574
583
Console . WriteLine ( "errors:" + Environment . NewLine + result . StandardError ) ;
575
584
}
576
- Assert . AreEqual ( 0 , result . ExitCode , "mcs failed" ) ;
585
+ Assert . That ( result . ExitCode , Is . EqualTo ( 0 ) , "mcs failed" ) ;
577
586
578
587
return results ;
579
588
}
@@ -755,8 +764,8 @@ public static async Task RunAndCompareOutput(string testFileName, string outputF
755
764
( result2 , output2 , error2 ) = await Run ( decompiledOutputFile ) . ConfigureAwait ( false ) ;
756
765
}
757
766
758
- Assert . AreEqual ( 0 , result1 , "Exit code != 0; did the test case crash?" + Environment . NewLine + error1 ) ;
759
- Assert . AreEqual ( 0 , result2 , "Exit code != 0; did the decompiled code crash?" + Environment . NewLine + error2 ) ;
767
+ Assert . That ( result1 , Is . EqualTo ( 0 ) , "Exit code != 0; did the test case crash?" + Environment . NewLine + error1 ) ;
768
+ Assert . That ( result2 , Is . EqualTo ( 0 ) , "Exit code != 0; did the decompiled code crash?" + Environment . NewLine + error2 ) ;
760
769
761
770
if ( output1 != output2 || error1 != error2 )
762
771
{
@@ -842,7 +851,7 @@ public static async Task SignAssembly(string assemblyPath, string keyFilePath)
842
851
. WithValidation ( CommandResultValidation . None ) ;
843
852
844
853
var result = await command . ExecuteBufferedAsync ( ) . ConfigureAwait ( false ) ;
845
- Assert . AreEqual ( 0 , result . ExitCode , "sn failed" ) ;
854
+ Assert . That ( result . ExitCode , Is . EqualTo ( 0 ) , "sn failed" ) ;
846
855
847
856
if ( ! string . IsNullOrWhiteSpace ( result . StandardOutput ) )
848
857
{
0 commit comments