diff options
| author | Bob Arnson <bob@firegiant.com> | 2019-11-06 18:17:18 -0500 |
|---|---|---|
| committer | Bob Arnson <bob@firegiant.com> | 2019-11-06 19:13:38 -0500 |
| commit | 58cd3477c3ae3d7880991ee1651a862a45371e08 (patch) | |
| tree | 933c6b44723e6d2d41208a5904b964fe91bf68c3 /src/test/WixToolsetTest.CoreIntegration | |
| parent | 97a70bbc1b90cb26f8c77d83e703689d15d08761 (diff) | |
| download | wix-58cd3477c3ae3d7880991ee1651a862a45371e08.tar.gz wix-58cd3477c3ae3d7880991ee1651a862a45371e08.tar.bz2 wix-58cd3477c3ae3d7880991ee1651a862a45371e08.zip | |
Add preprocessor variables with WiX version info.
$(sys.WIXMAJORVERSION)
$(sys.WIXVERSION)
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration')
| -rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs | 33 | ||||
| -rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/TestData/Variables/Package.wxs | 4 |
2 files changed, 35 insertions, 2 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs b/src/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs index 633a1b46..4e48cbe1 100644 --- a/src/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs | |||
| @@ -7,6 +7,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 7 | using WixBuildTools.TestSupport; | 7 | using WixBuildTools.TestSupport; |
| 8 | using WixToolset.Core; | 8 | using WixToolset.Core; |
| 9 | using WixToolset.Core.TestPackage; | 9 | using WixToolset.Core.TestPackage; |
| 10 | using WixToolset.Data; | ||
| 10 | using WixToolset.Extensibility.Data; | 11 | using WixToolset.Extensibility.Data; |
| 11 | using Xunit; | 12 | using Xunit; |
| 12 | 13 | ||
| @@ -61,8 +62,36 @@ namespace WixToolsetTest.CoreIntegration | |||
| 61 | 62 | ||
| 62 | result.AssertSuccess(); | 63 | result.AssertSuccess(); |
| 63 | 64 | ||
| 64 | var warnings = result.Messages.Where(message => message.Id == 1118); | 65 | var warning = result.Messages.Where(message => message.Id == (int)WarningMessages.Ids.VariableDeclarationCollision); |
| 65 | Assert.Single(warnings); | 66 | Assert.Single(warning); |
| 67 | } | ||
| 68 | } | ||
| 69 | |||
| 70 | [Fact] | ||
| 71 | public void WixVersionVariablesWork() | ||
| 72 | { | ||
| 73 | var folder = TestData.Get(@"TestData\Variables"); | ||
| 74 | |||
| 75 | using (var fs = new DisposableFileSystem()) | ||
| 76 | { | ||
| 77 | var baseFolder = fs.GetFolder(); | ||
| 78 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 79 | |||
| 80 | var result = WixRunner.Execute(new[] | ||
| 81 | { | ||
| 82 | "build", | ||
| 83 | Path.Combine(folder, "Package.wxs"), | ||
| 84 | Path.Combine(folder, "PackageComponents.wxs"), | ||
| 85 | "-loc", Path.Combine(folder, "Package.en-us.wxl"), | ||
| 86 | "-bindpath", Path.Combine(folder, "data"), | ||
| 87 | "-intermediateFolder", intermediateFolder, | ||
| 88 | "-o", Path.Combine(baseFolder, @"bin\test.msi") | ||
| 89 | }); | ||
| 90 | |||
| 91 | result.AssertSuccess(); | ||
| 92 | |||
| 93 | var warning = result.Messages.Where(message => message.Id == (int)WarningMessages.Ids.PreprocessorWarning); | ||
| 94 | Assert.Single(warning); | ||
| 66 | } | 95 | } |
| 67 | } | 96 | } |
| 68 | 97 | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/Variables/Package.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/Variables/Package.wxs index 896b7e3f..9f5e3f34 100644 --- a/src/test/WixToolsetTest.CoreIntegration/TestData/Variables/Package.wxs +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/Variables/Package.wxs | |||
| @@ -6,6 +6,10 @@ | |||
| 6 | <?define Bar = "Bar" ?> | 6 | <?define Bar = "Bar" ?> |
| 7 | <?define Bar = "Baz" ?> | 7 | <?define Bar = "Baz" ?> |
| 8 | 8 | ||
| 9 | <?if $(sys.WIXMAJORVERSION) >= 4 AND $(sys.WIXMAJORVERSION) < 5 ?> | ||
| 10 | <?warning WiX v4 is in effect! ?> | ||
| 11 | <?endif?> | ||
| 12 | |||
| 9 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | 13 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> |
| 10 | <Product Id="*" Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a"> | 14 | <Product Id="*" Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a"> |
| 11 | <Package InstallerVersion="200" Compressed="no" InstallScope="perMachine" /> | 15 | <Package InstallerVersion="200" Compressed="no" InstallScope="perMachine" /> |
