From f76653eab39c2df233d1d884542241c9aea4c5ff Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Wed, 23 Oct 2019 18:36:06 -0400 Subject: Undo CreateTuple change and add ErrorTuple test. Strongly-typed tuples are preferred and avoid field-zero/id confusion. --- .../WixToolsetTest.CoreIntegration/MsiFixture.cs | 36 ++++++++++++++++++++++ .../TestData/ErrorsInUI/Package.en-us.wxl | 9 ++++++ .../TestData/ErrorsInUI/Package.wxs | 21 +++++++++++++ .../TestData/ErrorsInUI/PackageComponents.wxs | 15 +++++++++ .../TestData/ErrorsInUI/data/test.txt | 1 + .../WixToolsetTest.CoreIntegration.csproj | 4 +++ 6 files changed, 86 insertions(+) create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/ErrorsInUI/Package.en-us.wxl create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/ErrorsInUI/Package.wxs create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/ErrorsInUI/PackageComponents.wxs create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/ErrorsInUI/data/test.txt (limited to 'src/test') diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs index 2d6feb4e..d056a1d6 100644 --- a/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs @@ -247,6 +247,42 @@ namespace WixToolsetTest.CoreIntegration } } + [Fact] + public void CanBuildWithErrorTable() + { + var folder = TestData.Get(@"TestData\ErrorsInUI"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var intermediateFolder = Path.Combine(baseFolder, "obj"); + + var result = WixRunner.Execute(new[] + { + "build", + Path.Combine(folder, "Package.wxs"), + Path.Combine(folder, "PackageComponents.wxs"), + "-loc", Path.Combine(folder, "Package.en-us.wxl"), + "-bindpath", Path.Combine(folder, "data"), + "-intermediateFolder", intermediateFolder, + "-o", Path.Combine(baseFolder, @"bin\test.msi") + }); + + result.AssertSuccess(); + + Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.msi"))); + Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.wixpdb"))); + Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\MsiPackage\test.txt"))); + + var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"test.wir")); + var section = intermediate.Sections.Single(); + + var error = section.Tuples.OfType().Single(); + Assert.Equal(1234, error.Error); + Assert.Equal("Category 55 Emergency Doomsday Crisis", error.Message.Trim()); + } + } + [Fact] public void CanLoadPdbGeneratedByBuild() { diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/ErrorsInUI/Package.en-us.wxl b/src/test/WixToolsetTest.CoreIntegration/TestData/ErrorsInUI/Package.en-us.wxl new file mode 100644 index 00000000..066e16bb --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/ErrorsInUI/Package.en-us.wxl @@ -0,0 +1,9 @@ + + + + + A newer version of [ProductName] is already installed. + MsiPackage + diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/ErrorsInUI/Package.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/ErrorsInUI/Package.wxs new file mode 100644 index 00000000..6da3dcbe --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/ErrorsInUI/Package.wxs @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/ErrorsInUI/PackageComponents.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/ErrorsInUI/PackageComponents.wxs new file mode 100644 index 00000000..db128695 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/ErrorsInUI/PackageComponents.wxs @@ -0,0 +1,15 @@ + + + + + + Category 55 Emergency Doomsday Crisis + + + + + + + + + diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/ErrorsInUI/data/test.txt b/src/test/WixToolsetTest.CoreIntegration/TestData/ErrorsInUI/data/test.txt new file mode 100644 index 00000000..cd0db0e1 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/ErrorsInUI/data/test.txt @@ -0,0 +1 @@ +This is test.txt. \ No newline at end of file diff --git a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj index ab6f8d98..1f8860ef 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj +++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj @@ -28,6 +28,10 @@ + + + + -- cgit v1.2.3-55-g6feb