Add failing tests.
Sean Hall committed
Oct 14, 2020 at 23:05 UTC
95188080c8005c01c39bb071459b36f8660bcfcd
4 files changed
+72
src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs
+52
@@ -244,5 +244,57 @@ namespace WixToolsetTest.CoreIntegration
244
Assert.True(File.Exists(exePath));
245
}
246
}
247
+
248
+ [Fact(Skip = "Test demonstrates failure")]
249
+ public void CantBuildWithDuplicateCacheIds()
250
+ {
251
+ var folder = TestData.Get(@"TestData");
252
+
253
+ using (var fs = new DisposableFileSystem())
254
+ {
255
+ var baseFolder = fs.GetFolder();
256
+ var intermediateFolder = Path.Combine(baseFolder, "obj");
257
+ var exePath = Path.Combine(baseFolder, @"bin\test.exe");
258
+
259
+ var result = WixRunner.Execute(new[]
260
+ {
261
+ "build",
262
+ Path.Combine(folder, "BadInput", "DuplicateCacheIds.wxs"),
263
+ Path.Combine(folder, "BundleWithPackageGroupRef", "Bundle.wxs"),
264
+ "-bindpath", Path.Combine(folder, "SimpleBundle", "data"),
265
+ "-bindpath", Path.Combine(folder, ".Data"),
266
+ "-intermediateFolder", intermediateFolder,
267
+ "-o", exePath,
268
+ });
269
+
270
+ Assert.InRange(result.ExitCode, 2, Int32.MaxValue);
271
+ }
272
+ }
273
+
274
+ [Fact(Skip = "Test demonstrates failure")]
275
+ public void CantBuildWithDuplicatePayloadNames()
276
+ {
277
+ var folder = TestData.Get(@"TestData");
278
+
279
+ using (var fs = new DisposableFileSystem())
280
+ {
281
+ var baseFolder = fs.GetFolder();
282
+ var intermediateFolder = Path.Combine(baseFolder, "obj");
283
+ var exePath = Path.Combine(baseFolder, @"bin\test.exe");
284
+
285
+ var result = WixRunner.Execute(new[]
286
+ {
287
+ "build",
288
+ Path.Combine(folder, "BadInput", "DuplicatePayloadNames.wxs"),
289
+ Path.Combine(folder, "BundleWithPackageGroupRef", "Bundle.wxs"),
290
+ "-bindpath", Path.Combine(folder, "SimpleBundle", "data"),
291
+ "-bindpath", Path.Combine(folder, ".Data"),
292
+ "-intermediateFolder", intermediateFolder,
293
+ "-o", exePath,
294
+ });
295
+
296
+ Assert.InRange(result.ExitCode, 2, Int32.MaxValue);
297
+ }
298
+ }
299
}
300
}
src/test/WixToolsetTest.CoreIntegration/TestData/BadInput/DuplicateCacheIds.wxs
new
+9
@@ -0,0 +1,9 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
3
+ <Fragment>
4
+ <PackageGroup Id="BundlePackages">
5
+ <ExePackage Id="Manual1" SourceFile="burn.exe" Name="manual1\burn.exe" CacheId="Manual" />
6
+ <ExePackage Id="Manual2" SourceFile="burn.exe" Name="manual2\burn.exe" CacheId="Manual" />
7
+ </PackageGroup>
8
+ </Fragment>
9
+</Wix>
src/test/WixToolsetTest.CoreIntegration/TestData/BadInput/DuplicatePayloadNames.wxs
new
+9
@@ -0,0 +1,9 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
3
+ <Fragment>
4
+ <PackageGroup Id="BundlePackages">
5
+ <ExePackage Id="Auto1" SourceFile="burn.exe" CacheId="Auto1" />
6
+ <ExePackage Id="Auto2" SourceFile="burn.exe" CacheId="Auto2" />
7
+ </PackageGroup>
8
+ </Fragment>
9
+</Wix>
src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj
+2
@@ -23,6 +23,8 @@
23
<Content Include="TestData\AppSearch\RegistrySearch.wxs" CopyToOutputDirectory="PreserveNewest" />
24
<Content Include="TestData\BadEnsureTable\BadEnsureTable.wxs" CopyToOutputDirectory="PreserveNewest" />
25
<Content Include="TestData\BadInput\BundleVariable.wxs" CopyToOutputDirectory="PreserveNewest" />
26
+ <Content Include="TestData\BadInput\DuplicateCacheIds.wxs" CopyToOutputDirectory="PreserveNewest" />
27
+ <Content Include="TestData\BadInput\DuplicatePayloadNames.wxs" CopyToOutputDirectory="PreserveNewest" />
28
<Content Include="TestData\BadInput\RegistryKey.wxs" CopyToOutputDirectory="PreserveNewest" />
29
<Content Include="TestData\BindVariables\DefaultedVariable.wxs" CopyToOutputDirectory="PreserveNewest" />
30
<Content Include="TestData\BindVariables\data\test.txt" CopyToOutputDirectory="PreserveNewest" />