diff options
| author | Rob Mensching <rob@firegiant.com> | 2021-01-07 15:12:13 -0800 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2021-01-07 15:17:07 -0800 |
| commit | a36c59a4911a7db525f6b03dc98fac5adde163b4 (patch) | |
| tree | 74b6b1edab6547fc6bc4db1c75fefa94a00bed65 /src/test/WixToolsetTest.CoreIntegration | |
| parent | 1b10d394bc88c2840b355bb72c1a502181c28ca2 (diff) | |
| download | wix-a36c59a4911a7db525f6b03dc98fac5adde163b4.tar.gz wix-a36c59a4911a7db525f6b03dc98fac5adde163b4.tar.bz2 wix-a36c59a4911a7db525f6b03dc98fac5adde163b4.zip | |
Support environment variables with parens in the preprocessor
Fixes wixtoolset/issues#4484
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration')
| -rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs | 18 | ||||
| -rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/TestData/Preprocessor/EnvParens.wxs | 4 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs b/src/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs index a6504cb9..aad3ed73 100644 --- a/src/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs | |||
| @@ -40,6 +40,24 @@ namespace WixToolsetTest.CoreIntegration | |||
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | [Fact] | 42 | [Fact] |
| 43 | /// <remarks> | ||
| 44 | /// This test will fail on 32-bit operating systems because it depends on "CommonProgramFiles(x86)" | ||
| 45 | /// which is only defined on 64-bit Windows. | ||
| 46 | /// </remarks> | ||
| 47 | public void SupportParensInEnvironmentVariables() | ||
| 48 | { | ||
| 49 | var folder = TestData.Get(@"TestData", "Preprocessor"); | ||
| 50 | |||
| 51 | var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); | ||
| 52 | var context = serviceProvider.GetService<IPreprocessContext>(); | ||
| 53 | context.SourcePath = Path.Combine(folder, "EnvParens.wxs"); | ||
| 54 | |||
| 55 | var preprocessor = serviceProvider.GetService<IPreprocessor>(); | ||
| 56 | var result = preprocessor.Preprocess(context); | ||
| 57 | Assert.NotNull(result.Document); | ||
| 58 | } | ||
| 59 | |||
| 60 | [Fact] | ||
| 43 | public void VariableRedefinitionIsAWarning() | 61 | public void VariableRedefinitionIsAWarning() |
| 44 | { | 62 | { |
| 45 | var folder = TestData.Get(@"TestData\Variables"); | 63 | var folder = TestData.Get(@"TestData\Variables"); |
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/Preprocessor/EnvParens.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/Preprocessor/EnvParens.wxs new file mode 100644 index 00000000..68d115c5 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/Preprocessor/EnvParens.wxs | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8" ?> | ||
| 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 3 | <?define Test = "$(env.CommonProgramFiles(x86))" ?> | ||
| 4 | </Wix> | ||
