@joebigelow / wix / commits / 0031d5e8

Add test for Overridable.

Also, reenable MBA test.

Sean Hall committed Oct 31, 2020 at 19:54 UTC 0031d5e8f859b342ac9860b7055bb738b6303ec0
4 files changed +49 -4
src/test/WixToolsetTest.Bal/BalExtensionFixture.cs
+34 -2
@@ -45,6 +45,39 @@ namespace WixToolsetTest.Bal
45 }
46 }
47
48 + [Fact]
49 + public void CanBuildUsingOverridable()
50 + {
51 + using (var fs = new DisposableFileSystem())
52 + {
53 + var baseFolder = fs.GetFolder();
54 + var bundleFile = Path.Combine(baseFolder, "bin", "test.exe");
55 + var bundleSourceFolder = TestData.Get(@"TestData\Overridable");
56 + var intermediateFolder = Path.Combine(baseFolder, "obj");
57 + var baFolderPath = Path.Combine(baseFolder, "ba");
58 + var extractFolderPath = Path.Combine(baseFolder, "extract");
59 +
60 + var compileResult = WixRunner.Execute(new[]
61 + {
62 + "build",
63 + Path.Combine(bundleSourceFolder, "Bundle.wxs"),
64 + "-ext", TestData.Get(@"WixToolset.Bal.wixext.dll"),
65 + "-intermediateFolder", intermediateFolder,
66 + "-o", bundleFile,
67 + });
68 + compileResult.AssertSuccess();
69 +
70 + Assert.True(File.Exists(bundleFile));
71 +
72 + var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath);
73 + extractResult.AssertSuccess();
74 +
75 + var balOverridableVariables = extractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:WixStdbaOverridableVariable");
76 + var balOverridableVariable = (XmlNode)Assert.Single(balOverridableVariables);
77 + Assert.Equal("<WixStdbaOverridableVariable Name='Test1' />", balOverridableVariable.GetTestXml());
78 + }
79 + }
80 +
81 [Fact]
82 public void CanBuildUsingWixStdBa()
83 {
@@ -69,7 +102,7 @@ namespace WixToolsetTest.Bal
102 }
103 }
104
72 - [Fact(Skip = "Skip test until cycle with Netfx.wixext and this repo is resolved")]
105 + [Fact]
106 public void CantBuildUsingMBAWithNoPrereqs()
107 {
108 using (var fs = new DisposableFileSystem())
@@ -84,7 +117,6 @@ namespace WixToolsetTest.Bal
117 "build",
118 Path.Combine(bundleSourceFolder, "Bundle.wxs"),
119 "-ext", TestData.Get(@"WixToolset.Bal.wixext.dll"),
87 - "-ext", TestData.Get(@"WixToolset.NetFx.wixext.dll"),
120 "-intermediateFolder", intermediateFolder,
121 "-o", bundleFile,
122 });
src/test/WixToolsetTest.Bal/TestData/MBA/Bundle.wxs
+1 -1
@@ -4,7 +4,7 @@
4 <Bundle Name="WixStdBa" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="75D5D534-E177-4689-AAE9-CAC1C39002C2">
5 <BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost" />
6 <Chain>
7 - <PackageGroupRef Id="NetFx462Redist" />
7 + <ExePackage SourceFile="runtimes\win-x86\native\wixnative.exe" />
8 </Chain>
9 </Bundle>
10 </Wix>
src/test/WixToolsetTest.Bal/TestData/Overridable/Bundle.wxs new
+13
@@ -0,0 +1,13 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
3 + xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal">
4 + <Bundle Name="WixStdBa" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="75D5D534-E177-4689-AAE9-CAC1C39002C2">
5 + <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkLicense">
6 + <bal:WixStandardBootstrapperApplication LicenseUrl="http://wixtoolset.org/about/license/" />
7 + </BootstrapperApplicationRef>
8 + <Variable Name="Test1" bal:Overridable="yes" />
9 + <Chain>
10 + <ExePackage SourceFile="runtimes\win-x86\native\wixnative.exe" />
11 + </Chain>
12 + </Bundle>
13 +</Wix>
src/test/WixToolsetTest.Bal/WixToolsetTest.Bal.csproj
+1 -1
@@ -13,6 +13,7 @@
13
14 <ItemGroup>
15 <Content Include="TestData\MBA\Bundle.wxs" CopyToOutputDirectory="PreserveNewest" />
16 + <Content Include="TestData\Overridable\Bundle.wxs" CopyToOutputDirectory="PreserveNewest" />
17 <Content Include="TestData\WixStdBa\Bundle.wxs" CopyToOutputDirectory="PreserveNewest" />
18 <Content Include="TestData\WixStdBa\Data\test.msi" CopyToOutputDirectory="PreserveNewest" />
19 <Content Include="TestData\WixStdBa\DisplayInternalUIConditionBundle.wxs" CopyToOutputDirectory="PreserveNewest" />
@@ -32,7 +33,6 @@
33 <PackageReference Include="WixToolset.Core.WindowsInstaller" Version="4.0.*" />
34 <PackageReference Include="WixToolset.Core.TestPackage" Version="4.0.*" />
35 <PackageReference Include="WixToolset.Data" Version="4.0.*" />
35 - <!-- <PackageReference Include="WixToolset.NetFx.wixext" Version="4.0.*" /> -->
36 </ItemGroup>
37
38 <ItemGroup>