Remove NET_2_0 conditional
authorMarek Safar <marek.safar@gmail.com>
Tue, 31 Jan 2012 15:20:25 +0000 (15:20 +0000)
committerMarek Safar <marek.safar@gmail.com>
Wed, 1 Feb 2012 17:57:31 +0000 (17:57 +0000)
mcs/tools/compiler-tester/CompilerTester.csproj [new file with mode: 0644]
mcs/tools/compiler-tester/compiler-tester.cs
mcs/tools/compiler-tester/xmldocdiff.cs

diff --git a/mcs/tools/compiler-tester/CompilerTester.csproj b/mcs/tools/compiler-tester/CompilerTester.csproj
new file mode 100644 (file)
index 0000000..64c39f4
--- /dev/null
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <PropertyGroup>\r
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
+    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>\r
+    <ProductVersion>9.0.21022</ProductVersion>\r
+    <SchemaVersion>2.0</SchemaVersion>\r
+    <ProjectGuid>{DBC05DF8-EDCC-4CCE-BE9F-01FC2D566D72}</ProjectGuid>\r
+    <OutputType>Exe</OutputType>\r
+    <RootNamespace>CompilerTester</RootNamespace>\r
+    <AssemblyName>CompilerTester</AssemblyName>\r
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\r
+    <FileUpgradeFlags>\r
+    </FileUpgradeFlags>\r
+    <OldToolsVersion>3.5</OldToolsVersion>\r
+    <UpgradeBackupLocation />\r
+    <PublishUrl>publish\</PublishUrl>\r
+    <Install>true</Install>\r
+    <InstallFrom>Disk</InstallFrom>\r
+    <UpdateEnabled>false</UpdateEnabled>\r
+    <UpdateMode>Foreground</UpdateMode>\r
+    <UpdateInterval>7</UpdateInterval>\r
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>\r
+    <UpdatePeriodically>false</UpdatePeriodically>\r
+    <UpdateRequired>false</UpdateRequired>\r
+    <MapFileExtensions>true</MapFileExtensions>\r
+    <ApplicationRevision>0</ApplicationRevision>\r
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\r
+    <IsWebBootstrapper>false</IsWebBootstrapper>\r
+    <UseApplicationTrust>false</UseApplicationTrust>\r
+    <BootstrapperEnabled>true</BootstrapperEnabled>\r
+    <TargetFrameworkProfile />\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">\r
+    <DebugSymbols>true</DebugSymbols>\r
+    <DebugType>full</DebugType>\r
+    <Optimize>false</Optimize>\r
+    <OutputPath>bin\Debug</OutputPath>\r
+    <DefineConstants>DEBUG;</DefineConstants>\r
+    <ErrorReport>prompt</ErrorReport>\r
+    <WarningLevel>4</WarningLevel>\r
+    <Externalconsole>true</Externalconsole>\r
+    <PlatformTarget>x86</PlatformTarget>\r
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">\r
+    <DebugType>none</DebugType>\r
+    <Optimize>false</Optimize>\r
+    <OutputPath>bin\Release</OutputPath>\r
+    <ErrorReport>prompt</ErrorReport>\r
+    <WarningLevel>4</WarningLevel>\r
+    <Externalconsole>true</Externalconsole>\r
+    <PlatformTarget>x86</PlatformTarget>\r
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\r
+  </PropertyGroup>\r
+  <ItemGroup>\r
+    <Reference Include="System" />\r
+    <Reference Include="System.XML" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">\r
+      <Visible>False</Visible>\r
+      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>\r
+      <Install>false</Install>\r
+    </BootstrapperPackage>\r
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">\r
+      <Visible>False</Visible>\r
+      <ProductName>.NET Framework 3.5 SP1</ProductName>\r
+      <Install>true</Install>\r
+    </BootstrapperPackage>\r
+    <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">\r
+      <Visible>False</Visible>\r
+      <ProductName>Windows Installer 3.1</ProductName>\r
+      <Install>true</Install>\r
+    </BootstrapperPackage>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <Compile Include="compiler-tester.cs" />\r
+    <Compile Include="xmldocdiff.cs" />\r
+  </ItemGroup>\r
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />\r
+</Project>
\ No newline at end of file
index 07bea6c36c891725f2bd7852ae8aec8f2ded9dd5..6010bd7de9a8530386060ed7a8953d34fa1b0059 100644 (file)
@@ -181,12 +181,9 @@ namespace TestRunner {
 
                        public VerificationData (string test_file)
                        {
-#if NET_2_0
                                this.test_file = test_file;
-#endif                         
                        }
 
-#if NET_2_0
                        string test_file;
 
                        public static VerificationData FromFile (string name, XmlReader r)
@@ -244,7 +241,6 @@ namespace TestRunner {
 
                                w.WriteEndElement ();
                        }
-#endif
 
                        public MethodData FindMethodData (string method_name, string declaring_type)
                        {
@@ -741,11 +737,10 @@ namespace TestRunner {
 
                        static int GetILSize (MethodBase mi)
                        {
-#if NET_2_0
                                MethodBody body = mi.GetMethodBody ();
                                if (body != null)
                                        return body.GetILAsByteArray ().Length;
-#endif
+
                                return 0;
                        }
 
@@ -942,11 +937,7 @@ namespace TestRunner {
                public override void Initialize ()
                {
                        if (verif_file != null) {
-#if NET_2_0
                                LoadVerificationData (verif_file);
-#else
-                               throw new NotSupportedException ();
-#endif
                        }
 
                        base.Initialize ();
@@ -957,15 +948,10 @@ namespace TestRunner {
                        base.CleanUp ();
 
                        if (update_verif_file) {
-#if NET_2_0
                                UpdateVerificationData (verif_file);
-#else
-                               throw new NotSupportedException ();
-#endif
                        }
                }
 
-#if NET_2_0
                void LoadVerificationData (string file)
                {
                        LogLine ("Loading verification data from `{0}' ...", file);
@@ -1002,7 +988,6 @@ namespace TestRunner {
                                w.WriteEndElement ();
                        }
                }
-#endif
        }
 
        class NegativeChecker: Checker
@@ -1055,11 +1040,7 @@ namespace TestRunner {
                                // Some error tests require to have different error text for different runtimes.
                                if (filtered.StartsWith ("//GMCS")) {
                                        row = 1;
-#if !NET_2_0
-                                       return true;
-#else
                                        return AnalyzeTestFile(file, ref row, line, ref compiler_options, ref dependencies);
-#endif
                                }
 
                                check_error_line = !filtered.StartsWith ("//Line:0");
index 7a2d73ebc7a553852ad26f7746eb055f3ef11511..017a515152f91b9f1accef97e50990ccf7dab567 100644 (file)
-#if !NET_2_1\r
-\r
-using System;\r
-using System.Collections;\r
-using System.Xml;\r
-\r
-public class XmlComparer\r
-{\r
-       public class ComparisonException : Exception\r
-       {\r
-               public ComparisonException (string message)\r
-                       : base (message)\r
-               {\r
-               }\r
-       }\r
-\r
-       static bool debug = false;\r
-/*\r
-\r
-       public static void Main (string [] args)\r
-       {\r
-               if (args.Length < 2) {\r
-                       Console.Error.WriteLine ("Usage: xmldocdiff [reference_output.xml] [actual_output.xml]");\r
-                       return;\r
-               }\r
-               if (args.Length > 2 && args [2].EndsWith ("-debug"))\r
-                       debug = true;\r
-\r
-               try {\r
-                       Run (args[0], args[1]);\r
-               } catch (Exception ex) {\r
-                       Console.WriteLine ("FAIL: " + args [1]);\r
-                       throw ex;\r
-               }\r
-               Console.WriteLine ("PASS: " + args [1]);\r
-       }\r
-*/\r
-       public static void Compare (string reference, string output)\r
-       {\r
-               XmlDocument doc1 = new XmlDocument ();\r
-               doc1.Load (reference);\r
-               XmlDocument doc2 = new XmlDocument ();\r
-               doc2.Load (output);\r
-\r
-               XmlNodeList memberList1 = doc1.SelectNodes ("/doc/members/member");\r
-               XmlNodeList memberList2 = doc2.SelectNodes ("/doc/members/member");\r
-\r
-               Hashtable namedItems = new Hashtable ();\r
-\r
-               foreach (XmlElement el in memberList1)\r
-                       namedItems.Add (el.GetAttribute ("name"), el);\r
-               foreach (XmlElement el2 in memberList2) {\r
-                       string name = el2.GetAttribute ("name");\r
-                       XmlElement el1 = namedItems [name] as XmlElement;\r
-                       if (el1 == null) {\r
-                               Report ("Extraneous element found. Name is '{0}'", name);\r
-                               continue;\r
-                       }\r
-                       namedItems.Remove (name);\r
-\r
-                       CompareNodes (el1, el2);\r
-\r
-               }\r
-               foreach (string name in namedItems.Keys)\r
-                       Report ("Expected comment was not found. Name is {0}, XML is {1}", name, ((XmlElement) namedItems [name]).OuterXml);\r
-\r
-               // finally, check other nodes than members\r
-               doc1.SelectSingleNode ("/doc/members").RemoveAll ();\r
-               doc2.SelectSingleNode ("/doc/members").RemoveAll ();\r
-               string xml1 = doc1.OuterXml.Replace ("\r", "").Trim ();\r
-               string xml2 = doc2.OuterXml.Replace ("\r", "").Trim ();\r
-               if (xml1 != xml2)\r
-                       Report (@"Either of doc, assembly, name, members elements  are different.\r
-doc1: {0}\r
-doc2: {1}", xml1, xml2);\r
-       }\r
-\r
-       private static void CompareNodes (XmlNode n1, XmlNode n2)\r
-       {\r
-               if (n2 == null) {\r
-                       Report (@"Nodes does not exist:\r
-Node1: {0}", n1.OuterXml);\r
-                       return;\r
-               }\r
-               if (n1.NodeType != n2.NodeType) {\r
-                       Report (@"Nodes differ:\r
-Node1: {0}\r
-Node2: {1}", n1.OuterXml, n2.OuterXml);\r
-                       return;\r
-               }\r
-               if (n1.Name != n2.Name) {\r
-                       Report (@"Node names differ:\r
-Node1: {0}\r
-Node2: {1}", n1.OuterXml, n2.OuterXml);\r
-                       return;\r
-               }\r
-               if (n1 is XmlElement) {\r
-                       for (int i = 0; i < n1.Attributes.Count; i++)\r
-                               CompareNodes (n1.Attributes [i],\r
-                                       n2.Attributes [i]);\r
-                       for (int i = 0; i < n1.ChildNodes.Count; i++)\r
-                               CompareNodes (n1.ChildNodes [i],\r
-                                       n2.ChildNodes [i]);\r
-               }\r
-               if (n1.NodeType != XmlNodeType.Comment && n1.Value != null) {\r
-                       string v1 = n1.Value.Trim ().Replace ("\r", "");\r
-                       string v2 = n2.Value.Trim ().Replace ("\r", "");\r
-                       if (v1 != v2)\r
-                               Report (@"Node values differ:\r
-Node1: {0}\r
-Node2: {1}", v1, v2);\r
-               }\r
-       }\r
-\r
-       static void Report (string format, params object [] args)\r
-       {\r
-               if (debug)\r
-                       Console.WriteLine (format, args);\r
-               else\r
-                       throw new ComparisonException (String.Format (format, args));\r
-       }\r
-}\r
-\r
-#endif\r
+#if !NET_2_1
+
+using System;
+using System.Collections;
+using System.Xml;
+
+public class XmlComparer
+{
+       public class ComparisonException : Exception
+       {
+               public ComparisonException (string message)
+                       : base (message)
+               {
+               }
+       }
+
+       static bool debug = false;
+/*
+
+       public static void Main (string [] args)
+       {
+               if (args.Length < 2) {
+                       Console.Error.WriteLine ("Usage: xmldocdiff [reference_output.xml] [actual_output.xml]");
+                       return;
+               }
+               if (args.Length > 2 && args [2].EndsWith ("-debug"))
+                       debug = true;
+
+               try {
+                       Run (args[0], args[1]);
+               } catch (Exception ex) {
+                       Console.WriteLine ("FAIL: " + args [1]);
+                       throw ex;
+               }
+               Console.WriteLine ("PASS: " + args [1]);
+       }
+*/
+       public static void Compare (string reference, string output)
+       {
+               XmlDocument doc1 = new XmlDocument ();
+               doc1.Load (reference);
+               XmlDocument doc2 = new XmlDocument ();
+               doc2.Load (output);
+
+               XmlNodeList memberList1 = doc1.SelectNodes ("/doc/members/member");
+               XmlNodeList memberList2 = doc2.SelectNodes ("/doc/members/member");
+
+               Hashtable namedItems = new Hashtable ();
+
+               foreach (XmlElement el in memberList1)
+                       namedItems.Add (el.GetAttribute ("name"), el);
+               foreach (XmlElement el2 in memberList2) {
+                       string name = el2.GetAttribute ("name");
+                       XmlElement el1 = namedItems [name] as XmlElement;
+                       if (el1 == null) {
+                               Report ("Extraneous element found. Name is '{0}'", name);
+                               continue;
+                       }
+                       namedItems.Remove (name);
+
+                       CompareNodes (el1, el2);
+
+               }
+               foreach (string name in namedItems.Keys)
+                       Report ("Expected comment was not found. Name is {0}, XML is {1}", name, ((XmlElement) namedItems [name]).OuterXml);
+
+               // finally, check other nodes than members
+               doc1.SelectSingleNode ("/doc/members").RemoveAll ();
+               doc2.SelectSingleNode ("/doc/members").RemoveAll ();
+               string xml1 = doc1.OuterXml.Replace ("\r", "").Trim ();
+               string xml2 = doc2.OuterXml.Replace ("\r", "").Trim ();
+               if (xml1 != xml2)
+                       Report (@"Either of doc, assembly, name, members elements  are different.
+doc1: {0}
+doc2: {1}", xml1, xml2);
+       }
+
+       private static void CompareNodes (XmlNode n1, XmlNode n2)
+       {
+               if (n2 == null) {
+                       Report (@"Nodes does not exist:
+Node1: {0}", n1.OuterXml);
+                       return;
+               }
+               if (n1.NodeType != n2.NodeType) {
+                       Report (@"Nodes differ:
+Node1: {0}
+Node2: {1}", n1.OuterXml, n2.OuterXml);
+                       return;
+               }
+               if (n1.Name != n2.Name) {
+                       Report (@"Node names differ:
+Node1: {0}
+Node2: {1}", n1.OuterXml, n2.OuterXml);
+                       return;
+               }
+               if (n1 is XmlElement) {
+                       for (int i = 0; i < n1.Attributes.Count; i++)
+                               CompareNodes (n1.Attributes [i],
+                                       n2.Attributes [i]);
+                       for (int i = 0; i < n1.ChildNodes.Count; i++)
+                               CompareNodes (n1.ChildNodes [i],
+                                       n2.ChildNodes [i]);
+               }
+               if (n1.NodeType != XmlNodeType.Comment && n1.Value != null) {
+                       string v1 = n1.Value.Trim ().Replace ("\r", "");
+                       string v2 = n2.Value.Trim ().Replace ("\r", "");
+                       if (v1 != v2)
+                               Report (@"Node values differ:
+Node1: {0}
+Node2: {1}", v1, v2);
+               }
+       }
+
+       static void Report (string format, params object [] args)
+       {
+               if (debug)
+                       Console.WriteLine (format, args);
+               else
+                       throw new ComparisonException (String.Format (format, args));
+       }
+}
+
+#endif