diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2021-02-27 16:29:58 -0600 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2021-03-02 15:50:47 -0600 |
| commit | b54ac261d0a03b75cf05ef370351445774b82155 (patch) | |
| tree | db5877ab147132b9fde78b53b4927e909f33661d /src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs | |
| parent | ed20ef6dc8caa5d585c1a715ff4ba577687bf291 (diff) | |
| download | wix-b54ac261d0a03b75cf05ef370351445774b82155.tar.gz wix-b54ac261d0a03b75cf05ef370351445774b82155.tar.bz2 wix-b54ac261d0a03b75cf05ef370351445774b82155.zip | |
Test big payloads by RemotePayload since real files are slow.
The test will be moved to a Burn e2e test.
#4008
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs')
| -rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs | 63 |
1 files changed, 11 insertions, 52 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs b/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs index 2cc9a39e..38554b70 100644 --- a/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs | |||
| @@ -252,6 +252,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 252 | var baseFolder = fs.GetFolder(); | 252 | var baseFolder = fs.GetFolder(); |
| 253 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | 253 | var intermediateFolder = Path.Combine(baseFolder, "obj"); |
| 254 | var exePath = Path.Combine(baseFolder, @"bin\test.exe"); | 254 | var exePath = Path.Combine(baseFolder, @"bin\test.exe"); |
| 255 | var pdbPath = Path.Combine(baseFolder, @"bin\test.wixpdb"); | ||
| 255 | 256 | ||
| 256 | var result = WixRunner.Execute(new[] | 257 | var result = WixRunner.Execute(new[] |
| 257 | { | 258 | { |
| @@ -266,6 +267,16 @@ namespace WixToolsetTest.CoreIntegration | |||
| 266 | result.AssertSuccess(); | 267 | result.AssertSuccess(); |
| 267 | 268 | ||
| 268 | Assert.True(File.Exists(exePath)); | 269 | Assert.True(File.Exists(exePath)); |
| 270 | Assert.True(File.Exists(pdbPath)); | ||
| 271 | |||
| 272 | using (var wixOutput = WixOutput.Read(pdbPath)) | ||
| 273 | { | ||
| 274 | var intermediate = Intermediate.Load(wixOutput); | ||
| 275 | var section = intermediate.Sections.Single(); | ||
| 276 | |||
| 277 | var payloadSymbol = section.Symbols.OfType<WixBundlePayloadSymbol>().Where(x => x.Id.Id == "NetFx462Web").Single(); | ||
| 278 | Assert.Equal(Int64.MaxValue, payloadSymbol.FileSize); | ||
| 279 | } | ||
| 269 | } | 280 | } |
| 270 | } | 281 | } |
| 271 | 282 | ||
| @@ -372,57 +383,5 @@ namespace WixToolsetTest.CoreIntegration | |||
| 372 | Assert.InRange(result.ExitCode, 2, Int32.MaxValue); | 383 | Assert.InRange(result.ExitCode, 2, Int32.MaxValue); |
| 373 | } | 384 | } |
| 374 | } | 385 | } |
| 375 | |||
| 376 | [Fact] | ||
| 377 | public void CanBuildBundleWithLargePayload() | ||
| 378 | { | ||
| 379 | var folder = TestData.Get(@"TestData\LargePayload"); | ||
| 380 | |||
| 381 | // Overwrite the payload with a 2.5 GiB file. We do this dynamically to avoid committing such | ||
| 382 | // a large file to source control. | ||
| 383 | var largeFile = Path.Combine(folder, "data", "large_file.dat"); | ||
| 384 | const long TwoAndAHalfGigabytes = 2_684_354_560; | ||
| 385 | using (var stream = File.Create(largeFile)) | ||
| 386 | { | ||
| 387 | stream.Seek(TwoAndAHalfGigabytes - 1, SeekOrigin.Begin); | ||
| 388 | stream.WriteByte(1); | ||
| 389 | } | ||
| 390 | |||
| 391 | using (var fs = new DisposableFileSystem()) | ||
| 392 | { | ||
| 393 | var baseFolder = fs.GetFolder(); | ||
| 394 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 395 | var exePath = Path.Combine(baseFolder, @"bin\test.exe"); | ||
| 396 | var pdbPath = Path.Combine(baseFolder, @"bin\test.wixpdb"); | ||
| 397 | |||
| 398 | var result = WixRunner.Execute(new[] | ||
| 399 | { | ||
| 400 | "build", | ||
| 401 | Path.Combine(folder, "Bundle.wxs"), | ||
| 402 | "-loc", Path.Combine(folder, "Bundle.en-us.wxl"), | ||
| 403 | "-bindpath", Path.Combine(folder, "data"), | ||
| 404 | "-intermediateFolder", intermediateFolder, | ||
| 405 | "-o", exePath, | ||
| 406 | }); | ||
| 407 | |||
| 408 | result.AssertSuccess(); | ||
| 409 | Assert.Empty(result.Messages.Where(m => m.Level == MessageLevel.Warning)); | ||
| 410 | |||
| 411 | Assert.True(File.Exists(exePath)); | ||
| 412 | Assert.True(File.Exists(pdbPath)); | ||
| 413 | Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\large_file.dat"))); | ||
| 414 | |||
| 415 | using (var wixOutput = WixOutput.Read(pdbPath)) | ||
| 416 | { | ||
| 417 | var intermediate = Intermediate.Load(wixOutput); | ||
| 418 | var section = intermediate.Sections.Single(); | ||
| 419 | |||
| 420 | var payloadSymbol = section.Symbols.OfType<WixBundlePayloadSymbol>().Where(x => x.Name == "large_file.dat").Single(); | ||
| 421 | Assert.Equal(TwoAndAHalfGigabytes, payloadSymbol.FileSize); | ||
| 422 | } | ||
| 423 | } | ||
| 424 | |||
| 425 | File.Delete(largeFile); | ||
| 426 | } | ||
| 427 | } | 386 | } |
| 428 | } | 387 | } |
