From cd1709996876ac1d6ff5750cd573b9be78313a9e Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Tue, 18 Sep 2018 17:52:39 -0400 Subject: Fix ?foreach? so all loop values get "executed." --- .../PreprocessorFixture.cs | 24 ++++++++++++++++++++++ .../TestData/ForEach/Package.en-us.wxl | 11 ++++++++++ .../TestData/ForEach/Package.wxs | 23 +++++++++++++++++++++ .../TestData/ForEach/PackageComponents.wxs | 12 +++++++++++ .../TestData/ForEach/data/test.txt | 1 + .../WixToolsetTest.CoreIntegration.csproj | 4 ++++ 6 files changed, 75 insertions(+) create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/ForEach/Package.en-us.wxl create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/ForEach/Package.wxs create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/ForEach/PackageComponents.wxs create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/ForEach/data/test.txt (limited to 'src/test/WixToolsetTest.CoreIntegration') 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 Assert.Single(warnings); } } + + [Fact] + public void ForEachLoopsWork() + { + var folder = TestData.Get(@"TestData\ForEach"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var intermediateFolder = Path.Combine(baseFolder, "obj"); + + var result = WixRunner.Execute(new[] + { + "build", + Path.Combine(folder, "Package.wxs"), + Path.Combine(folder, "PackageComponents.wxs"), + "-loc", Path.Combine(folder, "Package.en-us.wxl"), + "-bindpath", Path.Combine(folder, "data"), + "-intermediateFolder", intermediateFolder, + "-o", Path.Combine(baseFolder, @"bin\test.msi") + }, out var messages); + Assert.Equal(0, result); + } + } } } 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 @@ + + + + + + A newer version of [ProductName] is already installed. + MsiPackage + + 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 @@ + + + + + + + + + + + + + + + + + + + + + + + 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 @@ + + + + + + + + + + + + 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 @@ + + + + -- cgit v1.2.3-55-g6feb