@joebigelow / wix-1 / commits / 1b266e62

Add failing tests for AppSearch tables.

Sean Hall committed Sep 30, 2019 at 09:34 UTC 1b266e62a450813718d0ff1c78f4470055adc5f3
6 files changed +191
src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs
+137
@@ -9,6 +9,143 @@ namespace WixToolsetTest.CoreIntegration
9
10 public class MsiQueryFixture
11 {
12 + [Fact(Skip = "Test demonstrates failure")]
13 + public void PopulatesAppSearchTablesFromComponentSearch()
14 + {
15 + var folder = TestData.Get(@"TestData");
16 +
17 + using (var fs = new DisposableFileSystem())
18 + {
19 + var baseFolder = fs.GetFolder();
20 + var intermediateFolder = Path.Combine(baseFolder, "obj");
21 + var msiPath = Path.Combine(baseFolder, @"bin\test.msi");
22 +
23 + var result = WixRunner.Execute(new[]
24 + {
25 + "build",
26 + Path.Combine(folder, "AppSearch", "ComponentSearch.wxs"),
27 + Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"),
28 + Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"),
29 + "-bindpath", Path.Combine(folder, "SingleFile", "data"),
30 + "-intermediateFolder", intermediateFolder,
31 + "-o", msiPath
32 + });
33 +
34 + result.AssertSuccess();
35 +
36 + Assert.True(File.Exists(msiPath));
37 + var results = Query.QueryDatabase(msiPath, new[] { "AppSearch", "CompLocator" });
38 + Assert.Equal(new[]
39 + {
40 + "AppSearch:SAMPLECOMPFOUND\tSampleCompSearch",
41 + "CompLocator:SampleCompSearch\t{4D9A0D20-D0CC-40DE-B580-EAD38B985217}\t1",
42 + }, results);
43 + }
44 + }
45 +
46 + [Fact(Skip = "Test demonstrates failure")]
47 + public void PopulatesAppSearchTablesFromDirectorySearch()
48 + {
49 + var folder = TestData.Get(@"TestData");
50 +
51 + using (var fs = new DisposableFileSystem())
52 + {
53 + var baseFolder = fs.GetFolder();
54 + var intermediateFolder = Path.Combine(baseFolder, "obj");
55 + var msiPath = Path.Combine(baseFolder, @"bin\test.msi");
56 +
57 + var result = WixRunner.Execute(new[]
58 + {
59 + "build",
60 + Path.Combine(folder, "AppSearch", "DirectorySearch.wxs"),
61 + Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"),
62 + Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"),
63 + "-bindpath", Path.Combine(folder, "SingleFile", "data"),
64 + "-intermediateFolder", intermediateFolder,
65 + "-o", msiPath
66 + });
67 +
68 + result.AssertSuccess();
69 +
70 + Assert.True(File.Exists(msiPath));
71 + var results = Query.QueryDatabase(msiPath, new[] { "AppSearch", "DrLocator" });
72 + Assert.Equal(new[]
73 + {
74 + "AppSearch:SAMPLECOMPFOUND\tSampleCompSearch",
75 + "DrLocator:SampleDirSearch\t\tC:\\SampleDir\t",
76 + }, results);
77 + }
78 + }
79 +
80 + [Fact(Skip = "Test demonstrates failure")]
81 + public void PopulatesAppSearchTablesFromFileSearch()
82 + {
83 + var folder = TestData.Get(@"TestData");
84 +
85 + using (var fs = new DisposableFileSystem())
86 + {
87 + var baseFolder = fs.GetFolder();
88 + var intermediateFolder = Path.Combine(baseFolder, "obj");
89 + var msiPath = Path.Combine(baseFolder, @"bin\test.msi");
90 +
91 + var result = WixRunner.Execute(new[]
92 + {
93 + "build",
94 + Path.Combine(folder, "AppSearch", "FileSearch.wxs"),
95 + Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"),
96 + Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"),
97 + "-bindpath", Path.Combine(folder, "SingleFile", "data"),
98 + "-intermediateFolder", intermediateFolder,
99 + "-o", msiPath
100 + });
101 +
102 + result.AssertSuccess();
103 +
104 + Assert.True(File.Exists(msiPath));
105 + var results = Query.QueryDatabase(msiPath, new[] { "AppSearch", "DrLocator", "IniLocator" });
106 + Assert.Equal(new[]
107 + {
108 + "AppSearch:SAMPLEFILEFOUND\tSampleFileSearch",
109 + "DrLocator:SampleFileSearch\tSampleIniFileSearch\t\t",
110 + "IniLocator:SampleFileSearch\tsample.fil\tMySection\tMyKey\t\t1",
111 + }, results);
112 + }
113 + }
114 +
115 + [Fact(Skip = "Test demonstrates failure")]
116 + public void PopulatesAppSearchTablesFromRegistrySearch()
117 + {
118 + var folder = TestData.Get(@"TestData");
119 +
120 + using (var fs = new DisposableFileSystem())
121 + {
122 + var baseFolder = fs.GetFolder();
123 + var intermediateFolder = Path.Combine(baseFolder, "obj");
124 + var msiPath = Path.Combine(baseFolder, @"bin\test.msi");
125 +
126 + var result = WixRunner.Execute(new[]
127 + {
128 + "build",
129 + Path.Combine(folder, "AppSearch", "RegistrySearch.wxs"),
130 + Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"),
131 + Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"),
132 + "-bindpath", Path.Combine(folder, "SingleFile", "data"),
133 + "-intermediateFolder", intermediateFolder,
134 + "-o", msiPath
135 + });
136 +
137 + result.AssertSuccess();
138 +
139 + Assert.True(File.Exists(msiPath));
140 + var results = Query.QueryDatabase(msiPath, new[] { "AppSearch", "RegLocator" });
141 + Assert.Equal(new[]
142 + {
143 + "AppSearch:SAMPLEREGFOUND\tSampleRegSearch",
144 + "RegLocator:SampleRegSearch\t2\tSampleReg\t\t2",
145 + }, results);
146 + }
147 + }
148 +
149 [Fact(Skip = "Test demonstrates failure")]
150 public void PopulatesDirectoryTableWithValidDefaultDir()
151 {
src/test/WixToolsetTest.CoreIntegration/TestData/AppSearch/ComponentSearch.wxs new
+12
@@ -0,0 +1,12 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
3 + <Fragment>
4 + <ComponentGroup Id="ProductComponents">
5 + <ComponentGroupRef Id="MinimalComponentGroup"></ComponentGroupRef>
6 + </ComponentGroup>
7 +
8 + <Property Id="SAMPLECOMPFOUND">
9 + <ComponentSearch Id="SampleCompSearch" Guid="{4D9A0D20-D0CC-40DE-B580-EAD38B985217}"></ComponentSearch>
10 + </Property>
11 + </Fragment>
12 +</Wix>
src/test/WixToolsetTest.CoreIntegration/TestData/AppSearch/DirectorySearch.wxs new
+12
@@ -0,0 +1,12 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
3 + <Fragment>
4 + <ComponentGroup Id="ProductComponents">
5 + <ComponentGroupRef Id="MinimalComponentGroup"></ComponentGroupRef>
6 + </ComponentGroup>
7 +
8 + <Property Id="SAMPLEDIRFOUND">
9 + <DirectorySearch Id="SampleDirSearch" AssignToProperty="yes" Path="C:\SampleDir"></DirectorySearch>
10 + </Property>
11 + </Fragment>
12 +</Wix>
src/test/WixToolsetTest.CoreIntegration/TestData/AppSearch/FileSearch.wxs new
+14
@@ -0,0 +1,14 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
3 + <Fragment>
4 + <ComponentGroup Id="ProductComponents">
5 + <ComponentGroupRef Id="MinimalComponentGroup"></ComponentGroupRef>
6 + </ComponentGroup>
7 +
8 + <Property Id="SAMPLEFILEFOUND">
9 + <IniFileSearch Id="SampleIniFileSearch" Name="sample.fil" Section="MySection" Key="MyKey">
10 + <FileSearch Id="SampleFileSearch" Name="sample.fil"></FileSearch>
11 + </IniFileSearch>
12 + </Property>
13 + </Fragment>
14 +</Wix>
src/test/WixToolsetTest.CoreIntegration/TestData/AppSearch/RegistrySearch.wxs new
+12
@@ -0,0 +1,12 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
3 + <Fragment>
4 + <ComponentGroup Id="ProductComponents">
5 + <ComponentGroupRef Id="MinimalComponentGroup"></ComponentGroupRef>
6 + </ComponentGroup>
7 +
8 + <Property Id="SAMPLEREGFOUND">
9 + <RegistrySearch Id="SampleRegSearch" Root="HKLM" Key="SampleReg" Type="raw"></RegistrySearch>
10 + </Property>
11 + </Fragment>
12 +</Wix>
src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj
+4
@@ -13,6 +13,10 @@
13 </PropertyGroup>
14
15 <ItemGroup>
16 + <Content Include="TestData\AppSearch\ComponentSearch.wxs" CopyToOutputDirectory="PreserveNewest" />
17 + <Content Include="TestData\AppSearch\DirectorySearch.wxs" CopyToOutputDirectory="PreserveNewest" />
18 + <Content Include="TestData\AppSearch\FileSearch.wxs" CopyToOutputDirectory="PreserveNewest" />
19 + <Content Include="TestData\AppSearch\RegistrySearch.wxs" CopyToOutputDirectory="PreserveNewest" />
20 <Content Include="TestData\DefaultDir\DefaultDir.wxs" CopyToOutputDirectory="PreserveNewest" />
21 <Content Include="TestData\DialogsInInstallUISequence\data\test.txt" CopyToOutputDirectory="PreserveNewest" />
22 <Content Include="TestData\DialogsInInstallUISequence\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" />