aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2019-09-30 09:34:40 +1000
committerSean Hall <r.sean.hall@gmail.com>2019-09-30 13:14:35 +1000
commit1b266e62a450813718d0ff1c78f4470055adc5f3 (patch)
tree6b7567f7e395c2c32dba16c824b50c485645fe35 /src/test
parent3ad41f4926fddf4776c8de1baf5284c0d2f51077 (diff)
downloadwix-1b266e62a450813718d0ff1c78f4470055adc5f3.tar.gz
wix-1b266e62a450813718d0ff1c78f4470055adc5f3.tar.bz2
wix-1b266e62a450813718d0ff1c78f4470055adc5f3.zip
Add failing tests for AppSearch tables.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs137
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/TestData/AppSearch/ComponentSearch.wxs12
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/TestData/AppSearch/DirectorySearch.wxs12
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/TestData/AppSearch/FileSearch.wxs14
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/TestData/AppSearch/RegistrySearch.wxs12
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj4
6 files changed, 191 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs
index 7c53d72f..e7443f35 100644
--- a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs
+++ b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs
@@ -10,6 +10,143 @@ namespace WixToolsetTest.CoreIntegration
10 public class MsiQueryFixture 10 public class MsiQueryFixture
11 { 11 {
12 [Fact(Skip = "Test demonstrates failure")] 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")]
13 public void PopulatesDirectoryTableWithValidDefaultDir() 150 public void PopulatesDirectoryTableWithValidDefaultDir()
14 { 151 {
15 var folder = TestData.Get(@"TestData"); 152 var folder = TestData.Get(@"TestData");
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/AppSearch/ComponentSearch.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/AppSearch/ComponentSearch.wxs
new file mode 100644
index 00000000..4dd701f0
--- /dev/null
+++ b/src/test/WixToolsetTest.CoreIntegration/TestData/AppSearch/ComponentSearch.wxs
@@ -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>
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/AppSearch/DirectorySearch.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/AppSearch/DirectorySearch.wxs
new file mode 100644
index 00000000..e255c83d
--- /dev/null
+++ b/src/test/WixToolsetTest.CoreIntegration/TestData/AppSearch/DirectorySearch.wxs
@@ -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>
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/AppSearch/FileSearch.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/AppSearch/FileSearch.wxs
new file mode 100644
index 00000000..c17d9848
--- /dev/null
+++ b/src/test/WixToolsetTest.CoreIntegration/TestData/AppSearch/FileSearch.wxs
@@ -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>
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/AppSearch/RegistrySearch.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/AppSearch/RegistrySearch.wxs
new file mode 100644
index 00000000..f800264d
--- /dev/null
+++ b/src/test/WixToolsetTest.CoreIntegration/TestData/AppSearch/RegistrySearch.wxs
@@ -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>
diff --git a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj
index e4da8b14..16f200c3 100644
--- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj
+++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj
@@ -13,6 +13,10 @@
13 </PropertyGroup> 13 </PropertyGroup>
14 14
15 <ItemGroup> 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" />
16 <Content Include="TestData\DefaultDir\DefaultDir.wxs" CopyToOutputDirectory="PreserveNewest" /> 20 <Content Include="TestData\DefaultDir\DefaultDir.wxs" CopyToOutputDirectory="PreserveNewest" />
17 <Content Include="TestData\DialogsInInstallUISequence\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> 21 <Content Include="TestData\DialogsInInstallUISequence\data\test.txt" CopyToOutputDirectory="PreserveNewest" />
18 <Content Include="TestData\DialogsInInstallUISequence\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> 22 <Content Include="TestData\DialogsInInstallUISequence\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" />