diff options
Diffstat (limited to 'src/wix/test/WixToolsetTest.Sdk/MsbuildFixture.cs')
-rw-r--r-- | src/wix/test/WixToolsetTest.Sdk/MsbuildFixture.cs | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/src/wix/test/WixToolsetTest.Sdk/MsbuildFixture.cs b/src/wix/test/WixToolsetTest.Sdk/MsbuildFixture.cs index f9a13312..40ebad5b 100644 --- a/src/wix/test/WixToolsetTest.Sdk/MsbuildFixture.cs +++ b/src/wix/test/WixToolsetTest.Sdk/MsbuildFixture.cs | |||
@@ -11,6 +11,9 @@ namespace WixToolsetTest.Sdk | |||
11 | 11 | ||
12 | public class MsbuildFixture | 12 | public class MsbuildFixture |
13 | { | 13 | { |
14 | public static readonly string WixMsbuildPath = Path.Combine(Path.GetDirectoryName(new Uri(typeof(MsbuildFixture).Assembly.CodeBase).AbsolutePath), "..", "..", "..", "publish", "WixToolset.Sdk"); | ||
15 | public static readonly string WixPropsPath = Path.Combine(WixMsbuildPath, "build", "WixToolset.Sdk.props"); | ||
16 | |||
14 | [Theory] | 17 | [Theory] |
15 | [InlineData(BuildSystem.DotNetCoreSdk)] | 18 | [InlineData(BuildSystem.DotNetCoreSdk)] |
16 | [InlineData(BuildSystem.MSBuild)] | 19 | [InlineData(BuildSystem.MSBuild)] |
@@ -26,7 +29,10 @@ namespace WixToolsetTest.Sdk | |||
26 | var binFolder = Path.Combine(baseFolder, @"bin\"); | 29 | var binFolder = Path.Combine(baseFolder, @"bin\"); |
27 | var projectPath = Path.Combine(baseFolder, "SimpleBundle.wixproj"); | 30 | var projectPath = Path.Combine(baseFolder, "SimpleBundle.wixproj"); |
28 | 31 | ||
29 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] { "-p:SignOutput=true" }); | 32 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] { |
33 | MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "WixMSBuildProps", MsbuildFixture.WixPropsPath), | ||
34 | "-p:SignOutput=true", | ||
35 | }); | ||
30 | result.AssertSuccess(); | 36 | result.AssertSuccess(); |
31 | 37 | ||
32 | var warnings = result.Output.Where(line => line.Contains(": warning")).ToArray(); | 38 | var warnings = result.Output.Where(line => line.Contains(": warning")).ToArray(); |
@@ -66,7 +72,10 @@ namespace WixToolsetTest.Sdk | |||
66 | var binFolder = Path.Combine(baseFolder, @"bin\"); | 72 | var binFolder = Path.Combine(baseFolder, @"bin\"); |
67 | var projectPath = Path.Combine(baseFolder, "UncompressedBundle.wixproj"); | 73 | var projectPath = Path.Combine(baseFolder, "UncompressedBundle.wixproj"); |
68 | 74 | ||
69 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] { "-p:SignOutput=true" }); | 75 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] { |
76 | MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "WixMSBuildProps", MsbuildFixture.WixPropsPath), | ||
77 | "-p:SignOutput=true" | ||
78 | }); | ||
70 | result.AssertSuccess(); | 79 | result.AssertSuccess(); |
71 | 80 | ||
72 | var warnings = result.Output.Where(line => line.Contains(": warning")).ToArray(); | 81 | var warnings = result.Output.Where(line => line.Contains(": warning")).ToArray(); |
@@ -106,7 +115,9 @@ namespace WixToolsetTest.Sdk | |||
106 | var binFolder = Path.Combine(baseFolder, @"bin\"); | 115 | var binFolder = Path.Combine(baseFolder, @"bin\"); |
107 | var projectPath = Path.Combine(baseFolder, "SimpleMergeModule.wixproj"); | 116 | var projectPath = Path.Combine(baseFolder, "SimpleMergeModule.wixproj"); |
108 | 117 | ||
109 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); | 118 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] { |
119 | MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "WixMSBuildProps", MsbuildFixture.WixPropsPath) | ||
120 | }); | ||
110 | result.AssertSuccess(); | 121 | result.AssertSuccess(); |
111 | 122 | ||
112 | var warnings = result.Output.Where(line => line.Contains(": warning")).ToArray(); | 123 | var warnings = result.Output.Where(line => line.Contains(": warning")).ToArray(); |
@@ -142,7 +153,10 @@ namespace WixToolsetTest.Sdk | |||
142 | var binFolder = Path.Combine(baseFolder, @"bin\"); | 153 | var binFolder = Path.Combine(baseFolder, @"bin\"); |
143 | var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); | 154 | var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); |
144 | 155 | ||
145 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] { "-p:SignOutput=true" }); | 156 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] { |
157 | MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "WixMSBuildProps", MsbuildFixture.WixPropsPath), | ||
158 | "-p:SignOutput=true" | ||
159 | }); | ||
146 | result.AssertSuccess(); | 160 | result.AssertSuccess(); |
147 | 161 | ||
148 | var platformSwitches = result.Output.Where(line => line.Contains("-platform x86")); | 162 | var platformSwitches = result.Output.Where(line => line.Contains("-platform x86")); |
@@ -208,7 +222,9 @@ namespace WixToolsetTest.Sdk | |||
208 | var binFolder = Path.Combine(baseFolder, @"bin\"); | 222 | var binFolder = Path.Combine(baseFolder, @"bin\"); |
209 | var projectPath = Path.Combine(baseFolder, "MergeMsiPackage.wixproj"); | 223 | var projectPath = Path.Combine(baseFolder, "MergeMsiPackage.wixproj"); |
210 | 224 | ||
211 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); | 225 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] { |
226 | MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "WixMSBuildProps", MsbuildFixture.WixPropsPath) | ||
227 | }); | ||
212 | result.AssertSuccess(); | 228 | result.AssertSuccess(); |
213 | 229 | ||
214 | var warnings = result.Output.Where(line => line.Contains(": warning")).ToArray(); | 230 | var warnings = result.Output.Where(line => line.Contains(": warning")).ToArray(); |
@@ -270,6 +286,7 @@ namespace WixToolsetTest.Sdk | |||
270 | 286 | ||
271 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] | 287 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] |
272 | { | 288 | { |
289 | MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "WixMSBuildProps", MsbuildFixture.WixPropsPath), | ||
273 | wixpdbType == null ? String.Empty : $"-p:WixPdbType={wixpdbType}", | 290 | wixpdbType == null ? String.Empty : $"-p:WixPdbType={wixpdbType}", |
274 | "-p:SuppressValidation=true" | 291 | "-p:SuppressValidation=true" |
275 | }); | 292 | }); |
@@ -300,6 +317,7 @@ namespace WixToolsetTest.Sdk | |||
300 | 317 | ||
301 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] | 318 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] |
302 | { | 319 | { |
320 | MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "WixMSBuildProps", MsbuildFixture.WixPropsPath), | ||
303 | $"-p:Platform=x64", | 321 | $"-p:Platform=x64", |
304 | }); | 322 | }); |
305 | result.AssertSuccess(); | 323 | result.AssertSuccess(); |
@@ -337,6 +355,7 @@ namespace WixToolsetTest.Sdk | |||
337 | 355 | ||
338 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] | 356 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] |
339 | { | 357 | { |
358 | MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "WixMSBuildProps", MsbuildFixture.WixPropsPath), | ||
340 | MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "SuppressIces", "ICE12"), | 359 | MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "SuppressIces", "ICE12"), |
341 | }, suppressValidation: false); | 360 | }, suppressValidation: false); |
342 | result.AssertSuccess(); | 361 | result.AssertSuccess(); |
@@ -360,6 +379,7 @@ namespace WixToolsetTest.Sdk | |||
360 | 379 | ||
361 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] | 380 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] |
362 | { | 381 | { |
382 | MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "WixMSBuildProps", MsbuildFixture.WixPropsPath), | ||
363 | MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "SuppressSpecificWarnings", "1118;1102"), | 383 | MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "SuppressSpecificWarnings", "1118;1102"), |
364 | }); | 384 | }); |
365 | result.AssertSuccess(); | 385 | result.AssertSuccess(); |
@@ -389,6 +409,7 @@ namespace WixToolsetTest.Sdk | |||
389 | 409 | ||
390 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] | 410 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] |
391 | { | 411 | { |
412 | MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "WixMSBuildProps", MsbuildFixture.WixPropsPath), | ||
392 | "-p:OutputType=IntermediatePostLink", | 413 | "-p:OutputType=IntermediatePostLink", |
393 | }, outOfProc: outOfProc); | 414 | }, outOfProc: outOfProc); |
394 | result.AssertSuccess(); | 415 | result.AssertSuccess(); |
@@ -418,7 +439,9 @@ namespace WixToolsetTest.Sdk | |||
418 | var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); | 439 | var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); |
419 | 440 | ||
420 | // Build | 441 | // Build |
421 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, verbosityLevel: "diag"); | 442 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] { |
443 | MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "WixMSBuildProps", MsbuildFixture.WixPropsPath) | ||
444 | }, verbosityLevel: "diag"); | ||
422 | result.AssertSuccess(); | 445 | result.AssertSuccess(); |
423 | 446 | ||
424 | var buildOutput = String.Join("\r\n", result.Output); | 447 | var buildOutput = String.Join("\r\n", result.Output); |
@@ -432,6 +455,7 @@ namespace WixToolsetTest.Sdk | |||
432 | // Clean | 455 | // Clean |
433 | result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] | 456 | result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] |
434 | { | 457 | { |
458 | MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "WixMSBuildProps", MsbuildFixture.WixPropsPath), | ||
435 | "-t:Clean", | 459 | "-t:Clean", |
436 | }, verbosityLevel: "diag"); | 460 | }, verbosityLevel: "diag"); |
437 | result.AssertSuccess(); | 461 | result.AssertSuccess(); |
@@ -477,7 +501,7 @@ namespace WixToolsetTest.Sdk | |||
477 | 501 | ||
478 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] | 502 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] |
479 | { | 503 | { |
480 | MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "WixToolDir", Path.Combine(MsbuildUtilities.WixMsbuildPath, "broken", "net461")), | 504 | MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "WixToolDir", Path.Combine(MsbuildFixture.WixMsbuildPath, "broken", "net461")), |
481 | }, outOfProc: true); | 505 | }, outOfProc: true); |
482 | Assert.Equal(1, result.ExitCode); | 506 | Assert.Equal(1, result.ExitCode); |
483 | 507 | ||