aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2022-08-26 17:47:46 -0700
committerRob Mensching <rob@firegiant.com>2022-08-26 22:09:49 -0700
commit3e0e54aff605da9c5ec6c02f7e83d5e816c857a2 (patch)
treee09e2d4e16620e4587af8e7a35f23a3c1db803a7 /src/test
parent7b59be82400f3c4d6e4f294940118e85b77f5a92 (diff)
downloadwix-3e0e54aff605da9c5ec6c02f7e83d5e816c857a2.tar.gz
wix-3e0e54aff605da9c5ec6c02f7e83d5e816c857a2.tar.bz2
wix-3e0e54aff605da9c5ec6c02f7e83d5e816c857a2.zip
Update old test code to latest SWID tag spec
Fixes 6675
Diffstat (limited to 'src/test')
-rw-r--r--src/test/burn/TestData/PatchTests/BundlePatchA/BundlePatchA.wixproj3
-rw-r--r--src/test/burn/TestData/PatchTests/PatchA/PatchA.wixproj3
-rw-r--r--src/test/burn/TestData/Templates/Bundle.wxs2
-rw-r--r--src/test/burn/TestData/Templates/Package.wxs8
-rw-r--r--src/test/burn/WixToolsetTest.BurnE2E/PatchTests.cs13
5 files changed, 20 insertions, 9 deletions
diff --git a/src/test/burn/TestData/PatchTests/BundlePatchA/BundlePatchA.wixproj b/src/test/burn/TestData/PatchTests/BundlePatchA/BundlePatchA.wixproj
index 9b91b3f4..5eeaff59 100644
--- a/src/test/burn/TestData/PatchTests/BundlePatchA/BundlePatchA.wixproj
+++ b/src/test/burn/TestData/PatchTests/BundlePatchA/BundlePatchA.wixproj
@@ -5,6 +5,9 @@
5 <IncludeSoftwareTag>true</IncludeSoftwareTag> 5 <IncludeSoftwareTag>true</IncludeSoftwareTag>
6 <UpgradeCode>{AA083618-6280-44B8-9899-57BCC57906A5}</UpgradeCode> 6 <UpgradeCode>{AA083618-6280-44B8-9899-57BCC57906A5}</UpgradeCode>
7 </PropertyGroup> 7 </PropertyGroup>
8 <PropertyGroup>
9 <Version>1.0.1.0</Version>
10 </PropertyGroup>
8 <ItemGroup> 11 <ItemGroup>
9 <Compile Include="..\..\Templates\Bundle.wxs" Link="Bundle.wxs" /> 12 <Compile Include="..\..\Templates\Bundle.wxs" Link="Bundle.wxs" />
10 </ItemGroup> 13 </ItemGroup>
diff --git a/src/test/burn/TestData/PatchTests/PatchA/PatchA.wixproj b/src/test/burn/TestData/PatchTests/PatchA/PatchA.wixproj
index da9acb5e..6163691a 100644
--- a/src/test/burn/TestData/PatchTests/PatchA/PatchA.wixproj
+++ b/src/test/burn/TestData/PatchTests/PatchA/PatchA.wixproj
@@ -1,8 +1,7 @@
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. --> 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<Project Sdk="WixToolset.Sdk"> 2<Project Sdk="WixToolset.Sdk">
3 <PropertyGroup> 3 <PropertyGroup>
4 <OutputType>PatchCreation</OutputType> 4 <OutputType>Patch</OutputType>
5 <TargetExt>.msp</TargetExt>
6 <SuppressSpecificWarnings>1079</SuppressSpecificWarnings> 5 <SuppressSpecificWarnings>1079</SuppressSpecificWarnings>
7 </PropertyGroup> 6 </PropertyGroup>
8 <ItemGroup> 7 <ItemGroup>
diff --git a/src/test/burn/TestData/Templates/Bundle.wxs b/src/test/burn/TestData/Templates/Bundle.wxs
index c55f67a7..43974524 100644
--- a/src/test/burn/TestData/Templates/Bundle.wxs
+++ b/src/test/burn/TestData/Templates/Bundle.wxs
@@ -14,7 +14,7 @@
14 <Variable Name="TestGroupName" Value="$(var.TestGroupName)" /> 14 <Variable Name="TestGroupName" Value="$(var.TestGroupName)" />
15 15
16 <?ifdef SoftwareTag?> 16 <?ifdef SoftwareTag?>
17 <SoftwareTag Regid="regid.1995-08.com.example" InstallPath="[CommonAppDataFolder]regid.1995-08.com.example" /> 17 <SoftwareTag Regid="regid.1995-08.com.example" InstallPath="[CommonAppDataFolder]TestingSwidTags" />
18 <?endif?> 18 <?endif?>
19 19
20 <?ifndef BA?> 20 <?ifndef BA?>
diff --git a/src/test/burn/TestData/Templates/Package.wxs b/src/test/burn/TestData/Templates/Package.wxs
index c7597131..a1189fd9 100644
--- a/src/test/burn/TestData/Templates/Package.wxs
+++ b/src/test/burn/TestData/Templates/Package.wxs
@@ -20,7 +20,7 @@
20 <?endif?> 20 <?endif?>
21 21
22 <?ifdef SoftwareTag?> 22 <?ifdef SoftwareTag?>
23 <SoftwareTag Regid="regid.1995-08.com.example" InstallDirectory="CommonAppDataFolder" /> 23 <SoftwareTag Regid="regid.1995-08.com.example" InstallDirectory="SwidTagBaseFolder" />
24 <?endif?> 24 <?endif?>
25 25
26 <PropertyRef Id="TestVersion" /> 26 <PropertyRef Id="TestVersion" />
@@ -35,6 +35,12 @@
35 </Package> 35 </Package>
36 36
37 <Fragment> 37 <Fragment>
38 <?ifdef SoftwareTag?>
39 <StandardDirectory Id="CommonAppDataFolder">
40 <Directory Id="SwidTagBaseFolder" Name="TestingSwidTags" />
41 </StandardDirectory>
42 <?endif?>
43
38 <StandardDirectory Id="ProgramFiles6432Folder"> 44 <StandardDirectory Id="ProgramFiles6432Folder">
39 <Directory Id="WixDir" Name="~Test WiX"> 45 <Directory Id="WixDir" Name="~Test WiX">
40 <Directory Id="TestDir" Name="$(var.TestGroupName)"> 46 <Directory Id="TestDir" Name="$(var.TestGroupName)">
diff --git a/src/test/burn/WixToolsetTest.BurnE2E/PatchTests.cs b/src/test/burn/WixToolsetTest.BurnE2E/PatchTests.cs
index b63be5f5..b0cdea16 100644
--- a/src/test/burn/WixToolsetTest.BurnE2E/PatchTests.cs
+++ b/src/test/burn/WixToolsetTest.BurnE2E/PatchTests.cs
@@ -56,7 +56,7 @@ namespace WixToolsetTest.BurnE2E
56 packageAv1.VerifyTestRegistryRootDeleted(); 56 packageAv1.VerifyTestRegistryRootDeleted();
57 } 57 }
58 58
59 [RuntimeFact(Skip = "https://github.com/wixtoolset/issues/issues/6675")] 59 [RuntimeFact]
60 public void CanPatchSwidTag() 60 public void CanPatchSwidTag()
61 { 61 {
62 var originalVersion = "1.0.0.0"; 62 var originalVersion = "1.0.0.0";
@@ -116,8 +116,7 @@ namespace WixToolsetTest.BurnE2E
116 116
117 private static void VerifySwidTagVersion(string tagName, string expectedVersion) 117 private static void VerifySwidTagVersion(string tagName, string expectedVersion)
118 { 118 {
119 var regidFolder = Environment.ExpandEnvironmentVariables(@"%ProgramData%\regid.1995-08.com.example"); 119 var tagPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "TestingSwidTags", "swidtag", tagName + ".swidtag");
120 var tagPath = Path.Combine(regidFolder, "regid.1995-08.com.example " + tagName + ".swidtag");
121 string version = null; 120 string version = null;
122 121
123 if (File.Exists(tagPath)) 122 if (File.Exists(tagPath))
@@ -126,11 +125,15 @@ namespace WixToolsetTest.BurnE2E
126 doc.Load(tagPath); 125 doc.Load(tagPath);
127 126
128 var ns = new XmlNamespaceManager(doc.NameTable); 127 var ns = new XmlNamespaceManager(doc.NameTable);
129 ns.AddNamespace("s", "http://standards.iso.org/iso/19770/-2/2009/schema.xsd"); 128 ns.AddNamespace("s", "http://standards.iso.org/iso/19770/-2/2015/schema.xsd");
130 129
131 var versionNode = doc.SelectSingleNode("/s:software_identification_tag/s:product_version/s:name", ns); 130 var versionNode = doc.SelectSingleNode("/s:SoftwareIdentity/@version", ns);
132 version = versionNode?.InnerText ?? String.Empty; 131 version = versionNode?.InnerText ?? String.Empty;
133 } 132 }
133 else
134 {
135 Assert.True(expectedVersion == null, $"Did not find SWID tag with expected version {expectedVersion} at: {tagPath}");
136 }
134 137
135 Assert.Equal(expectedVersion, version); 138 Assert.Equal(expectedVersion, version);
136 } 139 }