diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2019-09-27 17:30:18 +1000 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2019-09-30 13:14:35 +1000 |
commit | 2091dd91f20e37e4a1c93aab04386c89d55a37c9 (patch) | |
tree | a49041d23ae776632d7358b1e7e8db67e95ad991 /src/test | |
parent | a44207c9296c3d5d18f07455f919781b88424c54 (diff) | |
download | wix-2091dd91f20e37e4a1c93aab04386c89d55a37c9.tar.gz wix-2091dd91f20e37e4a1c93aab04386c89d55a37c9.tar.bz2 wix-2091dd91f20e37e4a1c93aab04386c89d55a37c9.zip |
Add failing tests for Upgrade.
Diffstat (limited to 'src/test')
3 files changed, 80 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs index 4fb136d5..edaf25cb 100644 --- a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs | |||
@@ -85,5 +85,72 @@ namespace WixToolsetTest.CoreIntegration | |||
85 | }, results); | 85 | }, results); |
86 | } | 86 | } |
87 | } | 87 | } |
88 | |||
89 | [Fact(Skip = "Test demonstrates failure")] | ||
90 | public void PopulatesUpgradeTableFromManualUpgrade() | ||
91 | { | ||
92 | var folder = TestData.Get(@"TestData\ManualUpgrade"); | ||
93 | |||
94 | using (var fs = new DisposableFileSystem()) | ||
95 | { | ||
96 | var intermediateFolder = fs.GetFolder(); | ||
97 | var msiPath = Path.Combine(intermediateFolder, @"bin\test.msi"); | ||
98 | |||
99 | var result = WixRunner.Execute(new[] | ||
100 | { | ||
101 | "build", | ||
102 | Path.Combine(folder, "Package.wxs"), | ||
103 | Path.Combine(folder, "PackageComponents.wxs"), | ||
104 | "-loc", Path.Combine(folder, "Package.en-us.wxl"), | ||
105 | "-bindpath", Path.Combine(folder, "data"), | ||
106 | "-intermediateFolder", intermediateFolder, | ||
107 | "-o", msiPath | ||
108 | }, out var messages); | ||
109 | |||
110 | Assert.Equal(0, result); | ||
111 | |||
112 | Assert.True(File.Exists(msiPath)); | ||
113 | var results = Query.QueryDatabase(msiPath, new[] { "Upgrade" }); | ||
114 | Assert.Equal(new[] | ||
115 | { | ||
116 | "Upgrade:{01120000-00E0-0000-0000-0000000FF1CE}\t12.0.0\t13.0.0\t\t260\t\tBLAHBLAHBLAH", | ||
117 | }, results); | ||
118 | } | ||
119 | } | ||
120 | |||
121 | [Fact(Skip = "Test demonstrates failure")] | ||
122 | public void PopulatesUpgradeTableFromDetectOnlyUpgrade() | ||
123 | { | ||
124 | var folder = TestData.Get(@"TestData"); | ||
125 | |||
126 | using (var fs = new DisposableFileSystem()) | ||
127 | { | ||
128 | var baseFolder = fs.GetFolder(); | ||
129 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
130 | var msiPath = Path.Combine(baseFolder, @"bin\test.msi"); | ||
131 | |||
132 | var result = WixRunner.Execute(new[] | ||
133 | { | ||
134 | "build", | ||
135 | Path.Combine(folder, "Upgrade", "DetectOnly.wxs"), | ||
136 | Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"), | ||
137 | Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), | ||
138 | "-bindpath", Path.Combine(folder, "SingleFile", "data"), | ||
139 | "-intermediateFolder", intermediateFolder, | ||
140 | "-o", msiPath | ||
141 | }); | ||
142 | |||
143 | result.AssertSuccess(); | ||
144 | |||
145 | Assert.True(File.Exists(msiPath)); | ||
146 | var results = Query.QueryDatabase(msiPath, new[] { "Upgrade" }); | ||
147 | Assert.Equal(new[] | ||
148 | { | ||
149 | "Upgrade:{12E4699F-E774-4D05-8A01-5BDD41BBA127}\t\t1.0.0.0\t1033\t1\t\tWIX_UPGRADE_DETECTED", | ||
150 | "Upgrade:{12E4699F-E774-4D05-8A01-5BDD41BBA127}\t1.0.0.0\t1033\t\t2\t\tWIX_DOWNGRADE_DETECTED", | ||
151 | "Upgrade:{B05772EA-82B8-4DE0-B7EB-45B5F0CCFE6D}\t1.0.0\t\t\t256\t\tRELPRODFOUND", | ||
152 | }, results); | ||
153 | } | ||
154 | } | ||
88 | } | 155 | } |
89 | } | 156 | } |
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/Upgrade/DetectOnly.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/Upgrade/DetectOnly.wxs new file mode 100644 index 00000000..587d8e95 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/Upgrade/DetectOnly.wxs | |||
@@ -0,0 +1,12 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
3 | <Fragment> | ||
4 | <ComponentGroup Id="ProductComponents"> | ||
5 | <ComponentGroupRef Id="MinimalComponentGroup"></ComponentGroupRef> | ||
6 | </ComponentGroup> | ||
7 | |||
8 | <Upgrade Id="B05772EA-82B8-4DE0-B7EB-45B5F0CCFE6D"> | ||
9 | <UpgradeVersion Minimum="1.0.0" Property="RELPRODFOUND"></UpgradeVersion> | ||
10 | </Upgrade> | ||
11 | </Fragment> | ||
12 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj index 8a11e531..e4da8b14 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj +++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj | |||
@@ -81,6 +81,7 @@ | |||
81 | <Content Include="TestData\Assembly\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | 81 | <Content Include="TestData\Assembly\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> |
82 | <Content Include="TestData\Assembly\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | 82 | <Content Include="TestData\Assembly\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> |
83 | <Content Include="TestData\Assembly\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | 83 | <Content Include="TestData\Assembly\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> |
84 | <Content Include="TestData\Upgrade\DetectOnly.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
84 | <Content Include="TestData\Variables\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> | 85 | <Content Include="TestData\Variables\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> |
85 | <Content Include="TestData\Variables\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | 86 | <Content Include="TestData\Variables\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> |
86 | <Content Include="TestData\Variables\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | 87 | <Content Include="TestData\Variables\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> |