aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2019-11-08 14:46:30 +1000
committerSean Hall <r.sean.hall@gmail.com>2019-11-08 14:53:03 +1000
commit8a7d727f1ab0dfef956db726d64985311291505e (patch)
treeaf08fe98b7a94e435e0061034487d5c1584bc4ae /src
parente03595bdca426a03ad740e4c312f028f97f465ec (diff)
downloadwix-8a7d727f1ab0dfef956db726d64985311291505e.tar.gz
wix-8a7d727f1ab0dfef956db726d64985311291505e.tar.bz2
wix-8a7d727f1ab0dfef956db726d64985311291505e.zip
Add failing test for getting Shortcut/@Name from wixlib.
Diffstat (limited to 'src')
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs3
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/TestData/Shortcut/ShortcutProperty.wxs2
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs30
3 files changed, 33 insertions, 2 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs
index 3c20e997..2be582c9 100644
--- a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs
+++ b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs
@@ -672,10 +672,11 @@ namespace WixToolsetTest.CoreIntegration
672 result.AssertSuccess(); 672 result.AssertSuccess();
673 673
674 Assert.True(File.Exists(msiPath)); 674 Assert.True(File.Exists(msiPath));
675 var results = Query.QueryDatabase(msiPath, new[] { "MsiShortcutProperty" }); 675 var results = Query.QueryDatabase(msiPath, new[] { "MsiShortcutProperty", "Shortcut" });
676 Assert.Equal(new[] 676 Assert.Equal(new[]
677 { 677 {
678 "MsiShortcutProperty:scp4GOCIx4Eskci4nBG1MV_vSUOZt4\tTheShortcut\tCustomShortcutKey\tCustomShortcutValue", 678 "MsiShortcutProperty:scp4GOCIx4Eskci4nBG1MV_vSUOZt4\tTheShortcut\tCustomShortcutKey\tCustomShortcutValue",
679 "Shortcut:TheShortcut\tINSTALLFOLDER\td|\tShortcutComp\t[#filcV1yrx0x8wJWj4qMzcH21jwkPko]\t\t\t\t\t\t\t\t\t\t\t",
679 }, results); 680 }, results);
680 } 681 }
681 } 682 }
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/Shortcut/ShortcutProperty.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/Shortcut/ShortcutProperty.wxs
index d0a041b8..27f2ab9b 100644
--- a/src/test/WixToolsetTest.CoreIntegration/TestData/Shortcut/ShortcutProperty.wxs
+++ b/src/test/WixToolsetTest.CoreIntegration/TestData/Shortcut/ShortcutProperty.wxs
@@ -4,7 +4,7 @@
4 <ComponentGroup Id="ProductComponents"> 4 <ComponentGroup Id="ProductComponents">
5 <Component Id="ShortcutComp" Directory="INSTALLFOLDER" Guid="5B3B3FC1-533D-4C29-BFB3-0E88B51E59D8"> 5 <Component Id="ShortcutComp" Directory="INSTALLFOLDER" Guid="5B3B3FC1-533D-4C29-BFB3-0E88B51E59D8">
6 <File Source="test.txt"> 6 <File Source="test.txt">
7 <Shortcut Id="TheShortcut" Name="TestShortcut" Directory="INSTALLFOLDER"> 7 <Shortcut Id="TheShortcut" Name="d" Directory="INSTALLFOLDER">
8 <ShortcutProperty Key="CustomShortcutKey" Value="CustomShortcutValue"></ShortcutProperty> 8 <ShortcutProperty Key="CustomShortcutKey" Value="CustomShortcutValue"></ShortcutProperty>
9 </Shortcut> 9 </Shortcut>
10 </File> 10 </File>
diff --git a/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs
index 7f9b9686..53bc5910 100644
--- a/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs
+++ b/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs
@@ -12,6 +12,36 @@ namespace WixToolsetTest.CoreIntegration
12 12
13 public class WixlibQueryFixture 13 public class WixlibQueryFixture
14 { 14 {
15 [Fact(Skip = "Test demonstrates failure")]
16 public void ShortcutNameWithPreprocessorVariableIsResolved()
17 {
18 var folder = TestData.Get(@"TestData\Shortcut");
19
20 using (var fs = new DisposableFileSystem())
21 {
22 var baseFolder = fs.GetFolder();
23 var intermediateFolder = Path.Combine(baseFolder, "obj");
24 var wixlibPath = Path.Combine(intermediateFolder, @"test.wixlib");
25
26 var result = WixRunner.Execute(new[]
27 {
28 "build",
29 Path.Combine(folder, "ShortcutProperty.wxs"),
30 "-intermediateFolder", intermediateFolder,
31 "-o", wixlibPath
32 });
33
34 result.AssertSuccess();
35
36 var intermediate = Intermediate.Load(wixlibPath);
37 var allTuples = intermediate.Sections.SelectMany(s => s.Tuples);
38 var shortcutTuple = allTuples.OfType<ShortcutTuple>()
39 .SingleOrDefault();
40 Assert.NotNull(shortcutTuple);
41 Assert.Equal("d", shortcutTuple.Name);
42 }
43 }
44
15 [Fact] 45 [Fact]
16 public void UpgradeProducesReferenceToRemoveExistingProducts() 46 public void UpgradeProducesReferenceToRemoveExistingProducts()
17 { 47 {