diff options
| author | Bob Arnson <bob@joyofsetup.com> | 2018-09-03 18:19:08 -0400 |
|---|---|---|
| committer | Bob Arnson <bob@joyofsetup.com> | 2018-09-03 18:19:08 -0400 |
| commit | a2614e6e11108abba52b9eca8f460d9ab57513f5 (patch) | |
| tree | 77df973d12040f1b3cb30d96c6516b9e0f73dc31 /src/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs | |
| parent | c72297466821e6ca856866cd48726c919554b580 (diff) | |
| download | wix-a2614e6e11108abba52b9eca8f460d9ab57513f5.tar.gz wix-a2614e6e11108abba52b9eca8f460d9ab57513f5.tar.bz2 wix-a2614e6e11108abba52b9eca8f460d9ab57513f5.zip | |
Warn on preprocessor variable redefinition only when the values are different.
Fixes wixtoolset/issues#5853
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs')
| -rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs b/src/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs new file mode 100644 index 00000000..1193b685 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
| 2 | |||
| 3 | namespace WixToolsetTest.CoreIntegration | ||
| 4 | { | ||
| 5 | using System.IO; | ||
| 6 | using System.Linq; | ||
| 7 | using WixBuildTools.TestSupport; | ||
| 8 | using WixToolset.Core.TestPackage; | ||
| 9 | using WixToolset.Data; | ||
| 10 | using WixToolset.Data.Tuples; | ||
| 11 | using WixToolset.Data.WindowsInstaller; | ||
| 12 | using Xunit; | ||
| 13 | |||
| 14 | public class PreprocessorFixture | ||
| 15 | { | ||
| 16 | [Fact] | ||
| 17 | public void VariableRedefinitionIsAWarning() | ||
| 18 | { | ||
| 19 | var folder = TestData.Get(@"TestData\Variables"); | ||
| 20 | |||
| 21 | using (var fs = new DisposableFileSystem()) | ||
| 22 | { | ||
| 23 | var baseFolder = fs.GetFolder(); | ||
| 24 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 25 | |||
| 26 | var result = WixRunner.Execute(new[] | ||
| 27 | { | ||
| 28 | "build", | ||
| 29 | Path.Combine(folder, "Package.wxs"), | ||
| 30 | Path.Combine(folder, "PackageComponents.wxs"), | ||
| 31 | "-loc", Path.Combine(folder, "Package.en-us.wxl"), | ||
| 32 | "-bindpath", Path.Combine(folder, "data"), | ||
| 33 | "-intermediateFolder", intermediateFolder, | ||
| 34 | "-o", Path.Combine(baseFolder, @"bin\test.msi") | ||
| 35 | }, out var messages); | ||
| 36 | Assert.Equal(0, result); | ||
| 37 | |||
| 38 | var warnings = messages.Where(message => message.Id == 1118); | ||
| 39 | Assert.Single(warnings); | ||
| 40 | } | ||
| 41 | } | ||
| 42 | } | ||
| 43 | } | ||
| 44 | |||
