diff options
| author | Bob Arnson <bob@firegiant.com> | 2019-10-23 18:36:06 -0400 |
|---|---|---|
| committer | Bob Arnson <bob@firegiant.com> | 2019-10-23 18:43:40 -0400 |
| commit | f76653eab39c2df233d1d884542241c9aea4c5ff (patch) | |
| tree | dc19d96e426e53f394e9f4a5e98c467dbd8d8340 /src/test/WixToolsetTest.CoreIntegration | |
| parent | 752301ba571020717862d2232e3fad585de6a39a (diff) | |
| download | wix-f76653eab39c2df233d1d884542241c9aea4c5ff.tar.gz wix-f76653eab39c2df233d1d884542241c9aea4c5ff.tar.bz2 wix-f76653eab39c2df233d1d884542241c9aea4c5ff.zip | |
Undo CreateTuple change and add ErrorTuple test.
Strongly-typed tuples are preferred and avoid field-zero/id confusion.
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration')
6 files changed, 86 insertions, 0 deletions
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 | |||
| @@ -248,6 +248,42 @@ namespace WixToolsetTest.CoreIntegration | |||
| 248 | } | 248 | } |
| 249 | 249 | ||
| 250 | [Fact] | 250 | [Fact] |
| 251 | public void CanBuildWithErrorTable() | ||
| 252 | { | ||
| 253 | var folder = TestData.Get(@"TestData\ErrorsInUI"); | ||
| 254 | |||
| 255 | using (var fs = new DisposableFileSystem()) | ||
| 256 | { | ||
| 257 | var baseFolder = fs.GetFolder(); | ||
| 258 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 259 | |||
| 260 | var result = WixRunner.Execute(new[] | ||
| 261 | { | ||
| 262 | "build", | ||
| 263 | Path.Combine(folder, "Package.wxs"), | ||
| 264 | Path.Combine(folder, "PackageComponents.wxs"), | ||
| 265 | "-loc", Path.Combine(folder, "Package.en-us.wxl"), | ||
| 266 | "-bindpath", Path.Combine(folder, "data"), | ||
| 267 | "-intermediateFolder", intermediateFolder, | ||
| 268 | "-o", Path.Combine(baseFolder, @"bin\test.msi") | ||
| 269 | }); | ||
| 270 | |||
| 271 | result.AssertSuccess(); | ||
| 272 | |||
| 273 | Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.msi"))); | ||
| 274 | Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.wixpdb"))); | ||
| 275 | Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\MsiPackage\test.txt"))); | ||
| 276 | |||
| 277 | var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"test.wir")); | ||
| 278 | var section = intermediate.Sections.Single(); | ||
| 279 | |||
| 280 | var error = section.Tuples.OfType<ErrorTuple>().Single(); | ||
| 281 | Assert.Equal(1234, error.Error); | ||
| 282 | Assert.Equal("Category 55 Emergency Doomsday Crisis", error.Message.Trim()); | ||
| 283 | } | ||
| 284 | } | ||
| 285 | |||
| 286 | [Fact] | ||
| 251 | public void CanLoadPdbGeneratedByBuild() | 287 | public void CanLoadPdbGeneratedByBuild() |
| 252 | { | 288 | { |
| 253 | var folder = TestData.Get(@"TestData\MultiFileCompressed"); | 289 | var folder = TestData.Get(@"TestData\MultiFileCompressed"); |
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 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | |||
| 3 | <!-- | ||
| 4 | This file contains the declaration of all the localizable strings. | ||
| 5 | --> | ||
| 6 | <WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl" Culture="en-US"> | ||
| 7 | <String Id="DowngradeError">A newer version of [ProductName] is already installed.</String> | ||
| 8 | <String Id="FeatureTitle">MsiPackage</String> | ||
| 9 | </WixLocalization> | ||
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 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 3 | <Product Id="*" Name="MsiPackage" Codepage="1252" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a"> | ||
| 4 | <Package InstallerVersion="200" Compressed="no" InstallScope="perMachine" /> | ||
| 5 | |||
| 6 | <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" /> | ||
| 7 | <MediaTemplate /> | ||
| 8 | |||
| 9 | <Feature Id="ProductFeature" Title="!(loc.FeatureTitle)"> | ||
| 10 | <ComponentGroupRef Id="ProductComponents" /> | ||
| 11 | </Feature> | ||
| 12 | </Product> | ||
| 13 | |||
| 14 | <Fragment> | ||
| 15 | <Directory Id="TARGETDIR" Name="SourceDir"> | ||
| 16 | <Directory Id="ProgramFilesFolder"> | ||
| 17 | <Directory Id="INSTALLFOLDER" Name="MsiPackage" /> | ||
| 18 | </Directory> | ||
| 19 | </Directory> | ||
| 20 | </Fragment> | ||
| 21 | </Wix> | ||
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 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 3 | <Fragment> | ||
| 4 | <UI> | ||
| 5 | <Error Id="1234"> | ||
| 6 | Category 55 Emergency Doomsday Crisis | ||
| 7 | </Error> | ||
| 8 | </UI> | ||
| 9 | <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> | ||
| 10 | <Component> | ||
| 11 | <File Source="test.txt" /> | ||
| 12 | </Component> | ||
| 13 | </ComponentGroup> | ||
| 14 | </Fragment> | ||
| 15 | </Wix> | ||
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 @@ | |||
| 28 | <Content Include="TestData\DialogsInInstallUISequence\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | 28 | <Content Include="TestData\DialogsInInstallUISequence\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> |
| 29 | <Content Include="TestData\DialogsInInstallUISequence\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | 29 | <Content Include="TestData\DialogsInInstallUISequence\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| 30 | <Content Include="TestData\DialogsInInstallUISequence\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | 30 | <Content Include="TestData\DialogsInInstallUISequence\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| 31 | <Content Include="TestData\ErrorsInUI\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> | ||
| 32 | <Content Include="TestData\ErrorsInUI\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | ||
| 33 | <Content Include="TestData\ErrorsInUI\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
| 34 | <Content Include="TestData\ErrorsInUI\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
| 31 | <Content Include="TestData\FeatureGroup\FeatureGroup.wxs" CopyToOutputDirectory="PreserveNewest" /> | 35 | <Content Include="TestData\FeatureGroup\FeatureGroup.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| 32 | <Content Include="TestData\Font\FontTitle.wxs" CopyToOutputDirectory="PreserveNewest" /> | 36 | <Content Include="TestData\Font\FontTitle.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| 33 | <Content Include="TestData\Icon\SampleIcon.wxs" CopyToOutputDirectory="PreserveNewest" /> | 37 | <Content Include="TestData\Icon\SampleIcon.wxs" CopyToOutputDirectory="PreserveNewest" /> |
