From a36c59a4911a7db525f6b03dc98fac5adde163b4 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 7 Jan 2021 15:12:13 -0800 Subject: Support environment variables with parens in the preprocessor Fixes wixtoolset/issues#4484 --- .../PreprocessorFixture.cs | 18 ++++++++++++++++++ .../TestData/Preprocessor/EnvParens.wxs | 4 ++++ 2 files changed, 22 insertions(+) create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/Preprocessor/EnvParens.wxs (limited to 'src/test/WixToolsetTest.CoreIntegration') 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 @@ -39,6 +39,24 @@ namespace WixToolsetTest.CoreIntegration Assert.Null(includedFile.SourceLineNumbers.Parent); } + [Fact] + /// + /// This test will fail on 32-bit operating systems because it depends on "CommonProgramFiles(x86)" + /// which is only defined on 64-bit Windows. + /// + public void SupportParensInEnvironmentVariables() + { + var folder = TestData.Get(@"TestData", "Preprocessor"); + + var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); + var context = serviceProvider.GetService(); + context.SourcePath = Path.Combine(folder, "EnvParens.wxs"); + + var preprocessor = serviceProvider.GetService(); + var result = preprocessor.Preprocess(context); + Assert.NotNull(result.Document); + } + [Fact] public void VariableRedefinitionIsAWarning() { 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 @@ + + + + -- cgit v1.2.3-55-g6feb