From f25904a47432767797efae10ffa8e1ad285b0ada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20Zgodzi=C5=84ski?= Date: Tue, 1 Mar 2011 20:38:53 +0100 Subject: [PATCH] changed TextRunner to accept test file name. --- .../Tests/CustomAttributes/S_CustomAttributes.cs | 2 +- ICSharpCode.Decompiler/Tests/TestRunner.cs | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ICSharpCode.Decompiler/Tests/CustomAttributes/S_CustomAttributes.cs b/ICSharpCode.Decompiler/Tests/CustomAttributes/S_CustomAttributes.cs index bfaf57c8a0..dbd064eb48 100644 --- a/ICSharpCode.Decompiler/Tests/CustomAttributes/S_CustomAttributes.cs +++ b/ICSharpCode.Decompiler/Tests/CustomAttributes/S_CustomAttributes.cs @@ -20,7 +20,7 @@ public enum EnumWithFlag [AttributeUsage(AttributeTargets.All)] public class MyAttribute : Attribute { - public MyAttribute(CustomAtributes.EnumWithFlag en) + public MyAttribute(CustomAtributes.EnumWithFlag en) : base() { } } diff --git a/ICSharpCode.Decompiler/Tests/TestRunner.cs b/ICSharpCode.Decompiler/Tests/TestRunner.cs index 543200603d..71815fffac 100644 --- a/ICSharpCode.Decompiler/Tests/TestRunner.cs +++ b/ICSharpCode.Decompiler/Tests/TestRunner.cs @@ -14,9 +14,12 @@ namespace ICSharpCode.Decompiler.Tests { public class TestRunner { - public static void Main() + public static void Main(string[] args) { - TestFile(@"..\..\Tests\DelegateConstruction.cs"); + if (args.Length == 1) + TestFile(args[0]); + else + TestFile(@"..\..\Tests\DelegateConstruction.cs"); Console.ReadKey(); } @@ -27,6 +30,7 @@ static void TestFile(string fileName) AssemblyDefinition assembly = Compile(code); AstBuilder decompiler = new AstBuilder(new DecompilerContext()); decompiler.AddAssembly(assembly); + decompiler.Transform(new Helpers.RemoveCompilerAttribute()); StringWriter output = new StringWriter(); decompiler.GenerateCode(new PlainTextOutput(output)); StringWriter diff = new StringWriter();