diff options
author | Bob Arnson <bob@firegiant.com> | 2020-05-11 17:09:47 -0400 |
---|---|---|
committer | Bob Arnson <bob@firegiant.com> | 2020-05-11 17:17:45 -0400 |
commit | bac3d761d99fb7ae1012f3591baee2dbec115b28 (patch) | |
tree | 852f30be8ba4b0bc4a2cbd3dfd703149f4d00d3d /src/test | |
parent | 93d3a9e1f9cdc05456a612e238a83738cfd1750f (diff) | |
download | wix-bac3d761d99fb7ae1012f3591baee2dbec115b28.tar.gz wix-bac3d761d99fb7ae1012f3591baee2dbec115b28.tar.bz2 wix-bac3d761d99fb7ae1012f3591baee2dbec115b28.zip |
Fix named bind paths.
Diffstat (limited to 'src/test')
9 files changed, 105 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/WixlibWithBinaries/Package.en-us.wxl b/src/test/WixToolsetTest.CoreIntegration/TestData/WixlibWithBinaries/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/WixlibWithBinaries/Package.en-us.wxl | |||
@@ -0,0 +1,11 @@ | |||
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="DowngradeError">A newer version of [ProductName] is already installed.</String> | ||
9 | <String Id="FeatureTitle">MsiPackage</String> | ||
10 | |||
11 | </WixLocalization> | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/WixlibWithBinaries/Package.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/WixlibWithBinaries/Package.wxs new file mode 100644 index 00000000..85dcb695 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/WixlibWithBinaries/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/WixlibWithBinaries/PackageComponents.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/WixlibWithBinaries/PackageComponents.wxs new file mode 100644 index 00000000..7d1a4ae1 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/WixlibWithBinaries/PackageComponents.wxs | |||
@@ -0,0 +1,26 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
3 | <Fragment> | ||
4 | <Binary Id="FooAlpha" SourceFile="!(bindpath.AlphaBits)foo.dll" /> | ||
5 | </Fragment> | ||
6 | |||
7 | <Fragment> | ||
8 | <Binary Id="FooMips" SourceFile="!(bindpath.MipsBits)foo.dll" /> | ||
9 | </Fragment> | ||
10 | |||
11 | <Fragment> | ||
12 | <Binary Id="FooPowerPC" SourceFile="!(bindpath.PowerBits)foo.dll" /> | ||
13 | </Fragment> | ||
14 | |||
15 | <Fragment> | ||
16 | <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> | ||
17 | <Component> | ||
18 | <File Source="test.txt" /> | ||
19 | </Component> | ||
20 | |||
21 | <Component Id="Shared.dll" Shared="yes"> | ||
22 | <File Name="Shared.dll" Source="test.txt" /> | ||
23 | </Component> | ||
24 | </ComponentGroup> | ||
25 | </Fragment> | ||
26 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/WixlibWithBinaries/data/alpha/foo.dll b/src/test/WixToolsetTest.CoreIntegration/TestData/WixlibWithBinaries/data/alpha/foo.dll new file mode 100644 index 00000000..cd0db0e1 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/WixlibWithBinaries/data/alpha/foo.dll | |||
@@ -0,0 +1 @@ | |||
This is test.txt. \ No newline at end of file | |||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/WixlibWithBinaries/data/mips/foo.dll b/src/test/WixToolsetTest.CoreIntegration/TestData/WixlibWithBinaries/data/mips/foo.dll new file mode 100644 index 00000000..cd0db0e1 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/WixlibWithBinaries/data/mips/foo.dll | |||
@@ -0,0 +1 @@ | |||
This is test.txt. \ No newline at end of file | |||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/WixlibWithBinaries/data/powerpc/foo.dll b/src/test/WixToolsetTest.CoreIntegration/TestData/WixlibWithBinaries/data/powerpc/foo.dll new file mode 100644 index 00000000..cd0db0e1 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/WixlibWithBinaries/data/powerpc/foo.dll | |||
@@ -0,0 +1 @@ | |||
This is test.txt. \ No newline at end of file | |||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/WixlibWithBinaries/data/test.txt b/src/test/WixToolsetTest.CoreIntegration/TestData/WixlibWithBinaries/data/test.txt new file mode 100644 index 00000000..cd0db0e1 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/WixlibWithBinaries/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 60cbde85..3989699d 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj +++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj | |||
@@ -172,6 +172,13 @@ | |||
172 | <Content Include="TestData\Components\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | 172 | <Content Include="TestData\Components\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> |
173 | <Content Include="TestData\Components\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | 173 | <Content Include="TestData\Components\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> |
174 | <Content Include="TestData\Components\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | 174 | <Content Include="TestData\Components\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> |
175 | <Content Include="TestData\WixlibWithBinaries\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> | ||
176 | <Content Include="TestData\WixlibWithBinaries\data\alpha\foo.dll" CopyToOutputDirectory="PreserveNewest" /> | ||
177 | <Content Include="TestData\WixlibWithBinaries\data\mips\foo.dll" CopyToOutputDirectory="PreserveNewest" /> | ||
178 | <Content Include="TestData\WixlibWithBinaries\data\powerpc\foo.dll" CopyToOutputDirectory="PreserveNewest" /> | ||
179 | <Content Include="TestData\WixlibWithBinaries\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | ||
180 | <Content Include="TestData\WixlibWithBinaries\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
181 | <Content Include="TestData\WixlibWithBinaries\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
175 | </ItemGroup> | 182 | </ItemGroup> |
176 | 183 | ||
177 | <ItemGroup> | 184 | <ItemGroup> |
diff --git a/src/test/WixToolsetTest.CoreIntegration/WixlibFixture.cs b/src/test/WixToolsetTest.CoreIntegration/WixlibFixture.cs index f63d1144..63771248 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixlibFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/WixlibFixture.cs | |||
@@ -53,6 +53,42 @@ namespace WixToolsetTest.CoreIntegration | |||
53 | } | 53 | } |
54 | 54 | ||
55 | [Fact] | 55 | [Fact] |
56 | public void CanBuildWixlibWithBinariesFromNamedBindPaths() | ||
57 | { | ||
58 | var folder = TestData.Get(@"TestData\WixlibWithBinaries"); | ||
59 | |||
60 | using (var fs = new DisposableFileSystem()) | ||
61 | { | ||
62 | var baseFolder = fs.GetFolder(); | ||
63 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
64 | var wixlibPath = Path.Combine(intermediateFolder, @"test.wixlib"); | ||
65 | |||
66 | var result = WixRunner.Execute(new[] | ||
67 | { | ||
68 | "build", | ||
69 | Path.Combine(folder, "PackageComponents.wxs"), | ||
70 | "-bf", | ||
71 | "-bindpath", Path.Combine(folder, "data"), | ||
72 | // Use names that aren't excluded in default .gitignores. | ||
73 | "-bindpath", $"AlphaBits={Path.Combine(folder, "data", "alpha")}", | ||
74 | "-bindpath", $"MipsBits={Path.Combine(folder, "data", "mips")}", | ||
75 | "-bindpath", $"PowerBits={Path.Combine(folder, "data", "powerpc")}", | ||
76 | "-intermediateFolder", intermediateFolder, | ||
77 | "-o", wixlibPath, | ||
78 | }); | ||
79 | |||
80 | result.AssertSuccess(); | ||
81 | |||
82 | var wixlib = Intermediate.Load(wixlibPath); | ||
83 | var binaryTuples = wixlib.Sections.SelectMany(s => s.Tuples).OfType<BinaryTuple>().ToList(); | ||
84 | Assert.Equal(3, binaryTuples.Count); | ||
85 | Assert.Single(binaryTuples.Where(t => t.Data.Path == "wix-ir/foo.dll")); | ||
86 | Assert.Single(binaryTuples.Where(t => t.Data.Path == "wix-ir/foo.dll-1")); | ||
87 | Assert.Single(binaryTuples.Where(t => t.Data.Path == "wix-ir/foo.dll-2")); | ||
88 | } | ||
89 | } | ||
90 | |||
91 | [Fact] | ||
56 | public void CanBuildSingleFileUsingWixlib() | 92 | public void CanBuildSingleFileUsingWixlib() |
57 | { | 93 | { |
58 | var folder = TestData.Get(@"TestData\SingleFile"); | 94 | var folder = TestData.Get(@"TestData\SingleFile"); |