From e03595bdca426a03ad740e4c312f028f97f465ec Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Fri, 8 Nov 2019 13:37:15 +1000 Subject: Add failing test for decompiling a non-advertised shortcut with complex Target. --- .../DecompileFixture.cs | 28 +++++++++++++++++++++ .../TestData/Shortcut/DecompiledShortcuts.wxs | 24 ++++++++++++++++++ .../TestData/Shortcut/shortcuts.msi | Bin 0 -> 32768 bytes .../WixToolsetTest.CoreIntegration.csproj | 2 ++ 4 files changed, 54 insertions(+) create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/Shortcut/DecompiledShortcuts.wxs create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/Shortcut/shortcuts.msi (limited to 'src/test/WixToolsetTest.CoreIntegration') diff --git a/src/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs b/src/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs index bace97b3..d6cf4742 100644 --- a/src/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs @@ -96,5 +96,33 @@ namespace WixToolsetTest.CoreIntegration Assert.Equal(expected, actualFormatted); } } + + [Fact(Skip = "Test demonstrates failure")] + public void CanDecompileShortcuts() + { + var folder = TestData.Get(@"TestData\Shortcut"); + + using (var fs = new DisposableFileSystem()) + { + var intermediateFolder = fs.GetFolder(); + var outputPath = Path.Combine(intermediateFolder, @"Actual.wxs"); + + var result = WixRunner.Execute(new[] + { + "decompile", + Path.Combine(folder, "shortcuts.msi"), + "-intermediateFolder", intermediateFolder, + "-o", outputPath + }); + + result.AssertSuccess(); + + var actual = File.ReadAllText(outputPath); + var actualFormatted = XDocument.Parse(actual, LoadOptions.PreserveWhitespace | LoadOptions.SetBaseUri | LoadOptions.SetLineInfo).ToString(); + var expected = XDocument.Load(Path.Combine(folder, "DecompiledShortcuts.wxs"), LoadOptions.PreserveWhitespace | LoadOptions.SetBaseUri | LoadOptions.SetLineInfo).ToString(); + + Assert.Equal(expected, actualFormatted); + } + } } } diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/Shortcut/DecompiledShortcuts.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/Shortcut/DecompiledShortcuts.wxs new file mode 100644 index 00000000..3a9e401c --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/Shortcut/DecompiledShortcuts.wxs @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/Shortcut/shortcuts.msi b/src/test/WixToolsetTest.CoreIntegration/TestData/Shortcut/shortcuts.msi new file mode 100644 index 00000000..3a24d1a8 Binary files /dev/null and b/src/test/WixToolsetTest.CoreIntegration/TestData/Shortcut/shortcuts.msi differ diff --git a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj index b0e0d855..b0139b91 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj +++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj @@ -48,7 +48,9 @@ + + -- cgit v1.2.3-55-g6feb