diff options
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration')
9 files changed, 83 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs b/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs new file mode 100644 index 00000000..554f4b17 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
| 2 | |||
| 3 | namespace WixToolsetTest.CoreIntegration | ||
| 4 | { | ||
| 5 | using System.IO; | ||
| 6 | using System.Linq; | ||
| 7 | using WixBuildTools.TestSupport; | ||
| 8 | using WixToolset.Core.TestPackage; | ||
| 9 | using WixToolset.Data; | ||
| 10 | using WixToolset.Data.Tuples; | ||
| 11 | using Xunit; | ||
| 12 | |||
| 13 | public class BundleFixture | ||
| 14 | { | ||
| 15 | [Fact] | ||
| 16 | public void CanBuildSimpleBundle() | ||
| 17 | { | ||
| 18 | var burnStubPath = TestData.Get(@"TestData\.Data\burn.exe"); | ||
| 19 | var folder = TestData.Get(@"TestData\SimpleBundle"); | ||
| 20 | |||
| 21 | using (var fs = new DisposableFileSystem()) | ||
| 22 | { | ||
| 23 | var baseFolder = fs.GetFolder(); | ||
| 24 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 25 | |||
| 26 | var result = WixRunner.Execute(new[] | ||
| 27 | { | ||
| 28 | "build", | ||
| 29 | Path.Combine(folder, "Bundle.wxs"), | ||
| 30 | "-loc", Path.Combine(folder, "Bundle.en-us.wxl"), | ||
| 31 | "-bindpath", Path.Combine(folder, "data"), | ||
| 32 | "-intermediateFolder", intermediateFolder, | ||
| 33 | "-burnStub", burnStubPath, | ||
| 34 | "-o", Path.Combine(baseFolder, @"bin\test.exe") | ||
| 35 | }); | ||
| 36 | |||
| 37 | result.AssertSuccess(); | ||
| 38 | |||
| 39 | Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.exe"))); | ||
| 40 | #if TODO | ||
| 41 | Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.wixpdb"))); | ||
| 42 | #endif | ||
| 43 | |||
| 44 | var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"test.wir")); | ||
| 45 | var section = intermediate.Sections.Single(); | ||
| 46 | |||
| 47 | var msiTuple = section.Tuples.OfType<WixBundlePackageTuple>().Single(); | ||
| 48 | Assert.Equal("test.msi", msiTuple.Id.Id ); | ||
| 49 | } | ||
| 50 | } | ||
| 51 | } | ||
| 52 | } | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/.Data/burn.exe b/src/test/WixToolsetTest.CoreIntegration/TestData/.Data/burn.exe new file mode 100644 index 00000000..2a4f423f --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/.Data/burn.exe | |||
| Binary files differ | |||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleBundle/Bundle.en-us.wxl b/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleBundle/Bundle.en-us.wxl new file mode 100644 index 00000000..bc1dee83 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleBundle/Bundle.en-us.wxl | |||
| @@ -0,0 +1,10 @@ | |||
| 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 | |||
| 8 | <String Id="BundleName">~TestBundle</String> | ||
| 9 | |||
| 10 | </WixLocalization> | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleBundle/Bundle.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleBundle/Bundle.wxs new file mode 100644 index 00000000..89dbb503 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleBundle/Bundle.wxs | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 3 | <Bundle Name="!(loc.BundleName)" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a"> | ||
| 4 | <BootstrapperApplication SourceFile="fakeba.dll" /> | ||
| 5 | <Chain> | ||
| 6 | <MsiPackage SourceFile="test.msi"> | ||
| 7 | <MsiProperty Name="TEST" Value="1" /> | ||
| 8 | </MsiPackage> | ||
| 9 | </Chain> | ||
| 10 | </Bundle> | ||
| 11 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleBundle/data/MsiPackage/Shared.dll b/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleBundle/data/MsiPackage/Shared.dll new file mode 100644 index 00000000..0e461ba8 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleBundle/data/MsiPackage/Shared.dll | |||
| @@ -0,0 +1 @@ | |||
| This is Shared.dll. \ No newline at end of file | |||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleBundle/data/MsiPackage/test.txt b/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleBundle/data/MsiPackage/test.txt new file mode 100644 index 00000000..8b986220 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleBundle/data/MsiPackage/test.txt | |||
| @@ -0,0 +1 @@ | |||
| This is test.txt \ No newline at end of file | |||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleBundle/data/fakeba.dll b/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleBundle/data/fakeba.dll new file mode 100644 index 00000000..970efdf0 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleBundle/data/fakeba.dll | |||
| @@ -0,0 +1 @@ | |||
| This is a fakeba.dll \ No newline at end of file | |||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleBundle/data/test.msi b/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleBundle/data/test.msi new file mode 100644 index 00000000..0722d60e --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleBundle/data/test.msi | |||
| Binary files differ | |||
diff --git a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj index a5eadae3..65034159 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj +++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | </PropertyGroup> | 13 | </PropertyGroup> |
| 14 | 14 | ||
| 15 | <ItemGroup> | 15 | <ItemGroup> |
| 16 | <Content Include="TestData\.Data\burn.exe" CopyToOutputDirectory="PreserveNewest" /> | ||
| 16 | <Content Include="TestData\AppSearch\ComponentSearch.wxs" CopyToOutputDirectory="PreserveNewest" /> | 17 | <Content Include="TestData\AppSearch\ComponentSearch.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| 17 | <Content Include="TestData\AppSearch\DirectorySearch.wxs" CopyToOutputDirectory="PreserveNewest" /> | 18 | <Content Include="TestData\AppSearch\DirectorySearch.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| 18 | <Content Include="TestData\AppSearch\FileSearch.wxs" CopyToOutputDirectory="PreserveNewest" /> | 19 | <Content Include="TestData\AppSearch\FileSearch.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| @@ -31,6 +32,9 @@ | |||
| 31 | <Content Include="TestData\ReserveCost\ReserveCost.wxs" CopyToOutputDirectory="PreserveNewest" /> | 32 | <Content Include="TestData\ReserveCost\ReserveCost.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| 32 | <Content Include="TestData\ServiceInstall\OwnProcess.wxs" CopyToOutputDirectory="PreserveNewest" /> | 33 | <Content Include="TestData\ServiceInstall\OwnProcess.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| 33 | <Content Include="TestData\Shortcut\ShortcutProperty.wxs" CopyToOutputDirectory="PreserveNewest" /> | 34 | <Content Include="TestData\Shortcut\ShortcutProperty.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| 35 | <Content Include="TestData\SimpleBundle\data\fakeba.dll" CopyToOutputDirectory="PreserveNewest" /> | ||
| 36 | <Content Include="TestData\SimpleBundle\data\MsiPackage\Shared.dll" CopyToOutputDirectory="PreserveNewest" /> | ||
| 37 | <Content Include="TestData\SimpleBundle\data\MsiPackage\test.txt" CopyToOutputDirectory="PreserveNewest" /> | ||
| 34 | <Content Include="TestData\SimpleModule\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> | 38 | <Content Include="TestData\SimpleModule\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> |
| 35 | <Content Include="TestData\SimpleModule\Module.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | 39 | <Content Include="TestData\SimpleModule\Module.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> |
| 36 | <Content Include="TestData\SimpleModule\Module.wxs" CopyToOutputDirectory="PreserveNewest" /> | 40 | <Content Include="TestData\SimpleModule\Module.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| @@ -66,6 +70,9 @@ | |||
| 66 | <Content Include="TestData\SetProperty\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | 70 | <Content Include="TestData\SetProperty\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> |
| 67 | <Content Include="TestData\SetProperty\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | 71 | <Content Include="TestData\SetProperty\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| 68 | <Content Include="TestData\SetProperty\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | 72 | <Content Include="TestData\SetProperty\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| 73 | <Content Include="TestData\SimpleBundle\data\test.msi" CopyToOutputDirectory="PreserveNewest" /> | ||
| 74 | <Content Include="TestData\SimpleBundle\Bundle.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | ||
| 75 | <Content Include="TestData\SimpleBundle\Bundle.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
| 69 | <Content Include="TestData\SingleFile\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> | 76 | <Content Include="TestData\SingleFile\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> |
| 70 | <Content Include="TestData\SingleFile\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | 77 | <Content Include="TestData\SingleFile\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> |
| 71 | <Content Include="TestData\SingleFile\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | 78 | <Content Include="TestData\SingleFile\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> |
