From 59ffa86b7d62ddc52ec813fb65c47f812aeded66 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Mon, 6 Apr 2020 14:06:29 +1000 Subject: Try to fix build flakiness with Example.Extension. Add failing test for the TableDefinition overload of EnsureTable. --- .../WixToolsetTest.CoreIntegration/MsiFixture.cs | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs') diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs index 2141e68c..ad24f346 100644 --- a/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs @@ -2,8 +2,10 @@ namespace WixToolsetTest.CoreIntegration { + using System; using System.IO; using System.Linq; + using Example.Extension; using WixBuildTools.TestSupport; using WixToolset.Core.TestPackage; using WixToolset.Data; @@ -882,5 +884,39 @@ namespace WixToolsetTest.CoreIntegration Assert.NotEmpty(output.SubStorages); } } + + [Fact(Skip = "Test demonstrates failure")] + public void FailsBuildAtLinkTimeForMissingEnsureTable() + { + var folder = TestData.Get(@"TestData"); + var extensionPath = Path.GetFullPath(new Uri(typeof(ExampleExtensionFactory).Assembly.CodeBase).LocalPath); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var intermediateFolder = Path.Combine(baseFolder, "obj"); + var msiPath = Path.Combine(baseFolder, @"bin\test.msi"); + + var result = WixRunner.Execute(new[] + { + "build", + Path.Combine(folder, "BadEnsureTable", "BadEnsureTable.wxs"), + Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"), + Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), + "-ext", extensionPath, + "-bindpath", Path.Combine(folder, "SingleFile", "data"), + "-intermediateFolder", intermediateFolder, + "-o", msiPath + }); + Assert.Collection(result.Messages, + first => + { + Assert.Equal(MessageLevel.Error, first.Level); + Assert.Equal("The identifier 'WixCustomTable:TableDefinitionNotExposedByExtension' could not be found. Ensure you have typed the reference correctly and that all the necessary inputs are provided to the linker.", first.ToString()); + }); + + Assert.False(File.Exists(msiPath)); + } + } } } -- cgit v1.2.3-55-g6feb