diff options
| -rw-r--r-- | src/wix/test/WixToolsetTest.CoreIntegration/PatchFixture.cs | 22 | ||||
| -rw-r--r-- | src/wix/test/WixToolsetTest.CoreIntegration/TestData/PatchWithMissingBaseline/Patch.wxs | 14 |
2 files changed, 36 insertions, 0 deletions
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/PatchFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/PatchFixture.cs index b4921080..945c346b 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/PatchFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/PatchFixture.cs | |||
| @@ -372,6 +372,28 @@ namespace WixToolsetTest.CoreIntegration | |||
| 372 | } | 372 | } |
| 373 | } | 373 | } |
| 374 | 374 | ||
| 375 | [Fact] | ||
| 376 | public void CannotBuildPatchWithMissingBaseline() | ||
| 377 | { | ||
| 378 | var sourceFolder = TestData.Get(@"TestData", "PatchWithMissingBaseline"); | ||
| 379 | |||
| 380 | using (var fs = new DisposableFileSystem()) | ||
| 381 | { | ||
| 382 | var baseFolder = fs.GetFolder(); | ||
| 383 | var tempFolderPatch = Path.Combine(baseFolder, "patch"); | ||
| 384 | var templateBaselineFolder = Path.GetDirectoryName(this.templateBaselinePdb); | ||
| 385 | var templateUpdateFolder = Path.GetDirectoryName(this.templateUpdatePdb); | ||
| 386 | |||
| 387 | var result = BuildMspForResult("Patch1.msp", sourceFolder, tempFolderPatch, "1.0.1", bindpaths: new[] { templateBaselineFolder, templateUpdateFolder }); | ||
| 388 | |||
| 389 | var messages = result.Messages.Select(m => m.ToString().Replace(tempFolderPatch, "<tempFolderPatch>").Replace(templateBaselineFolder, "<templateBaselineFolder>").Replace(templateUpdateFolder, "<templateUpdateFolder>")).ToArray(); | ||
| 390 | WixAssert.CompareLineByLine(new[] | ||
| 391 | { | ||
| 392 | @"The system cannot find the file 'Missing.wixpdb' with type 'WixPatchBaseline'. The following paths were checked: Missing.wixpdb, <tempFolderPatch>\bin\Missing.wixpdb, <templateBaselineFolder>\Missing.wixpdb, <templateUpdateFolder>\Missing.wixpdb", | ||
| 393 | }, messages); | ||
| 394 | } | ||
| 395 | } | ||
| 396 | |||
| 375 | private static string BuildMsi(string outputName, string sourceFolder, string baseFolder, string defineV, string defineA, string defineB, IEnumerable<string> bindpaths = null) | 397 | private static string BuildMsi(string outputName, string sourceFolder, string baseFolder, string defineV, string defineA, string defineB, IEnumerable<string> bindpaths = null) |
| 376 | { | 398 | { |
| 377 | var extensionPath = Path.GetFullPath(new Uri(typeof(ExampleExtensionFactory).Assembly.CodeBase).LocalPath); | 399 | var extensionPath = Path.GetFullPath(new Uri(typeof(ExampleExtensionFactory).Assembly.CodeBase).LocalPath); |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/PatchWithMissingBaseline/Patch.wxs b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/PatchWithMissingBaseline/Patch.wxs new file mode 100644 index 00000000..acd4f2d8 --- /dev/null +++ b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/PatchWithMissingBaseline/Patch.wxs | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | <Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'> | ||
| 2 | <Patch | ||
| 3 | AllowRemoval="yes" | ||
| 4 | DisplayName="~Test Patch v$(V)" | ||
| 5 | Description="~Test Small Update Patch v$(V)" | ||
| 6 | MoreInfoURL="http://www.example.com/" | ||
| 7 | Manufacturer="Example Corporation" | ||
| 8 | Classification="Update"> | ||
| 9 | |||
| 10 | <Media Id="1" Cabinet="foo.cab"> | ||
| 11 | <PatchBaseline Id="RTM" BaselineFile="Missing.wixpdb" UpdateFile="Update.wixpdb" /> | ||
| 12 | </Media> | ||
| 13 | </Patch> | ||
| 14 | </Wix> | ||
