From 59004832767115df136c553169e992577e5981d6 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Fri, 29 Dec 2017 15:12:24 -0500 Subject: Pass along include search paths to those that need it. --- .../ProgramFixture.cs | 39 ++++++++++++++++++++++ .../TestData/IncludePath/Package.en-us.wxl | 11 ++++++ .../TestData/IncludePath/Package.wxs | 22 ++++++++++++ .../TestData/IncludePath/PackageComponents.wxs | 10 ++++++ .../TestData/IncludePath/data/Package.wxi | 4 +++ .../TestData/IncludePath/data/test.txt | 1 + .../WixToolsetTest.CoreIntegration.csproj | 5 +++ 7 files changed, 92 insertions(+) create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/Package.en-us.wxl create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/Package.wxs create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/PackageComponents.wxs create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/data/Package.wxi create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/data/test.txt (limited to 'src/test/WixToolsetTest.CoreIntegration') diff --git a/src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs b/src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs index 7e54174d..a171981a 100644 --- a/src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs @@ -278,6 +278,45 @@ namespace WixToolsetTest.CoreIntegration } } + [Fact] + public void CanBuildWithIncludePath() + { + var folder = TestData.Get(@"TestData\IncludePath"); + var bindpath = Path.Combine(folder, "data"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var intermediateFolder = Path.Combine(baseFolder, "obj"); + + var program = new Program(); + var result = program.Run(new WixToolsetServiceProvider(), null, new[] + { + "build", + Path.Combine(folder, "Package.wxs"), + Path.Combine(folder, "PackageComponents.wxs"), + "-loc", Path.Combine(folder, "Package.en-us.wxl"), + "-bindpath", bindpath, + "-intermediateFolder", intermediateFolder, + "-o", Path.Combine(baseFolder, @"bin\test.msi"), + "-i", bindpath, + }); + + Assert.Equal(0, result); + + Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.msi"))); + Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.wixpdb"))); + Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\MsiPackage\test.txt"))); + + var intermediate = Intermediate.Load(Path.Combine(baseFolder, @"bin\test.wir")); + var section = intermediate.Sections.Single(); + + var wixFile = section.Tuples.OfType().Single(); + Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path); + Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path); + } + } + [Fact(Skip = "Not implemented yet.")] public void CanBuildInstanceTransform() { diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/Package.en-us.wxl b/src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/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/IncludePath/Package.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/Package.wxs new file mode 100644 index 00000000..8deab961 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/Package.wxs @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/PackageComponents.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/PackageComponents.wxs new file mode 100644 index 00000000..e26c4509 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/PackageComponents.wxs @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/data/Package.wxi b/src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/data/Package.wxi new file mode 100644 index 00000000..f2df3b86 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/data/Package.wxi @@ -0,0 +1,4 @@ + + + + diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/data/test.txt b/src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/data/test.txt new file mode 100644 index 00000000..cd0db0e1 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/IncludePath/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 d406a0da..d1901b38 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj +++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj @@ -27,6 +27,11 @@ + + + + + -- cgit v1.2.3-55-g6feb