aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBob Arnson <bob@joyofsetup.com>2018-08-28 17:14:27 -0400
committerBob Arnson <bob@joyofsetup.com>2018-08-28 17:14:27 -0400
commit8a20ec988b05b9fe6312bf3d39098a00c6b46ef1 (patch)
treed6ce53aa962bc39887d37a1dec1c93f4f9829da1 /src
parent31f384f1629da03582dcfd8248ab435959cd1e0d (diff)
downloadwix-8a20ec988b05b9fe6312bf3d39098a00c6b46ef1.tar.gz
wix-8a20ec988b05b9fe6312bf3d39098a00c6b46ef1.tar.bz2
wix-8a20ec988b05b9fe6312bf3d39098a00c6b46ef1.zip
Support warning suppression.
Diffstat (limited to 'src')
-rw-r--r--src/WixToolset.BuildTasks/DoIt.cs1
-rw-r--r--src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs30
-rw-r--r--src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.wxs4
-rw-r--r--src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs2
4 files changed, 35 insertions, 2 deletions
diff --git a/src/WixToolset.BuildTasks/DoIt.cs b/src/WixToolset.BuildTasks/DoIt.cs
index 01938ed6..0c8d261c 100644
--- a/src/WixToolset.BuildTasks/DoIt.cs
+++ b/src/WixToolset.BuildTasks/DoIt.cs
@@ -145,6 +145,7 @@ namespace WixToolset.BuildTasks
145 commandLineBuilder.AppendExtensions(this.Extensions, this.ExtensionDirectory, this.ReferencePaths); 145 commandLineBuilder.AppendExtensions(this.Extensions, this.ExtensionDirectory, this.ReferencePaths);
146 commandLineBuilder.AppendIfTrue("-sval", this.SuppressValidation); 146 commandLineBuilder.AppendIfTrue("-sval", this.SuppressValidation);
147 commandLineBuilder.AppendArrayIfNotNull("-sice ", this.SuppressIces); 147 commandLineBuilder.AppendArrayIfNotNull("-sice ", this.SuppressIces);
148 commandLineBuilder.AppendArrayIfNotNull("-sw ", this.SuppressSpecificWarnings);
148 commandLineBuilder.AppendSwitchIfNotNull("-usf ", this.UnreferencedSymbolsFile); 149 commandLineBuilder.AppendSwitchIfNotNull("-usf ", this.UnreferencedSymbolsFile);
149 commandLineBuilder.AppendSwitchIfNotNull("-cc ", this.CabinetCachePath); 150 commandLineBuilder.AppendSwitchIfNotNull("-cc ", this.CabinetCachePath);
150 commandLineBuilder.AppendSwitchIfNotNull("-intermediatefolder ", this.IntermediateDirectory); 151 commandLineBuilder.AppendSwitchIfNotNull("-intermediatefolder ", this.IntermediateDirectory);
diff --git a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs
index 95b727ad..119c3ba5 100644
--- a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs
+++ b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs
@@ -31,7 +31,7 @@ namespace WixToolsetTest.BuildTasks
31 var binFolder = Path.Combine(baseFolder, @"bin\"); 31 var binFolder = Path.Combine(baseFolder, @"bin\");
32 var intermediateFolder = Path.Combine(baseFolder, @"obj\"); 32 var intermediateFolder = Path.Combine(baseFolder, @"obj\");
33 33
34 var result = this.MsbuildRunner.Execute(projectPath, new[] 34 var result = this.MsbuildRunner.Execute(projectPath, new[]
35 { 35 {
36 $"-p:WixTargetsPath={WixTargetsPath}", 36 $"-p:WixTargetsPath={WixTargetsPath}",
37 $"-p:IntermediateOutputPath={intermediateFolder}", 37 $"-p:IntermediateOutputPath={intermediateFolder}",
@@ -39,6 +39,9 @@ namespace WixToolsetTest.BuildTasks
39 }); 39 });
40 result.AssertSuccess(); 40 result.AssertSuccess();
41 41
42 var warnings = result.Output.Where(line => line.Contains(": warning"));
43 Assert.Equal(4, warnings.Count());
44
42 var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) 45 var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories)
43 .Select(s => s.Substring(baseFolder.Length + 1)) 46 .Select(s => s.Substring(baseFolder.Length + 1))
44 .OrderBy(s => s) 47 .OrderBy(s => s)
@@ -53,6 +56,31 @@ namespace WixToolsetTest.BuildTasks
53 } 56 }
54 57
55 [Fact] 58 [Fact]
59 public void CanBuildSimpleMsiPackageWithWarningSuppressions()
60 {
61 var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj");
62
63 using (var fs = new DisposableFileSystem())
64 {
65 var baseFolder = fs.GetFolder();
66 var binFolder = Path.Combine(baseFolder, @"bin\");
67 var intermediateFolder = Path.Combine(baseFolder, @"obj\");
68
69 var result = this.MsbuildRunner.Execute(projectPath, new[]
70 {
71 $"-p:WixTargetsPath={WixTargetsPath}",
72 $"-p:IntermediateOutputPath={intermediateFolder}",
73 $"-p:OutputPath={binFolder}",
74 "-p:SuppressSpecificWarnings=\"1118;1102\""
75 });
76 result.AssertSuccess();
77
78 var warnings = result.Output.Where(line => line.Contains(": warning"));
79 Assert.Empty(warnings);
80 }
81 }
82
83 [Fact]
56 public void CanBuildAndCleanSimpleMsiPackage() 84 public void CanBuildAndCleanSimpleMsiPackage()
57 { 85 {
58 var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); 86 var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj");
diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.wxs b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.wxs
index d5a5a40d..a02b766a 100644
--- a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.wxs
+++ b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.wxs
@@ -1,4 +1,8 @@
1<?xml version="1.0" encoding="utf-8"?> 1<?xml version="1.0" encoding="utf-8"?>
2
3<?define Variable = "Value" ?>
4<?define Variable = "Value" ?>
5
2<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> 6<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
3 <Product Id="*" Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a"> 7 <Product Id="*" Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a">
4 <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" /> 8 <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs
index e26c4509..ddb95faf 100644
--- a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs
+++ b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs
@@ -3,7 +3,7 @@
3 <Fragment> 3 <Fragment>
4 <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> 4 <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
5 <Component> 5 <Component>
6 <File Source="test.txt" /> 6 <File Source="test.txt" DefaultLanguage="1033" />
7 </Component> 7 </Component>
8 </ComponentGroup> 8 </ComponentGroup>
9 </Fragment> 9 </Fragment>