diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2020-10-31 19:54:44 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2020-10-31 20:18:04 -0500 |
commit | 0031d5e8f859b342ac9860b7055bb738b6303ec0 (patch) | |
tree | cab128899b5372135cdd578bc9df21e394c1d1b0 /src | |
parent | fefb8f0571400937ca8bd9c7e5984bbb24a94181 (diff) | |
download | wix-0031d5e8f859b342ac9860b7055bb738b6303ec0.tar.gz wix-0031d5e8f859b342ac9860b7055bb738b6303ec0.tar.bz2 wix-0031d5e8f859b342ac9860b7055bb738b6303ec0.zip |
Add test for Overridable.
Also, reenable MBA test.
Diffstat (limited to 'src')
4 files changed, 49 insertions, 4 deletions
diff --git a/src/test/WixToolsetTest.Bal/BalExtensionFixture.cs b/src/test/WixToolsetTest.Bal/BalExtensionFixture.cs index a19013f5..277a941a 100644 --- a/src/test/WixToolsetTest.Bal/BalExtensionFixture.cs +++ b/src/test/WixToolsetTest.Bal/BalExtensionFixture.cs | |||
@@ -46,6 +46,39 @@ namespace WixToolsetTest.Bal | |||
46 | } | 46 | } |
47 | 47 | ||
48 | [Fact] | 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] | ||
49 | public void CanBuildUsingWixStdBa() | 82 | public void CanBuildUsingWixStdBa() |
50 | { | 83 | { |
51 | using (var fs = new DisposableFileSystem()) | 84 | using (var fs = new DisposableFileSystem()) |
@@ -69,7 +102,7 @@ namespace WixToolsetTest.Bal | |||
69 | } | 102 | } |
70 | } | 103 | } |
71 | 104 | ||
72 | [Fact(Skip = "Skip test until cycle with Netfx.wixext and this repo is resolved")] | 105 | [Fact] |
73 | public void CantBuildUsingMBAWithNoPrereqs() | 106 | public void CantBuildUsingMBAWithNoPrereqs() |
74 | { | 107 | { |
75 | using (var fs = new DisposableFileSystem()) | 108 | using (var fs = new DisposableFileSystem()) |
@@ -84,7 +117,6 @@ namespace WixToolsetTest.Bal | |||
84 | "build", | 117 | "build", |
85 | Path.Combine(bundleSourceFolder, "Bundle.wxs"), | 118 | Path.Combine(bundleSourceFolder, "Bundle.wxs"), |
86 | "-ext", TestData.Get(@"WixToolset.Bal.wixext.dll"), | 119 | "-ext", TestData.Get(@"WixToolset.Bal.wixext.dll"), |
87 | "-ext", TestData.Get(@"WixToolset.NetFx.wixext.dll"), | ||
88 | "-intermediateFolder", intermediateFolder, | 120 | "-intermediateFolder", intermediateFolder, |
89 | "-o", bundleFile, | 121 | "-o", bundleFile, |
90 | }); | 122 | }); |
diff --git a/src/test/WixToolsetTest.Bal/TestData/MBA/Bundle.wxs b/src/test/WixToolsetTest.Bal/TestData/MBA/Bundle.wxs index b3538c68..e6f1d566 100644 --- a/src/test/WixToolsetTest.Bal/TestData/MBA/Bundle.wxs +++ b/src/test/WixToolsetTest.Bal/TestData/MBA/Bundle.wxs | |||
@@ -4,7 +4,7 @@ | |||
4 | <Bundle Name="WixStdBa" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="75D5D534-E177-4689-AAE9-CAC1C39002C2"> | 4 | <Bundle Name="WixStdBa" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="75D5D534-E177-4689-AAE9-CAC1C39002C2"> |
5 | <BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost" /> | 5 | <BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost" /> |
6 | <Chain> | 6 | <Chain> |
7 | <PackageGroupRef Id="NetFx462Redist" /> | 7 | <ExePackage SourceFile="runtimes\win-x86\native\wixnative.exe" /> |
8 | </Chain> | 8 | </Chain> |
9 | </Bundle> | 9 | </Bundle> |
10 | </Wix> | 10 | </Wix> |
diff --git a/src/test/WixToolsetTest.Bal/TestData/Overridable/Bundle.wxs b/src/test/WixToolsetTest.Bal/TestData/Overridable/Bundle.wxs new file mode 100644 index 00000000..3ac3df60 --- /dev/null +++ b/src/test/WixToolsetTest.Bal/TestData/Overridable/Bundle.wxs | |||
@@ -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> | ||
diff --git a/src/test/WixToolsetTest.Bal/WixToolsetTest.Bal.csproj b/src/test/WixToolsetTest.Bal/WixToolsetTest.Bal.csproj index 3c742604..199b82e2 100644 --- a/src/test/WixToolsetTest.Bal/WixToolsetTest.Bal.csproj +++ b/src/test/WixToolsetTest.Bal/WixToolsetTest.Bal.csproj | |||
@@ -13,6 +13,7 @@ | |||
13 | 13 | ||
14 | <ItemGroup> | 14 | <ItemGroup> |
15 | <Content Include="TestData\MBA\Bundle.wxs" CopyToOutputDirectory="PreserveNewest" /> | 15 | <Content Include="TestData\MBA\Bundle.wxs" CopyToOutputDirectory="PreserveNewest" /> |
16 | <Content Include="TestData\Overridable\Bundle.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
16 | <Content Include="TestData\WixStdBa\Bundle.wxs" CopyToOutputDirectory="PreserveNewest" /> | 17 | <Content Include="TestData\WixStdBa\Bundle.wxs" CopyToOutputDirectory="PreserveNewest" /> |
17 | <Content Include="TestData\WixStdBa\Data\test.msi" CopyToOutputDirectory="PreserveNewest" /> | 18 | <Content Include="TestData\WixStdBa\Data\test.msi" CopyToOutputDirectory="PreserveNewest" /> |
18 | <Content Include="TestData\WixStdBa\DisplayInternalUIConditionBundle.wxs" CopyToOutputDirectory="PreserveNewest" /> | 19 | <Content Include="TestData\WixStdBa\DisplayInternalUIConditionBundle.wxs" CopyToOutputDirectory="PreserveNewest" /> |
@@ -32,7 +33,6 @@ | |||
32 | <PackageReference Include="WixToolset.Core.WindowsInstaller" Version="4.0.*" /> | 33 | <PackageReference Include="WixToolset.Core.WindowsInstaller" Version="4.0.*" /> |
33 | <PackageReference Include="WixToolset.Core.TestPackage" Version="4.0.*" /> | 34 | <PackageReference Include="WixToolset.Core.TestPackage" Version="4.0.*" /> |
34 | <PackageReference Include="WixToolset.Data" Version="4.0.*" /> | 35 | <PackageReference Include="WixToolset.Data" Version="4.0.*" /> |
35 | <!-- <PackageReference Include="WixToolset.NetFx.wixext" Version="4.0.*" /> --> | ||
36 | </ItemGroup> | 36 | </ItemGroup> |
37 | 37 | ||
38 | <ItemGroup> | 38 | <ItemGroup> |