diff options
author | Rob Mensching <rob@firegiant.com> | 2022-09-23 17:59:14 -0700 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2022-09-27 16:25:20 -0700 |
commit | 038b93757c3fe329d8943cae55b16536c4718b60 (patch) | |
tree | 74b4e2732a299ae7848b21a269210bf6580ab53d | |
parent | aa07c119f05f99d040a8259488d561ebd1d15cae (diff) | |
download | wix-038b93757c3fe329d8943cae55b16536c4718b60.tar.gz wix-038b93757c3fe329d8943cae55b16536c4718b60.tar.bz2 wix-038b93757c3fe329d8943cae55b16536c4718b60.zip |
Simplify patch fixture internal results
-rw-r--r-- | src/wix/test/WixToolsetTest.CoreIntegration/PatchFixture.cs | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/PatchFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/PatchFixture.cs index c330fd02..b4921080 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/PatchFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/PatchFixture.cs | |||
@@ -61,13 +61,9 @@ namespace WixToolsetTest.CoreIntegration | |||
61 | { | 61 | { |
62 | var tempFolder = fs.GetFolder(); | 62 | var tempFolder = fs.GetFolder(); |
63 | 63 | ||
64 | var baselinePdb = BuildMsi("Baseline.msi", folder, tempFolder, "1.0.0", "1.0.0", "1.0.0"); | 64 | var baselinePath = BuildMsi("Baseline.msi", folder, tempFolder, "1.0.0", "1.0.0", "1.0.0"); |
65 | var update1Pdb = BuildMsi("Update.msi", folder, tempFolder, "1.0.1", "1.0.1", "1.0.1"); | 65 | var update1Path = BuildMsi("Update.msi", folder, tempFolder, "1.0.1", "1.0.1", "1.0.1"); |
66 | var patchPdb = BuildMsp("Patch1.msp", folder, tempFolder, "1.0.1"); | 66 | var patchPath = BuildMsp("Patch1.msp", folder, tempFolder, "1.0.1"); |
67 | var patchPath = Path.ChangeExtension(patchPdb, ".msp"); | ||
68 | |||
69 | Assert.True(File.Exists(baselinePdb)); | ||
70 | Assert.True(File.Exists(update1Pdb)); | ||
71 | 67 | ||
72 | var doc = GetExtractPatchXml(patchPath); | 68 | var doc = GetExtractPatchXml(patchPath); |
73 | WixAssert.StringEqual("{7D326855-E790-4A94-8611-5351F8321FCA}", doc.Root.Element(TargetProductCodeName).Value); | 69 | WixAssert.StringEqual("{7D326855-E790-4A94-8611-5351F8321FCA}", doc.Root.Element(TargetProductCodeName).Value); |
@@ -93,8 +89,7 @@ namespace WixToolsetTest.CoreIntegration | |||
93 | var baseFolder = fs.GetFolder(); | 89 | var baseFolder = fs.GetFolder(); |
94 | var tempFolderPatch = Path.Combine(baseFolder, "patch"); | 90 | var tempFolderPatch = Path.Combine(baseFolder, "patch"); |
95 | 91 | ||
96 | var patchPdb = BuildMsp("Patch1.msp", sourceFolder, tempFolderPatch, "1.0.1", bindpaths: new[] { Path.GetDirectoryName(this.templateBaselinePdb), Path.GetDirectoryName(this.templateUpdatePdb) }); | 92 | var patchPath = BuildMsp("Patch1.msp", sourceFolder, tempFolderPatch, "1.0.1", bindpaths: new[] { Path.GetDirectoryName(this.templateBaselinePdb), Path.GetDirectoryName(this.templateUpdatePdb) }); |
97 | var patchPath = Path.ChangeExtension(patchPdb, ".msp"); | ||
98 | 93 | ||
99 | var doc = GetExtractPatchXml(patchPath); | 94 | var doc = GetExtractPatchXml(patchPath); |
100 | WixAssert.StringEqual("{11111111-2222-3333-4444-555555555555}", doc.Root.Element(TargetProductCodeName).Value); | 95 | WixAssert.StringEqual("{11111111-2222-3333-4444-555555555555}", doc.Root.Element(TargetProductCodeName).Value); |
@@ -123,8 +118,7 @@ namespace WixToolsetTest.CoreIntegration | |||
123 | var baseFolder = fs.GetFolder(); | 118 | var baseFolder = fs.GetFolder(); |
124 | var tempFolderPatch = Path.Combine(baseFolder, "patch"); | 119 | var tempFolderPatch = Path.Combine(baseFolder, "patch"); |
125 | 120 | ||
126 | var patchPdb = BuildMsp("Patch1.msp", sourceFolder, tempFolderPatch, "1.0.1", bindpaths: new[] { Path.GetDirectoryName(this.templateBaselinePdb), Path.GetDirectoryName(this.templateUpdatePdb) }); | 121 | var patchPath = BuildMsp("Patch1.msp", sourceFolder, tempFolderPatch, "1.0.1", bindpaths: new[] { Path.GetDirectoryName(this.templateBaselinePdb), Path.GetDirectoryName(this.templateUpdatePdb) }); |
127 | var patchPath = Path.ChangeExtension(patchPdb, ".msp"); | ||
128 | 122 | ||
129 | var doc = GetExtractPatchXml(patchPath); | 123 | var doc = GetExtractPatchXml(patchPath); |
130 | WixAssert.StringEqual("{11111111-2222-3333-4444-555555555555}", doc.Root.Element(TargetProductCodeName).Value); | 124 | WixAssert.StringEqual("{11111111-2222-3333-4444-555555555555}", doc.Root.Element(TargetProductCodeName).Value); |
@@ -153,8 +147,7 @@ namespace WixToolsetTest.CoreIntegration | |||
153 | var baseFolder = fs.GetFolder(); | 147 | var baseFolder = fs.GetFolder(); |
154 | var tempFolderPatch = Path.Combine(baseFolder, "patch"); | 148 | var tempFolderPatch = Path.Combine(baseFolder, "patch"); |
155 | 149 | ||
156 | var patchPdb = BuildMsp("Patch1.msp", sourceFolder, tempFolderPatch, "1.0.1", bindpaths: new[] { Path.GetDirectoryName(this.templateBaselinePdb), Path.GetDirectoryName(this.templateUpdatePdb) }, updateBindpaths: new[] { Path.Combine(this.templateSourceFolder, ".update-data-alternative") }); | 150 | var patchPath = BuildMsp("Patch1.msp", sourceFolder, tempFolderPatch, "1.0.1", bindpaths: new[] { Path.GetDirectoryName(this.templateBaselinePdb), Path.GetDirectoryName(this.templateUpdatePdb) }, updateBindpaths: new[] { Path.Combine(this.templateSourceFolder, ".update-data-alternative") }); |
157 | var patchPath = Path.ChangeExtension(patchPdb, ".msp"); | ||
158 | 151 | ||
159 | var doc = GetExtractPatchXml(patchPath); | 152 | var doc = GetExtractPatchXml(patchPath); |
160 | WixAssert.StringEqual("{11111111-2222-3333-4444-555555555555}", doc.Root.Element(TargetProductCodeName).Value); | 153 | WixAssert.StringEqual("{11111111-2222-3333-4444-555555555555}", doc.Root.Element(TargetProductCodeName).Value); |
@@ -186,8 +179,7 @@ namespace WixToolsetTest.CoreIntegration | |||
186 | CreateAdminImage(this.templateBaselinePdb, adminBaselineFolder); | 179 | CreateAdminImage(this.templateBaselinePdb, adminBaselineFolder); |
187 | CreateAdminImage(this.templateUpdatePdb, adminUpdateFolder); | 180 | CreateAdminImage(this.templateUpdatePdb, adminUpdateFolder); |
188 | 181 | ||
189 | var patchPdb = BuildMsp("Patch1.msp", sourceFolder, tempFolderPatch, "1.0.1", bindpaths: new[] { adminBaselineFolder, adminUpdateFolder }); | 182 | var patchPath = BuildMsp("Patch1.msp", sourceFolder, tempFolderPatch, "1.0.1", bindpaths: new[] { adminBaselineFolder, adminUpdateFolder }); |
190 | var patchPath = Path.ChangeExtension(patchPdb, ".msp"); | ||
191 | 183 | ||
192 | var doc = GetExtractPatchXml(patchPath); | 184 | var doc = GetExtractPatchXml(patchPath); |
193 | WixAssert.StringEqual("{11111111-2222-3333-4444-555555555555}", doc.Root.Element(TargetProductCodeName).Value); | 185 | WixAssert.StringEqual("{11111111-2222-3333-4444-555555555555}", doc.Root.Element(TargetProductCodeName).Value); |
@@ -214,8 +206,7 @@ namespace WixToolsetTest.CoreIntegration | |||
214 | { | 206 | { |
215 | var tempFolder = fs.GetFolder(); | 207 | var tempFolder = fs.GetFolder(); |
216 | 208 | ||
217 | var patchPdb = BuildMsp("Patch1.msp", folder, tempFolder, "1.0.1", bindpaths: new[] { Path.GetDirectoryName(this.templateBaselinePdb), Path.GetDirectoryName(this.templateUpdateNoFilesChangedPdb) }, hasNoFiles: true); | 209 | var patchPath = BuildMsp("Patch1.msp", folder, tempFolder, "1.0.1", bindpaths: new[] { Path.GetDirectoryName(this.templateBaselinePdb), Path.GetDirectoryName(this.templateUpdateNoFilesChangedPdb) }, hasNoFiles: true); |
218 | var patchPath = Path.ChangeExtension(patchPdb, ".msp"); | ||
219 | 210 | ||
220 | var doc = GetExtractPatchXml(patchPath); | 211 | var doc = GetExtractPatchXml(patchPath); |
221 | WixAssert.StringEqual("{11111111-2222-3333-4444-555555555555}", doc.Root.Element(TargetProductCodeName).Value); | 212 | WixAssert.StringEqual("{11111111-2222-3333-4444-555555555555}", doc.Root.Element(TargetProductCodeName).Value); |
@@ -243,10 +234,9 @@ namespace WixToolsetTest.CoreIntegration | |||
243 | var tempFolderUpdate = Path.Combine(baseFolder, "update"); | 234 | var tempFolderUpdate = Path.Combine(baseFolder, "update"); |
244 | var tempFolderPatch = Path.Combine(baseFolder, "patch"); | 235 | var tempFolderPatch = Path.Combine(baseFolder, "patch"); |
245 | 236 | ||
246 | var baselinePdb = BuildMsi("Baseline.msi", folder, tempFolderBaseline, "1.0.0", "1.0.0", "1.0.0"); | 237 | var baselinePath = BuildMsi("Baseline.msi", folder, tempFolderBaseline, "1.0.0", "1.0.0", "1.0.0"); |
247 | var update1Pdb = BuildMsi("Update.msi", folder, tempFolderUpdate, "1.0.1", "1.0.1", "1.0.1"); | 238 | var update1Path = BuildMsi("Update.msi", folder, tempFolderUpdate, "1.0.1", "1.0.1", "1.0.1"); |
248 | var patchPdb = BuildMsp("Patch1.msp", folder, tempFolderPatch, "1.0.1", bindpaths: new[] { Path.GetDirectoryName(baselinePdb), Path.GetDirectoryName(update1Pdb) }); | 239 | var patchPath = BuildMsp("Patch1.msp", folder, tempFolderPatch, "1.0.1", bindpaths: new[] { Path.GetDirectoryName(baselinePath), Path.GetDirectoryName(update1Path) }); |
249 | var patchPath = Path.ChangeExtension(patchPdb, ".msp"); | ||
250 | 240 | ||
251 | var doc = GetExtractPatchXml(patchPath); | 241 | var doc = GetExtractPatchXml(patchPath); |
252 | WixAssert.StringEqual("{7D326855-E790-4A94-8611-5351F8321FCA}", doc.Root.Element(TargetProductCodeName).Value); | 242 | WixAssert.StringEqual("{7D326855-E790-4A94-8611-5351F8321FCA}", doc.Root.Element(TargetProductCodeName).Value); |
@@ -286,8 +276,7 @@ namespace WixToolsetTest.CoreIntegration | |||
286 | var tempFolderUpdate = Path.Combine(baseFolder, "update"); | 276 | var tempFolderUpdate = Path.Combine(baseFolder, "update"); |
287 | var tempFolderPatch = Path.Combine(baseFolder, "patch"); | 277 | var tempFolderPatch = Path.Combine(baseFolder, "patch"); |
288 | 278 | ||
289 | var patchPdb = BuildMsp("Patch1.msp", folder, tempFolderPatch, "1.0.1", bindpaths: new[] { Path.GetDirectoryName(this.templateBaselinePdb), Path.GetDirectoryName(this.templateUpdateNoFilesChangedPdb) }, hasNoFiles: true, warningsAsErrors: false); | 279 | var patchPath = BuildMsp("Patch1.msp", folder, tempFolderPatch, "1.0.1", bindpaths: new[] { Path.GetDirectoryName(this.templateBaselinePdb), Path.GetDirectoryName(this.templateUpdateNoFilesChangedPdb) }, hasNoFiles: true, warningsAsErrors: false); |
290 | var patchPath = Path.ChangeExtension(patchPdb, ".msp"); | ||
291 | 280 | ||
292 | var doc = GetExtractPatchXml(patchPath); | 281 | var doc = GetExtractPatchXml(patchPath); |
293 | WixAssert.StringEqual("{11111111-2222-3333-4444-555555555555}", doc.Root.Element(TargetProductCodeName).Value); | 282 | WixAssert.StringEqual("{11111111-2222-3333-4444-555555555555}", doc.Root.Element(TargetProductCodeName).Value); |
@@ -309,10 +298,9 @@ namespace WixToolsetTest.CoreIntegration | |||
309 | var tempFolderUpdate = Path.Combine(baseFolder, "update"); | 298 | var tempFolderUpdate = Path.Combine(baseFolder, "update"); |
310 | var tempFolderPatch = Path.Combine(baseFolder, "patch"); | 299 | var tempFolderPatch = Path.Combine(baseFolder, "patch"); |
311 | 300 | ||
312 | var baselinePdb = BuildMsi("Baseline.msi", sourceFolder, tempFolderBaseline, "1.0.0", "1.0.0", "1.0.0"); | 301 | var baselinePath = BuildMsi("Baseline.msi", sourceFolder, tempFolderBaseline, "1.0.0", "1.0.0", "1.0.0"); |
313 | var updatePdb = BuildMsi("Update.msi", sourceFolder, tempFolderUpdate, "1.0.1", "1.0.1", "1.0.1"); | 302 | var updatePath = BuildMsi("Update.msi", sourceFolder, tempFolderUpdate, "1.0.1", "1.0.1", "1.0.1"); |
314 | var patchPdb = BuildMsp("Patch1.msp", sourceFolder, tempFolderPatch, "1.0.1", bindpaths: new[] { Path.GetDirectoryName(baselinePdb), Path.GetDirectoryName(updatePdb) }, hasNoFiles: true); | 303 | var patchPath = BuildMsp("Patch1.msp", sourceFolder, tempFolderPatch, "1.0.1", bindpaths: new[] { Path.GetDirectoryName(baselinePath), Path.GetDirectoryName(updatePath) }, hasNoFiles: true); |
315 | var patchPath = Path.ChangeExtension(patchPdb, ".msp"); | ||
316 | 304 | ||
317 | var doc = GetExtractPatchXml(patchPath); | 305 | var doc = GetExtractPatchXml(patchPath); |
318 | WixAssert.StringEqual("{7C871EC1-1F89-4850-A6A9-D7A4C21769F6}", doc.Root.Element(TargetProductCodeName).Value); | 306 | WixAssert.StringEqual("{7C871EC1-1F89-4850-A6A9-D7A4C21769F6}", doc.Root.Element(TargetProductCodeName).Value); |
@@ -328,14 +316,18 @@ namespace WixToolsetTest.CoreIntegration | |||
328 | { | 316 | { |
329 | var tempFolder = fs.GetFolder(); | 317 | var tempFolder = fs.GetFolder(); |
330 | 318 | ||
331 | var baselinePdb = BuildMsi("Baseline.msi", Path.Combine(folder, "PackageA"), tempFolder, "1.0.0", "A", "B"); | 319 | var baselinePath = BuildMsi("Baseline.msi", Path.Combine(folder, "PackageA"), tempFolder, "1.0.0", "A", "B"); |
332 | var updatePdb = BuildMsi("Update.msi", Path.Combine(folder, "PackageA"), tempFolder, "1.0.1", "A", "B"); | 320 | var updatePath = BuildMsi("Update.msi", Path.Combine(folder, "PackageA"), tempFolder, "1.0.1", "A", "B"); |
333 | var patchAPdb = BuildMsp("PatchA.msp", Path.Combine(folder, "PatchA"), tempFolder, "1.0.1", hasNoFiles: true); | 321 | var patchAPath = BuildMsp("PatchA.msp", Path.Combine(folder, "PatchA"), tempFolder, "1.0.1", hasNoFiles: true); |
334 | var patchBPdb = BuildMsp("PatchB.msp", Path.Combine(folder, "PatchB"), tempFolder, "1.0.1", hasNoFiles: true); | 322 | var patchBPath = BuildMsp("PatchB.msp", Path.Combine(folder, "PatchB"), tempFolder, "1.0.1", hasNoFiles: true); |
335 | var patchCPdb = BuildMsp("PatchC.msp", Path.Combine(folder, "PatchC"), tempFolder, "1.0.1", hasNoFiles: true); | 323 | var patchCPath = BuildMsp("PatchC.msp", Path.Combine(folder, "PatchC"), tempFolder, "1.0.1", hasNoFiles: true); |
336 | var bundleAPdb = BuildBundle("BundleA.exe", Path.Combine(folder, "BundleA"), tempFolder); | 324 | var bundleAPath = BuildBundle("BundleA.exe", Path.Combine(folder, "BundleA"), tempFolder); |
337 | var bundleBPdb = BuildBundle("BundleB.exe", Path.Combine(folder, "BundleB"), tempFolder); | 325 | var bundleBPath = BuildBundle("BundleB.exe", Path.Combine(folder, "BundleB"), tempFolder); |
338 | var bundleCPdb = BuildBundle("BundleC.exe", Path.Combine(folder, "BundleC"), tempFolder); | 326 | var bundleCPath = BuildBundle("BundleC.exe", Path.Combine(folder, "BundleC"), tempFolder); |
327 | |||
328 | var bundleAPdb = Path.ChangeExtension(bundleAPath, ".wixpdb"); | ||
329 | var bundleBPdb = Path.ChangeExtension(bundleBPath, ".wixpdb"); | ||
330 | var bundleCPdb = Path.ChangeExtension(bundleCPath, ".wixpdb"); | ||
339 | 331 | ||
340 | VerifyPatchTargetCodesInBurnManifest(bundleAPdb, new[] | 332 | VerifyPatchTargetCodesInBurnManifest(bundleAPdb, new[] |
341 | { | 333 | { |
@@ -359,10 +351,11 @@ namespace WixToolsetTest.CoreIntegration | |||
359 | { | 351 | { |
360 | var tempFolder = fs.GetFolder(); | 352 | var tempFolder = fs.GetFolder(); |
361 | 353 | ||
362 | var baselinePdb = BuildMsi("Baseline.msi", folder, tempFolder, "1.0.0", "1.0.0", "1.0.0"); | 354 | var baselinePath = BuildMsi("Baseline.msi", folder, tempFolder, "1.0.0", "1.0.0", "1.0.0"); |
363 | var update1Pdb = BuildMsi("Update.msi", folder, tempFolder, "1.0.1", "1.0.1", "1.0.1"); | 355 | var update1Path = BuildMsi("Update.msi", folder, tempFolder, "1.0.1", "1.0.1", "1.0.1"); |
364 | var patchPdb = BuildMsp("Patch1.msp", folder, tempFolder, "1.0.1"); | 356 | var patchPath = BuildMsp("Patch1.msp", folder, tempFolder, "1.0.1"); |
365 | var bundleAPdb = BuildBundle("BundleA.exe", Path.Combine(folder, "BundleA"), tempFolder); | 357 | var bundleAPath = BuildBundle("BundleA.exe", Path.Combine(folder, "BundleA"), tempFolder); |
358 | var bundleAPdb = Path.ChangeExtension(bundleAPath, ".wixpdb"); | ||
366 | 359 | ||
367 | using (var wixOutput = WixOutput.Read(bundleAPdb)) | 360 | using (var wixOutput = WixOutput.Read(bundleAPdb)) |
368 | { | 361 | { |
@@ -407,7 +400,7 @@ namespace WixToolsetTest.CoreIntegration | |||
407 | 400 | ||
408 | result.AssertSuccess(); | 401 | result.AssertSuccess(); |
409 | 402 | ||
410 | return Path.ChangeExtension(outputPath, ".wixpdb"); | 403 | return outputPath; |
411 | } | 404 | } |
412 | 405 | ||
413 | private static string BuildMst(string transformName, string baseFolder, string templateBaselinePdb, string templateUpdatePdb) | 406 | private static string BuildMst(string transformName, string baseFolder, string templateBaselinePdb, string templateUpdatePdb) |
@@ -431,9 +424,9 @@ namespace WixToolsetTest.CoreIntegration | |||
431 | return outputPath; | 424 | return outputPath; |
432 | } | 425 | } |
433 | 426 | ||
434 | private static string BuildMsp(string outputName, string sourceFolder, string baseFolder, string defineV, IEnumerable<string> bindpaths = null, IEnumerable<string> targetBindpaths = null, IEnumerable<string> updateBindpaths = null, bool hasNoFiles = false, bool warningsAsErrors = true) | 427 | private static WixRunnerResult BuildMspForResult(string outputName, string sourceFolder, string baseFolder, string defineV, IEnumerable<string> bindpaths = null, IEnumerable<string> targetBindpaths = null, IEnumerable<string> updateBindpaths = null, bool hasNoFiles = false, bool warningsAsErrors = true) |
435 | { | 428 | { |
436 | var outputPath = Path.Combine(baseFolder, Path.Combine("bin", outputName)); | 429 | var outputPath = Path.Combine(baseFolder, "bin", outputName); |
437 | 430 | ||
438 | var args = new List<string> | 431 | var args = new List<string> |
439 | { | 432 | { |
@@ -466,9 +459,16 @@ namespace WixToolsetTest.CoreIntegration | |||
466 | 459 | ||
467 | var result = WixRunner.Execute(warningsAsErrors, args.ToArray()); | 460 | var result = WixRunner.Execute(warningsAsErrors, args.ToArray()); |
468 | 461 | ||
462 | return result; | ||
463 | } | ||
464 | |||
465 | private static string BuildMsp(string outputName, string sourceFolder, string baseFolder, string defineV, IEnumerable<string> bindpaths = null, IEnumerable<string> targetBindpaths = null, IEnumerable<string> updateBindpaths = null, bool hasNoFiles = false, bool warningsAsErrors = true) | ||
466 | { | ||
467 | var result = BuildMspForResult(outputName, sourceFolder, baseFolder, defineV, bindpaths, targetBindpaths, updateBindpaths, hasNoFiles, warningsAsErrors); | ||
468 | |||
469 | result.AssertSuccess(); | 469 | result.AssertSuccess(); |
470 | 470 | ||
471 | return Path.ChangeExtension(outputPath, ".wixpdb"); | 471 | return Path.Combine(baseFolder, "bin", outputName); |
472 | } | 472 | } |
473 | 473 | ||
474 | private static string BuildBundle(string outputName, string sourceFolder, string baseFolder) | 474 | private static string BuildBundle(string outputName, string sourceFolder, string baseFolder) |
@@ -488,7 +488,7 @@ namespace WixToolsetTest.CoreIntegration | |||
488 | 488 | ||
489 | result.AssertSuccess(); | 489 | result.AssertSuccess(); |
490 | 490 | ||
491 | return Path.ChangeExtension(outputPath, ".wixpdb"); | 491 | return outputPath; |
492 | } | 492 | } |
493 | 493 | ||
494 | private static void CreateAdminImage(string msiPath, string targetDir) | 494 | private static void CreateAdminImage(string msiPath, string targetDir) |