From 95188080c8005c01c39bb071459b36f8660bcfcd Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 14 Oct 2020 23:05:10 -0500 Subject: Add failing tests. --- .../BundleFixture.cs | 52 ++++++++++++++++++++++ .../TestData/BadInput/DuplicateCacheIds.wxs | 9 ++++ .../TestData/BadInput/DuplicatePayloadNames.wxs | 9 ++++ .../WixToolsetTest.CoreIntegration.csproj | 2 + 4 files changed, 72 insertions(+) create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/BadInput/DuplicateCacheIds.wxs create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/BadInput/DuplicatePayloadNames.wxs (limited to 'src') diff --git a/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs b/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs index 5e1e5866..ad1648e6 100644 --- a/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs @@ -244,5 +244,57 @@ namespace WixToolsetTest.CoreIntegration Assert.True(File.Exists(exePath)); } } + + [Fact(Skip = "Test demonstrates failure")] + public void CantBuildWithDuplicateCacheIds() + { + var folder = TestData.Get(@"TestData"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var intermediateFolder = Path.Combine(baseFolder, "obj"); + var exePath = Path.Combine(baseFolder, @"bin\test.exe"); + + var result = WixRunner.Execute(new[] + { + "build", + Path.Combine(folder, "BadInput", "DuplicateCacheIds.wxs"), + Path.Combine(folder, "BundleWithPackageGroupRef", "Bundle.wxs"), + "-bindpath", Path.Combine(folder, "SimpleBundle", "data"), + "-bindpath", Path.Combine(folder, ".Data"), + "-intermediateFolder", intermediateFolder, + "-o", exePath, + }); + + Assert.InRange(result.ExitCode, 2, Int32.MaxValue); + } + } + + [Fact(Skip = "Test demonstrates failure")] + public void CantBuildWithDuplicatePayloadNames() + { + var folder = TestData.Get(@"TestData"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var intermediateFolder = Path.Combine(baseFolder, "obj"); + var exePath = Path.Combine(baseFolder, @"bin\test.exe"); + + var result = WixRunner.Execute(new[] + { + "build", + Path.Combine(folder, "BadInput", "DuplicatePayloadNames.wxs"), + Path.Combine(folder, "BundleWithPackageGroupRef", "Bundle.wxs"), + "-bindpath", Path.Combine(folder, "SimpleBundle", "data"), + "-bindpath", Path.Combine(folder, ".Data"), + "-intermediateFolder", intermediateFolder, + "-o", exePath, + }); + + Assert.InRange(result.ExitCode, 2, Int32.MaxValue); + } + } } } diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/BadInput/DuplicateCacheIds.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/BadInput/DuplicateCacheIds.wxs new file mode 100644 index 00000000..5c58ef50 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/BadInput/DuplicateCacheIds.wxs @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/BadInput/DuplicatePayloadNames.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/BadInput/DuplicatePayloadNames.wxs new file mode 100644 index 00000000..2d4e8a3c --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/BadInput/DuplicatePayloadNames.wxs @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj index f4aab391..fdb56987 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj +++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj @@ -23,6 +23,8 @@ + + -- cgit v1.2.3-55-g6feb