diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2020-06-03 14:01:28 +1000 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2020-06-03 14:24:34 +1000 |
| commit | 6bb2c3d5a2082c377a31bffe1bbdb950b5e15781 (patch) | |
| tree | a68f4a40454748189198cd74f8fd285b14df1c80 /src/test/WixToolsetTest.MSBuild | |
| parent | 874fb5fc3597d784a4e8ac07d735e3caa34417be (diff) | |
| download | wix-6bb2c3d5a2082c377a31bffe1bbdb950b5e15781.tar.gz wix-6bb2c3d5a2082c377a31bffe1bbdb950b5e15781.tar.bz2 wix-6bb2c3d5a2082c377a31bffe1bbdb950b5e15781.zip | |
Get the inner exception test working in the MSBuild test project.
Diffstat (limited to 'src/test/WixToolsetTest.MSBuild')
| -rw-r--r-- | src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs | 26 | ||||
| -rw-r--r-- | src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs | 3 |
2 files changed, 28 insertions, 1 deletions
diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs b/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs index 71255165..163e8402 100644 --- a/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs +++ b/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs | |||
| @@ -378,5 +378,31 @@ namespace WixToolsetTest.MSBuild | |||
| 378 | Assert.Empty(remainingPaths); | 378 | Assert.Empty(remainingPaths); |
| 379 | } | 379 | } |
| 380 | } | 380 | } |
| 381 | |||
| 382 | [Theory] | ||
| 383 | [InlineData(BuildSystem.DotNetCoreSdk)] | ||
| 384 | [InlineData(BuildSystem.MSBuild)] | ||
| 385 | [InlineData(BuildSystem.MSBuild64)] | ||
| 386 | public void ReportsInnerExceptionForUnexpectedExceptions(BuildSystem buildSystem) | ||
| 387 | { | ||
| 388 | var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); | ||
| 389 | |||
| 390 | using (var fs = new TestDataFolderFileSystem()) | ||
| 391 | { | ||
| 392 | fs.Initialize(sourceFolder); | ||
| 393 | var baseFolder = fs.BaseFolder; | ||
| 394 | var binFolder = Path.Combine(baseFolder, @"bin\"); | ||
| 395 | var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); | ||
| 396 | |||
| 397 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] | ||
| 398 | { | ||
| 399 | MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "WixToolDir", Path.Combine(MsbuildUtilities.WixMsbuildPath, "broken", "net461")), | ||
| 400 | }, outOfProc: true); | ||
| 401 | Assert.Equal(1, result.ExitCode); | ||
| 402 | |||
| 403 | var expectedMessage = "System.PlatformNotSupportedException: Could not find platform specific 'wixnative.exe' ---> System.IO.FileNotFoundException: Could not find internal piece of WiX Toolset from"; | ||
| 404 | Assert.Contains(result.Output, m => m.Contains(expectedMessage)); | ||
| 405 | } | ||
| 406 | } | ||
| 381 | } | 407 | } |
| 382 | } | 408 | } |
diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs b/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs index 90c3194b..fead4915 100644 --- a/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs +++ b/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs | |||
| @@ -17,7 +17,8 @@ namespace WixToolsetTest.MSBuild | |||
| 17 | 17 | ||
| 18 | public static class MsbuildUtilities | 18 | public static class MsbuildUtilities |
| 19 | { | 19 | { |
| 20 | public static readonly string WixPropsPath = Path.Combine(new Uri(typeof(MsbuildUtilities).Assembly.CodeBase).AbsolutePath, "..", "..", "publish", "WixToolset.MSBuild", "build", "WixToolset.MSBuild.props"); | 20 | public static readonly string WixMsbuildPath = Path.Combine(new Uri(typeof(MsbuildUtilities).Assembly.CodeBase).AbsolutePath, "..", "..", "publish", "WixToolset.MSBuild"); |
| 21 | public static readonly string WixPropsPath = Path.Combine(WixMsbuildPath, "build", "WixToolset.MSBuild.props"); | ||
| 21 | 22 | ||
| 22 | public static MsbuildRunnerResult BuildProject(BuildSystem buildSystem, string projectPath, string[] arguments = null, string configuration = "Release", bool? outOfProc = null, string verbosityLevel = "normal") | 23 | public static MsbuildRunnerResult BuildProject(BuildSystem buildSystem, string projectPath, string[] arguments = null, string configuration = "Release", bool? outOfProc = null, string verbosityLevel = "normal") |
| 23 | { | 24 | { |
