--- /dev/null
+<?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
-#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