diff options
| author | Bob Arnson <bob@firegiant.com> | 2018-09-18 17:52:39 -0400 |
|---|---|---|
| committer | Rob Mensching <rob@robmensching.com> | 2018-09-18 15:04:08 -0700 |
| commit | cd1709996876ac1d6ff5750cd573b9be78313a9e (patch) | |
| tree | df936ce0d8e865537408a3d80ab3c6c2ce38ac60 /src/test/WixToolsetTest.CoreIntegration | |
| parent | 954b7179a06c1933ae783b602bc29caa0370aec0 (diff) | |
| download | wix-cd1709996876ac1d6ff5750cd573b9be78313a9e.tar.gz wix-cd1709996876ac1d6ff5750cd573b9be78313a9e.tar.bz2 wix-cd1709996876ac1d6ff5750cd573b9be78313a9e.zip | |
Fix ?foreach? so all loop values get "executed."
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration')
6 files changed, 75 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs b/src/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs index 1193b685..9c60c902 100644 --- a/src/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs | |||
| @@ -39,6 +39,30 @@ namespace WixToolsetTest.CoreIntegration | |||
| 39 | Assert.Single(warnings); | 39 | Assert.Single(warnings); |
| 40 | } | 40 | } |
| 41 | } | 41 | } |
| 42 | |||
| 43 | [Fact] | ||
| 44 | public void ForEachLoopsWork() | ||
| 45 | { | ||
| 46 | var folder = TestData.Get(@"TestData\ForEach"); | ||
| 47 | |||
| 48 | using (var fs = new DisposableFileSystem()) | ||
| 49 | { | ||
| 50 | var baseFolder = fs.GetFolder(); | ||
| 51 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 52 | |||
| 53 | var result = WixRunner.Execute(new[] | ||
| 54 | { | ||
| 55 | "build", | ||
| 56 | Path.Combine(folder, "Package.wxs"), | ||
| 57 | Path.Combine(folder, "PackageComponents.wxs"), | ||
| 58 | "-loc", Path.Combine(folder, "Package.en-us.wxl"), | ||
| 59 | "-bindpath", Path.Combine(folder, "data"), | ||
| 60 | "-intermediateFolder", intermediateFolder, | ||
| 61 | "-o", Path.Combine(baseFolder, @"bin\test.msi") | ||
| 62 | }, out var messages); | ||
| 63 | Assert.Equal(0, result); | ||
| 64 | } | ||
| 65 | } | ||
| 42 | } | 66 | } |
| 43 | } | 67 | } |
| 44 | 68 | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/ForEach/Package.en-us.wxl b/src/test/WixToolsetTest.CoreIntegration/TestData/ForEach/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/ForEach/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/ForEach/Package.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/ForEach/Package.wxs new file mode 100644 index 00000000..4bc7e2a4 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/ForEach/Package.wxs | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 3 | <Product Id="*" Name="MsiPackage" Language="1033" Version="1.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.x86" /> | ||
| 11 | <ComponentGroupRef Id="ProductComponents.x64" /> | ||
| 12 | <ComponentGroupRef Id="ProductComponents.arm" /> | ||
| 13 | </Feature> | ||
| 14 | </Product> | ||
| 15 | |||
| 16 | <Fragment> | ||
| 17 | <Directory Id="TARGETDIR" Name="SourceDir"> | ||
| 18 | <Directory Id="ProgramFilesFolder"> | ||
| 19 | <Directory Id="INSTALLFOLDER" Name="MsiPackage" /> | ||
| 20 | </Directory> | ||
| 21 | </Directory> | ||
| 22 | </Fragment> | ||
| 23 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/ForEach/PackageComponents.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/ForEach/PackageComponents.wxs new file mode 100644 index 00000000..2a75e3d7 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/ForEach/PackageComponents.wxs | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 3 | <?foreach ComponentPlatform in x86;x64;arm ?> | ||
| 4 | <Fragment> | ||
| 5 | <ComponentGroup Id="ProductComponents.$(var.ComponentPlatform)" Directory="INSTALLFOLDER"> | ||
| 6 | <Component> | ||
| 7 | <File Name="$(var.ComponentPlatform).dll" Source="test.txt" /> | ||
| 8 | </Component> | ||
| 9 | </ComponentGroup> | ||
| 10 | </Fragment> | ||
| 11 | <?endforeach?> | ||
| 12 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/ForEach/data/test.txt b/src/test/WixToolsetTest.CoreIntegration/TestData/ForEach/data/test.txt new file mode 100644 index 00000000..cd0db0e1 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/ForEach/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 f52d368b..7c4578d9 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj +++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj | |||
| @@ -24,6 +24,10 @@ | |||
| 24 | <Content Include="TestData\ExampleExtension\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | 24 | <Content Include="TestData\ExampleExtension\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> |
| 25 | <Content Include="TestData\ExampleExtension\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | 25 | <Content Include="TestData\ExampleExtension\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| 26 | <Content Include="TestData\ExampleExtension\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | 26 | <Content Include="TestData\ExampleExtension\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| 27 | <Content Include="TestData\ForEach\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> | ||
| 28 | <Content Include="TestData\ForEach\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | ||
| 29 | <Content Include="TestData\ForEach\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
| 30 | <Content Include="TestData\ForEach\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
| 27 | <Content Include="TestData\SingleFile\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> | 31 | <Content Include="TestData\SingleFile\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> |
| 28 | <Content Include="TestData\SingleFile\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | 32 | <Content Include="TestData\SingleFile\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> |
| 29 | <Content Include="TestData\SingleFile\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | 33 | <Content Include="TestData\SingleFile\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> |
