From 1b2a730d7ebe77fae8c8fbc4c3cc133f04a18e8d Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Thu, 7 Mar 2024 20:48:58 -0500 Subject: [PATCH] Add tests demonstrating linker error. --- .../WixToolsetTest.UI/UIExtensionFixture.cs | 66 ++++++++++++++----- src/ext/UI/ui.cmd | 2 +- 2 files changed, 50 insertions(+), 18 deletions(-) diff --git a/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs b/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs index c43af04ba..610fd5ed3 100644 --- a/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs +++ b/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs @@ -19,7 +19,7 @@ public void CanBuildUsingWixUIAdvanced() var bindFolder = TestData.Get(@"TestData", "data"); var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); - var results = build.BuildAndQuery(Build, "Binary", "Dialog", "CustomAction", "ControlEvent"); + var results = build.BuildAndQuery(Build, "Binary", "Dialog", "CustomAction", "ControlEvent", "InstallUISequence"); Assert.Single(results, result => result.StartsWith("Dialog:AdvancedWelcomeEulaDlg\t")); WixAssert.CompareLineByLine(new[] { @@ -46,6 +46,11 @@ public void CanBuildUsingWixUIAdvanced() "ControlEvent:BrowseDlg\tOK\tDoAction\tWixUIValidatePath_X86\tNOT WIXUI_DONTVALIDATEPATH\t1", "ControlEvent:InstallDirDlg\tNext\tDoAction\tWixUIValidatePath_X86\tNOT WIXUI_DONTVALIDATEPATH\t2", }, results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).ToArray()); + WixAssert.CompareLineByLine(new[] + { + "InstallUISequence:AdvancedWelcomeEulaDlg\tNOT Installed\t1296", + "InstallUISequence:WelcomeDlg\tInstalled AND PATCH\t1295", + }, results.Where(r => r.StartsWith("InstallUISequence:AdvancedWelcome") || r.StartsWith("InstallUISequence:Welcome")).ToArray()); } [Fact] @@ -55,7 +60,7 @@ public void CanBuildUsingWixUIAdvancedX64() var bindFolder = TestData.Get(@"TestData", "data"); var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); - var results = build.BuildAndQuery(BuildX64, "Binary", "Dialog", "CustomAction", "ControlEvent"); + var results = build.BuildAndQuery(BuildX64, "Binary", "Dialog", "CustomAction", "ControlEvent", "InstallUISequence"); Assert.Single(results, result => result.StartsWith("Dialog:AdvancedWelcomeEulaDlg\t")); WixAssert.CompareLineByLine(new[] { @@ -91,7 +96,7 @@ public void CanBuildUsingWixUIAdvancedARM64() var bindFolder = TestData.Get(@"TestData", "data"); var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); - var results = build.BuildAndQuery(BuildARM64, "Binary", "Dialog", "CustomAction", "ControlEvent"); + var results = build.BuildAndQuery(BuildARM64, "Binary", "Dialog", "CustomAction", "ControlEvent", "InstallUISequence"); Assert.Single(results, result => result.StartsWith("Dialog:AdvancedWelcomeEulaDlg\t")); WixAssert.CompareLineByLine(new[] { @@ -120,14 +125,14 @@ public void CanBuildUsingWixUIAdvancedARM64() }, results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).ToArray()); } - [Fact] + [Fact(Skip = "Linker problem")] public void CanBuildUsingWixUIFeatureTree() { var folder = TestData.Get(@"TestData", "WixUI_FeatureTree"); var bindFolder = TestData.Get(@"TestData", "data"); var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); - var results = build.BuildAndQuery(BuildX64, "Binary", "Dialog", "CustomAction", "ControlEvent"); + var results = build.BuildAndQuery(BuildX64, "Binary", "Dialog", "CustomAction", "ControlEvent", "InstallUISequence"); Assert.Single(results, result => result.StartsWith("Dialog:WelcomeDlg\t")); Assert.Single(results, result => result.StartsWith("Dialog:CustomizeDlg\t")); Assert.Empty(results.Where(result => result.StartsWith("Dialog:SetupTypeDlg\t"))); @@ -150,17 +155,22 @@ public void CanBuildUsingWixUIFeatureTree() { "ControlEvent:LicenseAgreementDlg\tPrint\tDoAction\tWixUIPrintEula_X64\t1\t1", }, results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).ToArray()); + WixAssert.CompareLineByLine(new[] + { + "InstallUISequence:WelcomeDlg\tNOT Installed OR PATCH\t1297", + }, results.Where(r => r.StartsWith("InstallUISequence:AdvancedWelcome") || r.StartsWith("InstallUISequence:Welcome")).ToArray()); } - [Fact] - public void CanBuildUsingWixUIInstallDirWithCustomizedEula() + [Fact(Skip = "Linker problem")] + public void CanBuildWithWixUIInstallDirWithCustomizedEula() { var folder = TestData.Get(@"TestData", "WixUI_InstallDir"); var bindFolder = TestData.Get(@"TestData", "data"); var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); - var results = build.BuildAndQuery(BuildEula, "Binary", "Dialog", "CustomAction", "Property", "ControlEvent"); + var results = build.BuildAndQuery(BuildEula, "Binary", "Dialog", "CustomAction", "Property", "ControlEvent", "InstallUISequence"); Assert.Single(results, result => result.StartsWith("Dialog:InstallDirDlg\t")); + Assert.Single(results, result => result.StartsWith("Dialog:WelcomeDlg\t")); WixAssert.CompareLineByLine(new[] { "Binary:WixUI_Bmp_Banner\t[Binary data]", @@ -186,6 +196,10 @@ public void CanBuildUsingWixUIInstallDirWithCustomizedEula() "ControlEvent:InstallDirDlg\tNext\tDoAction\tWixUIValidatePath_X86\tNOT WIXUI_DONTVALIDATEPATH\t2", "ControlEvent:LicenseAgreementDlg\tPrint\tDoAction\tWixUIPrintEula_X86\t1\t1", }, results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).OrderBy(s => s).ToArray()); + WixAssert.CompareLineByLine(new[] + { + "InstallUISequence:WelcomeDlg\tNOT Installed OR PATCH\t1297", + }, results.Where(r => r.StartsWith("InstallUISequence:AdvancedWelcome") || r.StartsWith("InstallUISequence:Welcome")).ToArray()); } [Fact] @@ -195,7 +209,7 @@ public void CanBuildUsingWixUIMinimal() var bindFolder = TestData.Get(@"TestData", "data"); var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); - var results = build.BuildAndQuery(Build, "Binary", "Dialog", "CustomAction", "ControlEvent"); + var results = build.BuildAndQuery(Build, "Binary", "Dialog", "CustomAction", "ControlEvent", "InstallUISequence"); Assert.Single(results, result => result.StartsWith("Dialog:WelcomeEulaDlg\t")); WixAssert.CompareLineByLine(new[] { @@ -215,6 +229,11 @@ public void CanBuildUsingWixUIMinimal() { "ControlEvent:WelcomeEulaDlg\tPrint\tDoAction\tWixUIPrintEula_X86\t1\t1", }, results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).OrderBy(s => s).ToArray()); + WixAssert.CompareLineByLine(new[] + { + "InstallUISequence:WelcomeDlg\tInstalled AND PATCH\t1295", + "InstallUISequence:WelcomeEulaDlg\tNOT Installed\t1296", + }, results.Where(r => r.StartsWith("InstallUISequence:AdvancedWelcome") || r.StartsWith("InstallUISequence:Welcome")).ToArray()); } [Fact] @@ -255,14 +274,14 @@ public void CanBuildUsingWixUIMinimalAndReadPdb() } } - [Fact] + [Fact(Skip = "Linker problem")] public void CanBuildUsingWixUIMondo() { var folder = TestData.Get(@"TestData", "WixUI_Mondo"); var bindFolder = TestData.Get(@"TestData", "data"); var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); - var results = build.BuildAndQuery(Build, "Binary", "Dialog", "CustomAction", "ControlEvent"); + var results = build.BuildAndQuery(Build, "Binary", "Dialog", "CustomAction", "ControlEvent", "InstallUISequence"); Assert.Single(results, result => result.StartsWith("Dialog:WelcomeDlg\t")); Assert.Single(results, result => result.StartsWith("Dialog:CustomizeDlg\t")); Assert.Single(results, result => result.StartsWith("Dialog:SetupTypeDlg\t")); @@ -286,6 +305,10 @@ public void CanBuildUsingWixUIMondo() "ControlEvent:BrowseDlg\tOK\tDoAction\tWixUIValidatePath_X86\tNOT WIXUI_DONTVALIDATEPATH\t3", "ControlEvent:LicenseAgreementDlg\tPrint\tDoAction\tWixUIPrintEula_X86\t1\t1", }, results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).ToArray()); + WixAssert.CompareLineByLine(new[] + { + "InstallUISequence:WelcomeDlg\tInstalled AND PATCH\t1295", + }, results.Where(r => r.StartsWith("InstallUISequence:AdvancedWelcome") || r.StartsWith("InstallUISequence:Welcome")).ToArray()); } [Fact] @@ -302,14 +325,14 @@ public void CanBuildUsingWixUIMondoLocalized() }, results.Where(s => s.StartsWith("Control:ErrorDlg\tY")).Select(s => s.Split('\t')[9]).ToArray()); } - [Fact] - public void CanBuildUsingWithInstallDirAndRemovedDialog() + [Fact(Skip = "Linker problem")] + public void CanBuildWithInstallDirAndRemovedDialog() { var folder = TestData.Get(@"TestData", "InstallDir_NoLicense"); var bindFolder = TestData.Get(@"TestData", "data"); var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); - var results = build.BuildAndQuery(Build, "Binary", "Dialog", "CustomAction", "Property", "ControlEvent"); + var results = build.BuildAndQuery(Build, "Binary", "Dialog", "CustomAction", "Property", "ControlEvent", "InstallUISequence"); Assert.Single(results, result => result.StartsWith("Dialog:InstallDirDlg\t")); WixAssert.CompareLineByLine(new[] { @@ -336,16 +359,21 @@ public void CanBuildUsingWithInstallDirAndRemovedDialog() }, results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).OrderBy(s => s).ToArray()); Assert.Empty(results.Where(result => result.Contains("LicenseAgreementDlg")).ToArray()); + + WixAssert.CompareLineByLine(new[] + { + "InstallUISequence:WelcomeDlg\tNOT Installed OR PATCH\t1297", + }, results.Where(r => r.StartsWith("InstallUISequence:AdvancedWelcome") || r.StartsWith("InstallUISequence:Welcome")).ToArray()); } - [Fact] - public void CanBuildUsingWithInstallDirAndAddedDialog() + [Fact(Skip = "Linker problem")] + public void CanBuildWithInstallDirAndAddedDialog() { var folder = TestData.Get(@"TestData", "InstallDir_SpecialDlg"); var bindFolder = TestData.Get(@"TestData", "data"); var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); - var results = build.BuildAndQuery(BuildX64, "Binary", "Control", "Dialog", "CustomAction", "Property", "ControlEvent"); + var results = build.BuildAndQuery(BuildX64, "Binary", "Control", "Dialog", "CustomAction", "Property", "ControlEvent", "InstallUISequence"); Assert.Single(results, result => result.StartsWith("Dialog:InstallDirDlg\t")); WixAssert.CompareLineByLine(new[] { @@ -372,6 +400,10 @@ public void CanBuildUsingWithInstallDirAndAddedDialog() "ControlEvent:InstallDirDlg\tNext\tDoAction\tWixUIValidatePath_X64\tNOT WIXUI_DONTVALIDATEPATH\t2", "ControlEvent:LicenseAgreementDlg\tPrint\tDoAction\tWixUIPrintEula_X64\t1\t1", }, results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).OrderBy(s => s).ToArray()); + WixAssert.CompareLineByLine(new[] + { + "InstallUISequence:WelcomeDlg\tNOT Installed OR PATCH\t1297", + }, results.Where(r => r.StartsWith("InstallUISequence:AdvancedWelcome") || r.StartsWith("InstallUISequence:Welcome")).ToArray()); Assert.Equal(8, results.Where(result => result.StartsWith("Control:") && result.Contains("SpecialDlg")).Count()); Assert.Equal(5, results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("SpecialDlg")).Count()); diff --git a/src/ext/UI/ui.cmd b/src/ext/UI/ui.cmd index 67ee38105..a990db91c 100644 --- a/src/ext/UI/ui.cmd +++ b/src/ext/UI/ui.cmd @@ -23,7 +23,7 @@ msbuild -Restore -p:Configuration=%_C% -tl -nologo -warnaserror -bl:%_L%\ext_ui_build.binlog || exit /b :: Test -:: dotnet test -c %_C% --no-build test\WixToolsetTest.UI || exit /b +dotnet test -c %_C% --no-build test\WixToolsetTest.UI || exit /b :: Pack msbuild -t:Pack -p:Configuration=%_C% -tl -nologo -warnaserror -p:NoBuild=true wixext\WixToolset.UI.wixext.csproj || exit /b