diff options
| author | Bob Arnson <bob@firegiant.com> | 2021-03-07 17:37:56 -0500 |
|---|---|---|
| committer | Bob Arnson <bob@firegiant.com> | 2021-03-07 17:54:48 -0500 |
| commit | 24082aafc87c9cc3ed22749e6b21d80e0d3e6ced (patch) | |
| tree | a871c6b5d5e6dcb52e94e86891fd35428c4fc5e2 /src/test/WixToolsetTest.CoreIntegration | |
| parent | 722ffb41bb83879d3e086b6faffd45ee38c5a5b6 (diff) | |
| download | wix-24082aafc87c9cc3ed22749e6b21d80e0d3e6ced.tar.gz wix-24082aafc87c9cc3ed22749e6b21d80e0d3e6ced.tar.bz2 wix-24082aafc87c9cc3ed22749e6b21d80e0d3e6ced.zip | |
Improve missing entry section error message.
Fixes https://github.com/wixtoolset/issues/issues/5886
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration')
| -rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs b/src/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs index d85eb3bf..41c1d773 100644 --- a/src/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs | |||
| @@ -79,5 +79,95 @@ namespace WixToolsetTest.CoreIntegration | |||
| 79 | //Assert.Equal(@"test.txt", wixFile[WixFileSymbolFields.Source].PreviousValue.AsPath().Path); | 79 | //Assert.Equal(@"test.txt", wixFile[WixFileSymbolFields.Source].PreviousValue.AsPath().Path); |
| 80 | } | 80 | } |
| 81 | } | 81 | } |
| 82 | |||
| 83 | [Fact] | ||
| 84 | public void MissingEntrySectionDetectedProduct() | ||
| 85 | { | ||
| 86 | var folder = TestData.Get(@"TestData\OverridableActions"); | ||
| 87 | |||
| 88 | using (var fs = new DisposableFileSystem()) | ||
| 89 | { | ||
| 90 | var baseFolder = fs.GetFolder(); | ||
| 91 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 92 | |||
| 93 | try | ||
| 94 | { | ||
| 95 | WixRunner.Execute(new[] | ||
| 96 | { | ||
| 97 | "build", | ||
| 98 | Path.Combine(folder, "PackageComponents.wxs"), | ||
| 99 | "-intermediateFolder", intermediateFolder, | ||
| 100 | "-o", Path.Combine(baseFolder, @"bin\test.msi") | ||
| 101 | }); | ||
| 102 | } | ||
| 103 | catch (WixException we) | ||
| 104 | { | ||
| 105 | Assert.Equal("Could not find entry section in provided list of intermediates. Expected section of type 'Product'.", we.Message); | ||
| 106 | return; | ||
| 107 | } | ||
| 108 | |||
| 109 | Assert.True(false, "Expected WixException for missing entry section but expectations were not met."); | ||
| 110 | } | ||
| 111 | } | ||
| 112 | |||
| 113 | [Fact] | ||
| 114 | public void MissingEntrySectionDetectedWixipl() | ||
| 115 | { | ||
| 116 | var folder = TestData.Get(@"TestData\OverridableActions"); | ||
| 117 | |||
| 118 | using (var fs = new DisposableFileSystem()) | ||
| 119 | { | ||
| 120 | var baseFolder = fs.GetFolder(); | ||
| 121 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 122 | |||
| 123 | try | ||
| 124 | { | ||
| 125 | WixRunner.Execute(new[] | ||
| 126 | { | ||
| 127 | "build", | ||
| 128 | Path.Combine(folder, "PackageComponents.wxs"), | ||
| 129 | "-intermediateFolder", intermediateFolder, | ||
| 130 | "-o", Path.Combine(baseFolder, @"bin\test.wixipl") | ||
| 131 | }); | ||
| 132 | } | ||
| 133 | catch (WixException we) | ||
| 134 | { | ||
| 135 | Assert.Equal("Could not find entry section in provided list of intermediates. Supported entry section types are: Product, Bundle, Patch, PatchCreation, Module.", we.Message); | ||
| 136 | return; | ||
| 137 | } | ||
| 138 | |||
| 139 | Assert.True(false, "Expected WixException for missing entry section but expectations were not met."); | ||
| 140 | } | ||
| 141 | } | ||
| 142 | |||
| 143 | [Fact] | ||
| 144 | public void MissingEntrySectionDetectedUnknown() | ||
| 145 | { | ||
| 146 | var folder = TestData.Get(@"TestData\OverridableActions"); | ||
| 147 | |||
| 148 | using (var fs = new DisposableFileSystem()) | ||
| 149 | { | ||
| 150 | var baseFolder = fs.GetFolder(); | ||
| 151 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 152 | |||
| 153 | try | ||
| 154 | { | ||
| 155 | WixRunner.Execute(new[] | ||
| 156 | { | ||
| 157 | "build", | ||
| 158 | Path.Combine(folder, "PackageComponents.wxs"), | ||
| 159 | "-intermediateFolder", intermediateFolder, | ||
| 160 | "-o", Path.Combine(baseFolder, @"bin\test.bob") | ||
| 161 | }); | ||
| 162 | } | ||
| 163 | catch (WixException we) | ||
| 164 | { | ||
| 165 | Assert.Equal("Could not find entry section in provided list of intermediates. Supported entry section types are: Product, Bundle, Patch, PatchCreation, Module.", we.Message); | ||
| 166 | return; | ||
| 167 | } | ||
| 168 | |||
| 169 | Assert.True(false, "Expected WixException for missing entry section but expectations were not met."); | ||
| 170 | } | ||
| 171 | } | ||
| 82 | } | 172 | } |
| 83 | } | 173 | } |
