From 2ba71ab83ea951a01344e2851a1f411affc42f38 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sun, 31 May 2020 15:04:41 +1000 Subject: In MSBuild tests, default to Release. --- src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs | 40 +++++++++++----------- .../WixToolsetTest.MSBuild/MsbuildHeatFixture.cs | 10 +++--- .../WixToolsetTest.MSBuild/MsbuildUtilities.cs | 3 +- 3 files changed, 27 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs b/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs index cd9ef9fc..210473fa 100644 --- a/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs +++ b/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs @@ -40,8 +40,8 @@ namespace WixToolsetTest.MSBuild .ToArray(); Assert.Equal(new[] { - @"bin\x86\Debug\SimpleBundle.exe", - @"bin\x86\Debug\SimpleBundle.wixpdb", + @"bin\x86\Release\SimpleBundle.exe", + @"bin\x86\Release\SimpleBundle.wixpdb", }, paths); } } @@ -75,8 +75,8 @@ namespace WixToolsetTest.MSBuild .ToArray(); Assert.Equal(new[] { - @"bin\x86\Debug\SimpleMergeModule.msm", - @"bin\x86\Debug\SimpleMergeModule.wixpdb", + @"bin\x86\Release\SimpleMergeModule.msm", + @"bin\x86\Release\SimpleMergeModule.wixpdb", }, paths); } } @@ -110,9 +110,9 @@ namespace WixToolsetTest.MSBuild .ToArray(); Assert.Equal(new[] { - @"bin\x86\Debug\en-US\cab1.cab", - @"bin\x86\Debug\en-US\MsiPackage.msi", - @"bin\x86\Debug\en-US\MsiPackage.wixpdb", + @"bin\x86\Release\en-US\cab1.cab", + @"bin\x86\Release\en-US\MsiPackage.msi", + @"bin\x86\Release\en-US\MsiPackage.wixpdb", }, paths); } } @@ -143,9 +143,9 @@ namespace WixToolsetTest.MSBuild .ToArray(); Assert.Equal(new[] { - @"bin\x86\Debug\cab1.cab", - @"bin\x86\Debug\MergeMsiPackage.msi", - @"bin\x86\Debug\MergeMsiPackage.wixpdb", + @"bin\x86\Release\cab1.cab", + @"bin\x86\Release\MergeMsiPackage.msi", + @"bin\x86\Release\MergeMsiPackage.wixpdb", }, paths); } } @@ -157,9 +157,9 @@ namespace WixToolsetTest.MSBuild { var expectedOutputs = new[] { - @"bin\x86\Debug\en-US\cab1.cab", - @"bin\x86\Debug\en-US\MsiPackage.msi", - @"bin\x86\Debug\en-US\MsiPackage.wixpdb", + @"bin\x86\Release\en-US\cab1.cab", + @"bin\x86\Release\en-US\MsiPackage.msi", + @"bin\x86\Release\en-US\MsiPackage.wixpdb", }; this.AssertWixpdb(buildSystem, null, expectedOutputs); @@ -173,8 +173,8 @@ namespace WixToolsetTest.MSBuild { this.AssertWixpdb(buildSystem, "NONE", new[] { - @"bin\x86\Debug\en-US\cab1.cab", - @"bin\x86\Debug\en-US\MsiPackage.msi", + @"bin\x86\Release\en-US\cab1.cab", + @"bin\x86\Release\en-US\MsiPackage.msi", }); } @@ -232,9 +232,9 @@ namespace WixToolsetTest.MSBuild .ToArray(); Assert.Equal(new[] { - @"bin\x64\Debug\en-US\cab1.cab", - @"bin\x64\Debug\en-US\MsiPackage.msi", - @"bin\x64\Debug\en-US\MsiPackage.wixpdb", + @"bin\x64\Release\en-US\cab1.cab", + @"bin\x64\Release\en-US\MsiPackage.msi", + @"bin\x64\Release\en-US\MsiPackage.wixpdb", }, paths); } } @@ -309,7 +309,7 @@ namespace WixToolsetTest.MSBuild var path = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) .Select(s => s.Substring(baseFolder.Length + 1)) .Single(); - Assert.Equal(@"bin\x86\Debug\MsiPackage.wixipl", path); + Assert.Equal(@"bin\x86\Release\MsiPackage.wixipl", path); } } @@ -360,7 +360,7 @@ namespace WixToolsetTest.MSBuild "Package.wxs", "PackageComponents.wxs", @"data\test.txt", - @"obj\x86\Debug\MsiPackage.wixproj.FileListAbsolute.txt", + @"obj\x86\Release\MsiPackage.wixproj.FileListAbsolute.txt", }; var remainingPaths = Directory.EnumerateFiles(baseFolder, @"*.*", SearchOption.AllDirectories) diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs b/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs index 63c83bc7..038da241 100644 --- a/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs +++ b/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs @@ -37,7 +37,7 @@ namespace WixToolsetTest.MSBuild var warnings = result.Output.Where(line => line.Contains(": warning")); Assert.Empty(warnings); - var generatedFilePath = Path.Combine(intermediateFolder, "x86", "Debug", "_ProductComponents_INSTALLFOLDER_HeatFilePackage.wixproj_file.wxs"); + var generatedFilePath = Path.Combine(intermediateFolder, "x86", "Release", "_ProductComponents_INSTALLFOLDER_HeatFilePackage.wixproj_file.wxs"); Assert.True(File.Exists(generatedFilePath)); var generatedContents = File.ReadAllText(generatedFilePath); @@ -57,7 +57,7 @@ namespace WixToolsetTest.MSBuild "" + "", testXml); - var pdbPath = Path.Combine(binFolder, "x86", "Debug", "HeatFilePackage.wixpdb"); + var pdbPath = Path.Combine(binFolder, "x86", "Release", "HeatFilePackage.wixpdb"); Assert.True(File.Exists(pdbPath)); var intermediate = Intermediate.Load(pdbPath); @@ -92,7 +92,7 @@ namespace WixToolsetTest.MSBuild var warnings = result.Output.Where(line => line.Contains(": warning")); Assert.Empty(warnings); - var generatedFilePath = Path.Combine(intermediateFolder, "x86", "Debug", "_TxtProductComponents_INSTALLFOLDER_MyProgram.txt_file.wxs"); + var generatedFilePath = Path.Combine(intermediateFolder, "x86", "Release", "_TxtProductComponents_INSTALLFOLDER_MyProgram.txt_file.wxs"); Assert.True(File.Exists(generatedFilePath)); var generatedContents = File.ReadAllText(generatedFilePath); @@ -112,7 +112,7 @@ namespace WixToolsetTest.MSBuild "" + "", testXml); - generatedFilePath = Path.Combine(intermediateFolder, "x86", "Debug", "_JsonProductComponents_INSTALLFOLDER_MyProgram.json_file.wxs"); + generatedFilePath = Path.Combine(intermediateFolder, "x86", "Release", "_JsonProductComponents_INSTALLFOLDER_MyProgram.json_file.wxs"); Assert.True(File.Exists(generatedFilePath)); generatedContents = File.ReadAllText(generatedFilePath); @@ -132,7 +132,7 @@ namespace WixToolsetTest.MSBuild "" + "", testXml); - var pdbPath = Path.Combine(binFolder, "x86", "Debug", "HeatFileMultipleFilesSameFileName.wixpdb"); + var pdbPath = Path.Combine(binFolder, "x86", "Release", "HeatFileMultipleFilesSameFileName.wixpdb"); Assert.True(File.Exists(pdbPath)); var intermediate = Intermediate.Load(pdbPath); diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs b/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs index 6da52ed9..633fffe0 100644 --- a/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs +++ b/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs @@ -17,10 +17,11 @@ namespace WixToolsetTest.MSBuild { public static readonly string WixPropsPath = Path.Combine(new Uri(typeof(MsbuildUtilities).Assembly.CodeBase).AbsolutePath, "..", "..", "publish", "WixToolset.MSBuild", "build", "WixToolset.MSBuild.props"); - public static MsbuildRunnerResult BuildProject(BuildSystem buildSystem, string projectPath, params string[] arguments) + public static MsbuildRunnerResult BuildProject(BuildSystem buildSystem, string projectPath, string[] arguments = null, string configuration = "Release") { var allArgs = new List { + $"-p:Configuration={configuration}", $"-p:WixMSBuildProps={MsbuildUtilities.WixPropsPath}", // Node reuse means that child msbuild processes can stay around after the build completes. // Under that scenario, the root msbuild does not reliably close its streams which causes us to hang. -- cgit v1.2.3-55-g6feb