From 65265481624d3cb583c126685e4f353461908875 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Fri, 29 May 2015 14:38:35 +0200 Subject: [PATCH] Ignore compiler warnings in unit tests --- ICSharpCode.Decompiler/Tests/Helpers/Tester.cs | 2 +- ICSharpCode.Decompiler/Tests/TestRunner.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ICSharpCode.Decompiler/Tests/Helpers/Tester.cs b/ICSharpCode.Decompiler/Tests/Helpers/Tester.cs index 0d5337ce4..208c39f19 100644 --- a/ICSharpCode.Decompiler/Tests/Helpers/Tester.cs +++ b/ICSharpCode.Decompiler/Tests/Helpers/Tester.cs @@ -31,7 +31,7 @@ namespace ICSharpCode.Decompiler.Tests.Helpers options.CompilerOptions = "/unsafe /o" + (flags.HasFlag(CompilerOptions.Optimize) ? "+" : "-") + (flags.HasFlag(CompilerOptions.UseDebug) ? " /debug" : ""); options.ReferencedAssemblies.Add("System.Core.dll"); CompilerResults results = provider.CompileAssemblyFromFile(options, sourceFileName); - if (results.Errors.Count > 0) { + if (results.Errors.Cast().Any(e => !e.IsWarning)) { StringBuilder b = new StringBuilder("Compiler error:"); foreach (var error in results.Errors) { b.AppendLine(error.ToString()); diff --git a/ICSharpCode.Decompiler/Tests/TestRunner.cs b/ICSharpCode.Decompiler/Tests/TestRunner.cs index 3e0fd2c84..d674643d6 100644 --- a/ICSharpCode.Decompiler/Tests/TestRunner.cs +++ b/ICSharpCode.Decompiler/Tests/TestRunner.cs @@ -13,7 +13,7 @@ namespace ICSharpCode.Decompiler.Tests [TestFixture] public class TestRunner { - const string TestCasePath = @"..\..\Tests\TestCases"; + const string TestCasePath = @"../../Tests/TestCases"; [Test] public void AllFilesHaveTests()