aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBob Arnson <bob@joyofsetup.com>2017-12-04 18:33:11 -0500
committerBob Arnson <bob@joyofsetup.com>2017-12-04 18:33:11 -0500
commite53afb01c6e01bb9e6521fa77d31e575abc73f9c (patch)
treec26b5b22e1cfee21cb29e904f231b95dcf0dd45c /src
parent95f2f4425b900374c7d7b583ae810b096121b3c4 (diff)
downloadwix-e53afb01c6e01bb9e6521fa77d31e575abc73f9c.tar.gz
wix-e53afb01c6e01bb9e6521fa77d31e575abc73f9c.tar.bz2
wix-e53afb01c6e01bb9e6521fa77d31e575abc73f9c.zip
Add CanBuildSingleFileCompressed test (failing variety).
Diffstat (limited to 'src')
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs36
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/TestData/SingleFileCompressed/Package.en-us.wxl11
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/TestData/SingleFileCompressed/Package.wxs22
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/TestData/SingleFileCompressed/PackageComponents.wxs10
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/TestData/SingleFileCompressed/data/test.txt1
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj4
6 files changed, 84 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs b/src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs
index e9e5c62f..6644fd33 100644
--- a/src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs
+++ b/src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs
@@ -49,6 +49,42 @@ namespace WixToolsetTest.CoreIntegration
49 } 49 }
50 50
51 [Fact] 51 [Fact]
52 public void CanBuildSingleFileCompressed()
53 {
54 var folder = TestData.Get(@"TestData\SingleFileCompressed");
55
56 using (var fs = new DisposableFileSystem())
57 {
58 var intermediateFolder = fs.GetFolder();
59
60 var program = new Program();
61 var result = program.Run(new WixToolsetServiceProvider(), new[]
62 {
63 "build",
64 Path.Combine(folder, "Package.wxs"),
65 Path.Combine(folder, "PackageComponents.wxs"),
66 "-loc", Path.Combine(folder, "Package.en-us.wxl"),
67 "-bindpath", Path.Combine(folder, "data"),
68 "-intermediateFolder", intermediateFolder,
69 "-o", Path.Combine(intermediateFolder, @"bin\test.msi")
70 });
71
72 Assert.Equal(0, result);
73
74 Assert.True(File.Exists(Path.Combine(intermediateFolder, @"bin\test.msi")));
75 Assert.True(File.Exists(Path.Combine(intermediateFolder, @"bin\test.wixpdb")));
76 Assert.True(File.Exists(Path.Combine(intermediateFolder, @"bin\MsiPackage\test.txt")));
77
78 var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"bin\test.wir"));
79 Assert.Single(intermediate.Sections);
80
81 var wixFile = intermediate.Sections.SelectMany(s => s.Tuples).OfType<WixFileTuple>().Single();
82 Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path);
83 Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path);
84 }
85 }
86
87 [Fact]
52 public void CanBuildSimpleModule() 88 public void CanBuildSimpleModule()
53 { 89 {
54 var folder = TestData.Get(@"TestData\SimpleModule"); 90 var folder = TestData.Get(@"TestData\SimpleModule");
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/SingleFileCompressed/Package.en-us.wxl b/src/test/WixToolsetTest.CoreIntegration/TestData/SingleFileCompressed/Package.en-us.wxl
new file mode 100644
index 00000000..38c12ac1
--- /dev/null
+++ b/src/test/WixToolsetTest.CoreIntegration/TestData/SingleFileCompressed/Package.en-us.wxl
@@ -0,0 +1,11 @@
1<?xml version="1.0" encoding="utf-8"?>
2
3<!--
4This 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/SingleFileCompressed/Package.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/SingleFileCompressed/Package.wxs
new file mode 100644
index 00000000..3f47d01d
--- /dev/null
+++ b/src/test/WixToolsetTest.CoreIntegration/TestData/SingleFileCompressed/Package.wxs
@@ -0,0 +1,22 @@
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.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a">
4 <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
5
6 <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" />
7 <!--<MediaTemplate />-->
8 <Media Id="1" />
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/SingleFileCompressed/PackageComponents.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/SingleFileCompressed/PackageComponents.wxs
new file mode 100644
index 00000000..e26c4509
--- /dev/null
+++ b/src/test/WixToolsetTest.CoreIntegration/TestData/SingleFileCompressed/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/SingleFileCompressed/data/test.txt b/src/test/WixToolsetTest.CoreIntegration/TestData/SingleFileCompressed/data/test.txt
new file mode 100644
index 00000000..cd0db0e1
--- /dev/null
+++ b/src/test/WixToolsetTest.CoreIntegration/TestData/SingleFileCompressed/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 ede5967f..ed0d5f5e 100644
--- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj
+++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj
@@ -23,6 +23,10 @@
23 <Content Include="TestData\SingleFile\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> 23 <Content Include="TestData\SingleFile\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" />
24 <Content Include="TestData\SingleFile\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> 24 <Content Include="TestData\SingleFile\Package.wxs" CopyToOutputDirectory="PreserveNewest" />
25 <Content Include="TestData\SingleFile\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> 25 <Content Include="TestData\SingleFile\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" />
26 <Content Include="TestData\SingleFileCompressed\data\test.txt" CopyToOutputDirectory="PreserveNewest" />
27 <Content Include="TestData\SingleFileCompressed\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" />
28 <Content Include="TestData\SingleFileCompressed\Package.wxs" CopyToOutputDirectory="PreserveNewest" />
29 <Content Include="TestData\SingleFileCompressed\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" />
26 </ItemGroup> 30 </ItemGroup>
27 31
28 <ItemGroup> 32 <ItemGroup>