diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2020-06-01 21:58:44 +1000 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2020-06-03 14:24:34 +1000 |
| commit | 82a26a321bae36e38743f50f38887387a392ce24 (patch) | |
| tree | d5a562d5f370b674815711eb29d4415405f28d93 /src/test/WixToolsetTest.MSBuild | |
| parent | 2ba71ab83ea951a01344e2851a1f411affc42f38 (diff) | |
| download | wix-82a26a321bae36e38743f50f38887387a392ce24.tar.gz wix-82a26a321bae36e38743f50f38887387a392ce24.tar.bz2 wix-82a26a321bae36e38743f50f38887387a392ce24.zip | |
Add ability for net461 tasks to run the tool out of proc.
Diffstat (limited to 'src/test/WixToolsetTest.MSBuild')
| -rw-r--r-- | src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs | 25 | ||||
| -rw-r--r-- | src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs | 8 | ||||
| -rw-r--r-- | src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs | 7 |
3 files changed, 25 insertions, 15 deletions
diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs b/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs index 210473fa..6862f2a8 100644 --- a/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs +++ b/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs | |||
| @@ -28,9 +28,6 @@ namespace WixToolsetTest.MSBuild | |||
| 28 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); | 28 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); |
| 29 | result.AssertSuccess(); | 29 | result.AssertSuccess(); |
| 30 | 30 | ||
| 31 | var platformSwitches = result.Output.Where(line => line.TrimStart().StartsWith("wix.exe build -platform x86")); | ||
| 32 | Assert.Single(platformSwitches); | ||
| 33 | |||
| 34 | var warnings = result.Output.Where(line => line.Contains(": warning")); | 31 | var warnings = result.Output.Where(line => line.Contains(": warning")); |
| 35 | Assert.Empty(warnings); | 32 | Assert.Empty(warnings); |
| 36 | 33 | ||
| @@ -63,9 +60,6 @@ namespace WixToolsetTest.MSBuild | |||
| 63 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); | 60 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); |
| 64 | result.AssertSuccess(); | 61 | result.AssertSuccess(); |
| 65 | 62 | ||
| 66 | var platformSwitches = result.Output.Where(line => line.TrimStart().StartsWith("wix.exe build -platform x86")); | ||
| 67 | Assert.Single(platformSwitches); | ||
| 68 | |||
| 69 | var warnings = result.Output.Where(line => line.Contains(": warning")); | 63 | var warnings = result.Output.Where(line => line.Contains(": warning")); |
| 70 | Assert.Empty(warnings); | 64 | Assert.Empty(warnings); |
| 71 | 65 | ||
| @@ -98,7 +92,7 @@ namespace WixToolsetTest.MSBuild | |||
| 98 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); | 92 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); |
| 99 | result.AssertSuccess(); | 93 | result.AssertSuccess(); |
| 100 | 94 | ||
| 101 | var platformSwitches = result.Output.Where(line => line.TrimStart().StartsWith("wix.exe build -platform x86")); | 95 | var platformSwitches = result.Output.Where(line => line.Contains("-platform x86")); |
| 102 | Assert.Single(platformSwitches); | 96 | Assert.Single(platformSwitches); |
| 103 | 97 | ||
| 104 | var warnings = result.Output.Where(line => line.Contains(": warning")); | 98 | var warnings = result.Output.Where(line => line.Contains(": warning")); |
| @@ -223,7 +217,7 @@ namespace WixToolsetTest.MSBuild | |||
| 223 | }); | 217 | }); |
| 224 | result.AssertSuccess(); | 218 | result.AssertSuccess(); |
| 225 | 219 | ||
| 226 | var platformSwitches = result.Output.Where(line => line.TrimStart().StartsWith("wix.exe build -platform x64")); | 220 | var platformSwitches = result.Output.Where(line => line.Contains("-platform x64")); |
| 227 | Assert.Single(platformSwitches); | 221 | Assert.Single(platformSwitches); |
| 228 | 222 | ||
| 229 | var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) | 223 | var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) |
| @@ -287,9 +281,11 @@ namespace WixToolsetTest.MSBuild | |||
| 287 | } | 281 | } |
| 288 | 282 | ||
| 289 | [Theory] | 283 | [Theory] |
| 290 | [InlineData(BuildSystem.MSBuild)] | 284 | [InlineData(BuildSystem.MSBuild, null)] |
| 291 | [InlineData(BuildSystem.MSBuild64)] | 285 | [InlineData(BuildSystem.MSBuild, true)] |
| 292 | public void CanBuildSimpleMsiPackageAsWixipl(BuildSystem buildSystem) | 286 | [InlineData(BuildSystem.MSBuild64, null)] |
| 287 | [InlineData(BuildSystem.MSBuild64, true)] | ||
| 288 | public void CanBuildSimpleMsiPackageAsWixipl(BuildSystem buildSystem, bool? outOfProc) | ||
| 293 | { | 289 | { |
| 294 | var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); | 290 | var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); |
| 295 | 291 | ||
| @@ -303,9 +299,14 @@ namespace WixToolsetTest.MSBuild | |||
| 303 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] | 299 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] |
| 304 | { | 300 | { |
| 305 | "-p:OutputType=IntermediatePostLink", | 301 | "-p:OutputType=IntermediatePostLink", |
| 306 | }); | 302 | }, outOfProc: outOfProc); |
| 307 | result.AssertSuccess(); | 303 | result.AssertSuccess(); |
| 308 | 304 | ||
| 305 | var expectedOutOfProc = outOfProc.HasValue && outOfProc.Value; | ||
| 306 | var expectedWixCommand = $"{(expectedOutOfProc ? "wix.exe" : "(wix.exe)")} build"; | ||
| 307 | var buildCommands = result.Output.Where(line => line.TrimStart().Contains(expectedWixCommand)); | ||
| 308 | Assert.Single(buildCommands); | ||
| 309 | |||
| 309 | var path = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) | 310 | var path = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) |
| 310 | .Select(s => s.Substring(baseFolder.Length + 1)) | 311 | .Select(s => s.Substring(baseFolder.Length + 1)) |
| 311 | .Single(); | 312 | .Single(); |
diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs b/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs index 038da241..b5c71f86 100644 --- a/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs +++ b/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs | |||
| @@ -31,7 +31,9 @@ namespace WixToolsetTest.MSBuild | |||
| 31 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); | 31 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); |
| 32 | result.AssertSuccess(); | 32 | result.AssertSuccess(); |
| 33 | 33 | ||
| 34 | var heatCommandLines = result.Output.Where(line => line.TrimStart().StartsWith("heat.exe file")); | 34 | var expectedOutOfProc = false; |
| 35 | var expectedHeatCommand = $"{(expectedOutOfProc ? "heat.exe" : "(heat.exe)")} file"; | ||
| 36 | var heatCommandLines = result.Output.Where(line => line.Contains(expectedHeatCommand)); | ||
| 35 | Assert.Single(heatCommandLines); | 37 | Assert.Single(heatCommandLines); |
| 36 | 38 | ||
| 37 | var warnings = result.Output.Where(line => line.Contains(": warning")); | 39 | var warnings = result.Output.Where(line => line.Contains(": warning")); |
| @@ -86,7 +88,9 @@ namespace WixToolsetTest.MSBuild | |||
| 86 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); | 88 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); |
| 87 | result.AssertSuccess(); | 89 | result.AssertSuccess(); |
| 88 | 90 | ||
| 89 | var heatCommandLines = result.Output.Where(line => line.TrimStart().StartsWith("heat.exe file")); | 91 | var expectedOutOfProc = false; |
| 92 | var expectedHeatCommand = $"{(expectedOutOfProc ? "heat.exe" : "(heat.exe)")} file"; | ||
| 93 | var heatCommandLines = result.Output.Where(line => line.Contains(expectedHeatCommand)); | ||
| 90 | Assert.Equal(2, heatCommandLines.Count()); | 94 | Assert.Equal(2, heatCommandLines.Count()); |
| 91 | 95 | ||
| 92 | var warnings = result.Output.Where(line => line.Contains(": warning")); | 96 | var warnings = result.Output.Where(line => line.Contains(": warning")); |
diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs b/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs index 633fffe0..6a6f32e0 100644 --- a/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs +++ b/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs | |||
| @@ -17,7 +17,7 @@ namespace WixToolsetTest.MSBuild | |||
| 17 | { | 17 | { |
| 18 | public static readonly string WixPropsPath = Path.Combine(new Uri(typeof(MsbuildUtilities).Assembly.CodeBase).AbsolutePath, "..", "..", "publish", "WixToolset.MSBuild", "build", "WixToolset.MSBuild.props"); | 18 | public static readonly string WixPropsPath = Path.Combine(new Uri(typeof(MsbuildUtilities).Assembly.CodeBase).AbsolutePath, "..", "..", "publish", "WixToolset.MSBuild", "build", "WixToolset.MSBuild.props"); |
| 19 | 19 | ||
| 20 | public static MsbuildRunnerResult BuildProject(BuildSystem buildSystem, string projectPath, string[] arguments = null, string configuration = "Release") | 20 | public static MsbuildRunnerResult BuildProject(BuildSystem buildSystem, string projectPath, string[] arguments = null, string configuration = "Release", bool? outOfProc = null) |
| 21 | { | 21 | { |
| 22 | var allArgs = new List<string> | 22 | var allArgs = new List<string> |
| 23 | { | 23 | { |
| @@ -28,6 +28,11 @@ namespace WixToolsetTest.MSBuild | |||
| 28 | "-nr:false", | 28 | "-nr:false", |
| 29 | }; | 29 | }; |
| 30 | 30 | ||
| 31 | if (outOfProc.HasValue) | ||
| 32 | { | ||
| 33 | allArgs.Add($"-p:RunWixToolsOutOfProc={outOfProc.Value}"); | ||
| 34 | } | ||
| 35 | |||
| 31 | if (arguments != null) | 36 | if (arguments != null) |
| 32 | { | 37 | { |
| 33 | allArgs.AddRange(arguments); | 38 | allArgs.AddRange(arguments); |
