aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2020-07-17 10:42:30 -0700
committerRob Mensching <rob@firegiant.com>2020-07-17 15:27:13 -0700
commitc37f29a156a84e27e6b38a7841e2ddcde015b071 (patch)
treed9ff8d98970a103dcb31c1fc045d4c3031bf2a40 /src/test
parent0db15d84eaabf2f1950784655ddd79413cfea44f (diff)
downloadwix-c37f29a156a84e27e6b38a7841e2ddcde015b071.tar.gz
wix-c37f29a156a84e27e6b38a7841e2ddcde015b071.tar.bz2
wix-c37f29a156a84e27e6b38a7841e2ddcde015b071.zip
Fix parsing of bind variables with default values
Diffstat (limited to 'src/test')
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/BindVariablesFixture.cs38
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/TestData/BindVariables/DefaultedVariable.wxs6
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/TestData/BindVariables/data/test.txt1
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj2
4 files changed, 47 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/BindVariablesFixture.cs b/src/test/WixToolsetTest.CoreIntegration/BindVariablesFixture.cs
new file mode 100644
index 00000000..3e9c7aa4
--- /dev/null
+++ b/src/test/WixToolsetTest.CoreIntegration/BindVariablesFixture.cs
@@ -0,0 +1,38 @@
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
3namespace WixToolsetTest.CoreIntegration
4{
5 using System;
6 using System.IO;
7 using WixBuildTools.TestSupport;
8 using WixToolset.Core.TestPackage;
9 using Xunit;
10
11 public class BindVariablesFixture
12 {
13 [Fact]
14 public void CanBuildWithDefaultValue()
15 {
16 var folder = TestData.Get(@"TestData\BindVariables");
17
18 using (var fs = new DisposableFileSystem())
19 {
20 var baseFolder = fs.GetFolder();
21 var intermediateFolder = Path.Combine(baseFolder, "obj");
22 var wixlibPath = Path.Combine(intermediateFolder, @"test.wixlib");
23
24 var result = WixRunner.Execute(new[]
25 {
26 "build",
27 Path.Combine(folder, "DefaultedVariable.wxs"),
28 "-bf",
29 "-intermediateFolder", intermediateFolder,
30 "-bindpath", folder,
31 "-o", wixlibPath,
32 });
33
34 result.AssertSuccess();
35 }
36 }
37 }
38}
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/BindVariables/DefaultedVariable.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/BindVariables/DefaultedVariable.wxs
new file mode 100644
index 00000000..c3528a67
--- /dev/null
+++ b/src/test/WixToolsetTest.CoreIntegration/TestData/BindVariables/DefaultedVariable.wxs
@@ -0,0 +1,6 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
3 <Fragment>
4 <Binary Id="Bound" SourceFile="!(wix.Test=data\test.txt)" />
5 </Fragment>
6</Wix>
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/BindVariables/data/test.txt b/src/test/WixToolsetTest.CoreIntegration/TestData/BindVariables/data/test.txt
new file mode 100644
index 00000000..3b862323
--- /dev/null
+++ b/src/test/WixToolsetTest.CoreIntegration/TestData/BindVariables/data/test.txt
@@ -0,0 +1 @@
This is test.txt
diff --git a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj
index 87ace0b9..15078b8a 100644
--- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj
+++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj
@@ -23,6 +23,8 @@
23 <Content Include="TestData\AppSearch\RegistrySearch.wxs" CopyToOutputDirectory="PreserveNewest" /> 23 <Content Include="TestData\AppSearch\RegistrySearch.wxs" CopyToOutputDirectory="PreserveNewest" />
24 <Content Include="TestData\BadEnsureTable\BadEnsureTable.wxs" CopyToOutputDirectory="PreserveNewest" /> 24 <Content Include="TestData\BadEnsureTable\BadEnsureTable.wxs" CopyToOutputDirectory="PreserveNewest" />
25 <Content Include="TestData\BadInput\RegistryKey.wxs" CopyToOutputDirectory="PreserveNewest" /> 25 <Content Include="TestData\BadInput\RegistryKey.wxs" CopyToOutputDirectory="PreserveNewest" />
26 <Content Include="TestData\BindVariables\DefaultedVariable.wxs" CopyToOutputDirectory="PreserveNewest" />
27 <Content Include="TestData\BindVariables\data\test.txt" CopyToOutputDirectory="PreserveNewest" />
26 <Content Include="TestData\BundleCustomTable\BundleCustomTable.wxs" CopyToOutputDirectory="PreserveNewest" /> 28 <Content Include="TestData\BundleCustomTable\BundleCustomTable.wxs" CopyToOutputDirectory="PreserveNewest" />
27 <Content Include="TestData\BundleExtension\BundleExtension.wxs" CopyToOutputDirectory="PreserveNewest" /> 29 <Content Include="TestData\BundleExtension\BundleExtension.wxs" CopyToOutputDirectory="PreserveNewest" />
28 <Content Include="TestData\BundleExtension\BundleExtensionSearches.wxs" CopyToOutputDirectory="PreserveNewest" /> 30 <Content Include="TestData\BundleExtension\BundleExtensionSearches.wxs" CopyToOutputDirectory="PreserveNewest" />