diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2020-04-06 14:06:29 +1000 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2020-04-06 14:15:26 +1000 |
commit | 59ffa86b7d62ddc52ec813fb65c47f812aeded66 (patch) | |
tree | f777a4da178d3cd1127a4c072f505dc9515d9d3c /src/test/WixToolsetTest.CoreIntegration | |
parent | fcd88ec3995033bf802f0a637e7fce65e8739006 (diff) | |
download | wix-59ffa86b7d62ddc52ec813fb65c47f812aeded66.tar.gz wix-59ffa86b7d62ddc52ec813fb65c47f812aeded66.tar.bz2 wix-59ffa86b7d62ddc52ec813fb65c47f812aeded66.zip |
Try to fix build flakiness with Example.Extension.
Add failing test for the TableDefinition overload of EnsureTable.
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration')
3 files changed, 48 insertions, 0 deletions
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 @@ | |||
2 | 2 | ||
3 | namespace WixToolsetTest.CoreIntegration | 3 | namespace WixToolsetTest.CoreIntegration |
4 | { | 4 | { |
5 | using System; | ||
5 | using System.IO; | 6 | using System.IO; |
6 | using System.Linq; | 7 | using System.Linq; |
8 | using Example.Extension; | ||
7 | using WixBuildTools.TestSupport; | 9 | using WixBuildTools.TestSupport; |
8 | using WixToolset.Core.TestPackage; | 10 | using WixToolset.Core.TestPackage; |
9 | using WixToolset.Data; | 11 | using WixToolset.Data; |
@@ -882,5 +884,39 @@ namespace WixToolsetTest.CoreIntegration | |||
882 | Assert.NotEmpty(output.SubStorages); | 884 | Assert.NotEmpty(output.SubStorages); |
883 | } | 885 | } |
884 | } | 886 | } |
887 | |||
888 | [Fact(Skip = "Test demonstrates failure")] | ||
889 | public void FailsBuildAtLinkTimeForMissingEnsureTable() | ||
890 | { | ||
891 | var folder = TestData.Get(@"TestData"); | ||
892 | var extensionPath = Path.GetFullPath(new Uri(typeof(ExampleExtensionFactory).Assembly.CodeBase).LocalPath); | ||
893 | |||
894 | using (var fs = new DisposableFileSystem()) | ||
895 | { | ||
896 | var baseFolder = fs.GetFolder(); | ||
897 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
898 | var msiPath = Path.Combine(baseFolder, @"bin\test.msi"); | ||
899 | |||
900 | var result = WixRunner.Execute(new[] | ||
901 | { | ||
902 | "build", | ||
903 | Path.Combine(folder, "BadEnsureTable", "BadEnsureTable.wxs"), | ||
904 | Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"), | ||
905 | Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), | ||
906 | "-ext", extensionPath, | ||
907 | "-bindpath", Path.Combine(folder, "SingleFile", "data"), | ||
908 | "-intermediateFolder", intermediateFolder, | ||
909 | "-o", msiPath | ||
910 | }); | ||
911 | Assert.Collection(result.Messages, | ||
912 | first => | ||
913 | { | ||
914 | Assert.Equal(MessageLevel.Error, first.Level); | ||
915 | 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()); | ||
916 | }); | ||
917 | |||
918 | Assert.False(File.Exists(msiPath)); | ||
919 | } | ||
920 | } | ||
885 | } | 921 | } |
886 | } | 922 | } |
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/BadEnsureTable/BadEnsureTable.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/BadEnsureTable/BadEnsureTable.wxs new file mode 100644 index 00000000..3caa20ff --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/BadEnsureTable/BadEnsureTable.wxs | |||
@@ -0,0 +1,11 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" | ||
3 | xmlns:ex="http://www.example.com/scheams/v1/wxs"> | ||
4 | <Fragment> | ||
5 | <ComponentGroup Id="ProductComponents"> | ||
6 | <ComponentGroupRef Id="MinimalComponentGroup" /> | ||
7 | </ComponentGroup> | ||
8 | |||
9 | <ex:ExampleEnsureTable /> | ||
10 | </Fragment> | ||
11 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj index 98402223..dbc9357c 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj +++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj | |||
@@ -21,6 +21,7 @@ | |||
21 | <Content Include="TestData\AppSearch\FileSearch.wxs" CopyToOutputDirectory="PreserveNewest" /> | 21 | <Content Include="TestData\AppSearch\FileSearch.wxs" CopyToOutputDirectory="PreserveNewest" /> |
22 | <Content Include="TestData\AppSearch\NestedDirSearchUnderRegSearch.msi" CopyToOutputDirectory="PreserveNewest" /> | 22 | <Content Include="TestData\AppSearch\NestedDirSearchUnderRegSearch.msi" CopyToOutputDirectory="PreserveNewest" /> |
23 | <Content Include="TestData\AppSearch\RegistrySearch.wxs" CopyToOutputDirectory="PreserveNewest" /> | 23 | <Content Include="TestData\AppSearch\RegistrySearch.wxs" CopyToOutputDirectory="PreserveNewest" /> |
24 | <Content Include="TestData\BadEnsureTable\BadEnsureTable.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
24 | <Content Include="TestData\BundleExtension\BundleExtension.wxs" CopyToOutputDirectory="PreserveNewest" /> | 25 | <Content Include="TestData\BundleExtension\BundleExtension.wxs" CopyToOutputDirectory="PreserveNewest" /> |
25 | <Content Include="TestData\BundleExtension\BundleExtensionSearches.wxs" CopyToOutputDirectory="PreserveNewest" /> | 26 | <Content Include="TestData\BundleExtension\BundleExtensionSearches.wxs" CopyToOutputDirectory="PreserveNewest" /> |
26 | <Content Include="TestData\BundleExtension\BundleWithSearches.wxs" CopyToOutputDirectory="PreserveNewest" /> | 27 | <Content Include="TestData\BundleExtension\BundleWithSearches.wxs" CopyToOutputDirectory="PreserveNewest" /> |