diff options
Diffstat (limited to 'src/test')
7 files changed, 92 insertions, 0 deletions
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 | |||
278 | } | 278 | } |
279 | } | 279 | } |
280 | 280 | ||
281 | [Fact] | ||
282 | public void CanBuildWithIncludePath() | ||
283 | { | ||
284 | var folder = TestData.Get(@"TestData\IncludePath"); | ||
285 | var bindpath = Path.Combine(folder, "data"); | ||
286 | |||
287 | using (var fs = new DisposableFileSystem()) | ||
288 | { | ||
289 | var baseFolder = fs.GetFolder(); | ||
290 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
291 | |||
292 | var program = new Program(); | ||
293 | var result = program.Run(new WixToolsetServiceProvider(), null, new[] | ||
294 | { | ||
295 | "build", | ||
296 | Path.Combine(folder, "Package.wxs"), | ||
297 | Path.Combine(folder, "PackageComponents.wxs"), | ||
298 | "-loc", Path.Combine(folder, "Package.en-us.wxl"), | ||
299 | "-bindpath", bindpath, | ||
300 | "-intermediateFolder", intermediateFolder, | ||
301 | "-o", Path.Combine(baseFolder, @"bin\test.msi"), | ||
302 | "-i", bindpath, | ||
303 | }); | ||
304 | |||
305 | Assert.Equal(0, result); | ||
306 | |||
307 | Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.msi"))); | ||
308 | Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.wixpdb"))); | ||
309 | Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\MsiPackage\test.txt"))); | ||
310 | |||
311 | var intermediate = Intermediate.Load(Path.Combine(baseFolder, @"bin\test.wir")); | ||
312 | var section = intermediate.Sections.Single(); | ||
313 | |||
314 | var wixFile = section.Tuples.OfType<WixFileTuple>().Single(); | ||
315 | Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path); | ||
316 | Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path); | ||
317 | } | ||
318 | } | ||
319 | |||
281 | [Fact(Skip = "Not implemented yet.")] | 320 | [Fact(Skip = "Not implemented yet.")] |
282 | public void CanBuildInstanceTransform() | 321 | public void CanBuildInstanceTransform() |
283 | { | 322 | { |
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 @@ | |||
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/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 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <?include Package.wxi ?> | ||
3 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
4 | <Product Id="*" Name="MsiPackage" Language="1033" Version="$(var.ProductVersion)" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a"> | ||
5 | <Package InstallerVersion="200" Compressed="no" InstallScope="perMachine" /> | ||
6 | |||
7 | <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" /> | ||
8 | <MediaTemplate /> | ||
9 | |||
10 | <Feature Id="ProductFeature" Title="!(loc.FeatureTitle)"> | ||
11 | <ComponentGroupRef Id="ProductComponents" /> | ||
12 | </Feature> | ||
13 | </Product> | ||
14 | |||
15 | <Fragment> | ||
16 | <Directory Id="TARGETDIR" Name="SourceDir"> | ||
17 | <Directory Id="ProgramFilesFolder"> | ||
18 | <Directory Id="INSTALLFOLDER" Name="MsiPackage" /> | ||
19 | </Directory> | ||
20 | </Directory> | ||
21 | </Fragment> | ||
22 | </Wix> | ||
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 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
3 | <Fragment> | ||
4 | <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> | ||
5 | <Component> | ||
6 | <File Source="test.txt" /> | ||
7 | </Component> | ||
8 | </ComponentGroup> | ||
9 | </Fragment> | ||
10 | </Wix> | ||
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 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <Include xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
3 | <?define ProductVersion = "1.2.3" ?> | ||
4 | </Include> | ||
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 @@ | |||
27 | <Content Include="TestData\SingleFile\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | 27 | <Content Include="TestData\SingleFile\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> |
28 | <Content Include="TestData\SingleFile\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | 28 | <Content Include="TestData\SingleFile\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> |
29 | <Content Include="TestData\SingleFile\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | 29 | <Content Include="TestData\SingleFile\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> |
30 | <Content Include="TestData\IncludePath\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> | ||
31 | <Content Include="TestData\IncludePath\data\Package.wxi" CopyToOutputDirectory="PreserveNewest" /> | ||
32 | <Content Include="TestData\IncludePath\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | ||
33 | <Content Include="TestData\IncludePath\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
34 | <Content Include="TestData\IncludePath\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
30 | <Content Include="TestData\SingleFileCompressed\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> | 35 | <Content Include="TestData\SingleFileCompressed\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> |
31 | <Content Include="TestData\SingleFileCompressed\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | 36 | <Content Include="TestData\SingleFileCompressed\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> |
32 | <Content Include="TestData\SingleFileCompressed\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | 37 | <Content Include="TestData\SingleFileCompressed\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> |