Add CanBuildSingleFileCompressed test (failing variety).
Bob Arnson committed
Dec 4, 2017 at 18:33 UTC
e53afb01c6e01bb9e6521fa77d31e575abc73f9c
6 files changed
+84
src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs
+36
@@ -48,6 +48,42 @@ namespace WixToolsetTest.CoreIntegration
48
}
49
}
50
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]
88
public void CanBuildSimpleModule()
89
{
src/test/WixToolsetTest.CoreIntegration/TestData/SingleFileCompressed/Package.en-us.wxl
new
+11
@@ -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>
src/test/WixToolsetTest.CoreIntegration/TestData/SingleFileCompressed/Package.wxs
new
+22
@@ -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>
src/test/WixToolsetTest.CoreIntegration/TestData/SingleFileCompressed/PackageComponents.wxs
new
+10
@@ -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>
src/test/WixToolsetTest.CoreIntegration/TestData/SingleFileCompressed/data/test.txt
new
+1
@@ -0,0 +1 @@
1
+This is test.txt.
\ No newline at end of file
src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj
+4
@@ -23,6 +23,10 @@
23
<Content Include="TestData\SingleFile\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" />
24
<Content Include="TestData\SingleFile\Package.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" />
30
</ItemGroup>
31
32
<ItemGroup>