public void TestBinaryLoggerRoundtrip() { var binLog = GetFullPath("1.binlog"); var binaryLogger = new BinaryLogger(); binaryLogger.Parameters = binLog; MSBuild.BuildProject(s_testProject, binaryLogger); var build = Serialization.Read(binLog); var xml1 = GetFullPath("1.xml"); Serialization.Write(build, xml1); Serialization.Write(build, GetFullPath("1.buildlog")); build = Serialization.Read(GetFullPath("1.buildlog")); Serialization.Write(build, GetFullPath("2.xml")); Assert.False(Differ.AreDifferent(xml1, GetFullPath("2.xml"))); build = XlinqLogReader.ReadFromXml(xml1); Serialization.Write(build, GetFullPath("3.xml")); Assert.False(Differ.AreDifferent(xml1, GetFullPath("3.xml"))); build = Serialization.Read(xml1); Serialization.Write(build, GetFullPath("4.xml")); Assert.False(Differ.AreDifferent(xml1, GetFullPath("4.xml"))); }
public void TestBinaryLoggerRoundtrip(bool useInMemoryProject) { var binLog = GetTestFile("1.binlog"); var binaryLogger = new BinaryLogger(); binaryLogger.Parameters = binLog; var buildSuccessful = useInMemoryProject ? MSBuild.BuildProjectInMemory(s_testProject, binaryLogger) : MSBuild.BuildProjectFromFile(s_testProject, binaryLogger); Assert.True(buildSuccessful); var build = Serialization.Read(binLog); var xml1 = GetTestFile("1.xml"); var xml2 = GetTestFile("2.xml"); Serialization.Write(build, xml1); Serialization.Write(build, GetTestFile("1.buildlog")); build = Serialization.Read(GetTestFile("1.buildlog")); Serialization.Write(build, xml2); Assert.False(Differ.AreDifferent(xml1, xml2)); build = XlinqLogReader.ReadFromXml(xml1); Serialization.Write(build, GetTestFile("3.xml")); Assert.False(Differ.AreDifferent(xml1, GetTestFile("3.xml"))); build = Serialization.Read(xml1); Serialization.Write(build, GetTestFile("4.xml")); Assert.False(Differ.AreDifferent(xml1, GetTestFile("4.xml"))); }