diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2019-09-27 16:21:40 +1000 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2019-09-30 13:14:35 +1000 |
commit | 6fc21f5c28fec195f8f6eccfed27109a4098d97f (patch) | |
tree | 578634161c6be71f389082998d977f906d27bee4 /src/test | |
parent | a6be2d64ff43f0ddd81f448dd889b4458bd734b0 (diff) | |
download | wix-6fc21f5c28fec195f8f6eccfed27109a4098d97f.tar.gz wix-6fc21f5c28fec195f8f6eccfed27109a4098d97f.tar.bz2 wix-6fc21f5c28fec195f8f6eccfed27109a4098d97f.zip |
Add failing test for DefaultDir.
Diffstat (limited to 'src/test')
4 files changed, 99 insertions, 1 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs new file mode 100644 index 00000000..82934b9a --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs | |||
@@ -0,0 +1,54 @@ | |||
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 | |||
3 | namespace WixToolsetTest.CoreIntegration | ||
4 | { | ||
5 | using System.IO; | ||
6 | using WixBuildTools.TestSupport; | ||
7 | using WixToolset.Core.TestPackage; | ||
8 | using Xunit; | ||
9 | |||
10 | public class MsiQueryFixture | ||
11 | { | ||
12 | [Fact(Skip = "Test demonstrates failure")] | ||
13 | public void PopulatesDirectoryTableWithValidDefaultDir() | ||
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, "DefaultDir", "DefaultDir.wxs"), | ||
27 | Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), | ||
28 | "-bindpath", Path.Combine(folder, "SingleFile", "data"), | ||
29 | "-intermediateFolder", intermediateFolder, | ||
30 | "-o", msiPath | ||
31 | }); | ||
32 | |||
33 | result.AssertSuccess(); | ||
34 | |||
35 | Assert.True(File.Exists(msiPath)); | ||
36 | var results = Query.QueryDatabase(msiPath, new[] { "Directory" }); | ||
37 | Assert.Equal(new[] | ||
38 | { | ||
39 | "Directory:INSTALLFOLDER\tProgramFilesFolder\toekcr5lq|MsiPackage", | ||
40 | "Directory:NAMEANDSHORTNAME\tINSTALLFOLDER\tSHORTNAM|NameAndShortName", | ||
41 | "Directory:NAMEANDSHORTSOURCENAME\tINSTALLFOLDER\tNAMEASSN|NameAndShortSourceName", | ||
42 | "Directory:NAMEWITHSHORTVALUE\tINSTALLFOLDER\tSHORTVAL", | ||
43 | "Directory:ProgramFilesFolder\tTARGETDIR\t.", | ||
44 | "Directory:SHORTNAMEANDLONGSOURCENAME\tINSTALLFOLDER\tSHNALSNM:6ukthv5q|ShortNameAndLongSourceName", | ||
45 | "Directory:SHORTNAMEONLY\tINSTALLFOLDER\tSHORTONL", | ||
46 | "Directory:SOURCENAME\tINSTALLFOLDER\ts2s5bq-i|NameAndSourceName:dhnqygng|SourceNameWithName", | ||
47 | "Directory:SOURCENAMESONLY\tINSTALLFOLDER\t.:SRCNAMON|SourceNameOnly", | ||
48 | "Directory:SOURCENAMEWITHSHORTVALUE\tINSTALLFOLDER\t.:SRTSRCVL", | ||
49 | "Directory:TARGETDIR\t\tSourceDir", | ||
50 | }, results); | ||
51 | } | ||
52 | } | ||
53 | } | ||
54 | } | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/DefaultDir/DefaultDir.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/DefaultDir/DefaultDir.wxs new file mode 100644 index 00000000..aeb3d554 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/DefaultDir/DefaultDir.wxs | |||
@@ -0,0 +1,21 @@ | |||
1 | <?xml version="1.0" encoding="utf-8" ?> | ||
2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
3 | <Fragment> | ||
4 | <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> | ||
5 | <Component> | ||
6 | <File Source="test.txt" /> | ||
7 | </Component> | ||
8 | </ComponentGroup> | ||
9 | |||
10 | <DirectoryRef Id="INSTALLFOLDER"> | ||
11 | <Directory Id="NAMEWITHSHORTVALUE" Name="SHORTVAL"></Directory> | ||
12 | <Directory Id="NAMEANDSHORTNAME" Name="NameAndShortName" ShortName="SHORTNAM"></Directory> | ||
13 | <Directory Id="SHORTNAMEONLY" Name="SHORTONL"></Directory> | ||
14 | <Directory Id="SOURCENAME" Name="NameAndSourceName" SourceName="SourceNameWithName"></Directory> | ||
15 | <Directory Id="SOURCENAMESONLY" SourceName="SourceNameOnly" ShortSourceName="SRCNAMON"></Directory> | ||
16 | <Directory Id="NAMEANDSHORTSOURCENAME" Name="NameAndShortSourceName" ShortName="NAMEASSN"></Directory> | ||
17 | <Directory Id="SHORTNAMEANDLONGSOURCENAME" SourceName="ShortNameAndLongSourceName" Name="SHNALSNM"></Directory> | ||
18 | <Directory Id="SOURCENAMEWITHSHORTVALUE" SourceName="SRTSRCVL"></Directory> | ||
19 | </DirectoryRef> | ||
20 | </Fragment> | ||
21 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/ProductWithComponentGroupRef/Product.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/ProductWithComponentGroupRef/Product.wxs new file mode 100644 index 00000000..0d1e89e6 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/ProductWithComponentGroupRef/Product.wxs | |||
@@ -0,0 +1,21 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
3 | <Product Id="*" Name="MsiPackage" Codepage="1252" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="12E4699F-E774-4D05-8A01-5BDD41BBA127"> | ||
4 | <Package InstallerVersion="500" Compressed="no" InstallScope="perMachine" /> | ||
5 | |||
6 | <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> | ||
7 | <MediaTemplate /> | ||
8 | |||
9 | <Feature Id="ProductFeature" Title="MsiPackageTitle"> | ||
10 | <ComponentGroupRef Id="ProductComponents" /> | ||
11 | </Feature> | ||
12 | </Product> | ||
13 | |||
14 | <Fragment> | ||
15 | <Directory Id="TARGETDIR" Name="SourceDir"> | ||
16 | <Directory Id="ProgramFilesFolder"> | ||
17 | <Directory Id="INSTALLFOLDER" Name="MsiPackage" /> | ||
18 | </Directory> | ||
19 | </Directory> | ||
20 | </Fragment> | ||
21 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj index 03f67b19..8e7f1b8f 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj +++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj | |||
@@ -1,4 +1,4 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <!-- 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 | <!-- 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. --> |
3 | 3 | ||
4 | <Project Sdk="Microsoft.NET.Sdk"> | 4 | <Project Sdk="Microsoft.NET.Sdk"> |
@@ -13,10 +13,12 @@ | |||
13 | </PropertyGroup> | 13 | </PropertyGroup> |
14 | 14 | ||
15 | <ItemGroup> | 15 | <ItemGroup> |
16 | <Content Include="TestData\DefaultDir\DefaultDir.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
16 | <Content Include="TestData\DialogsInInstallUISequence\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> | 17 | <Content Include="TestData\DialogsInInstallUISequence\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> |
17 | <Content Include="TestData\DialogsInInstallUISequence\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | 18 | <Content Include="TestData\DialogsInInstallUISequence\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> |
18 | <Content Include="TestData\DialogsInInstallUISequence\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | 19 | <Content Include="TestData\DialogsInInstallUISequence\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> |
19 | <Content Include="TestData\DialogsInInstallUISequence\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | 20 | <Content Include="TestData\DialogsInInstallUISequence\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> |
21 | <Content Include="TestData\ProductWithComponentGroupRef\Product.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
20 | <Content Include="TestData\SimpleModule\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> | 22 | <Content Include="TestData\SimpleModule\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> |
21 | <Content Include="TestData\SimpleModule\Module.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | 23 | <Content Include="TestData\SimpleModule\Module.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> |
22 | <Content Include="TestData\SimpleModule\Module.wxs" CopyToOutputDirectory="PreserveNewest" /> | 24 | <Content Include="TestData\SimpleModule\Module.wxs" CopyToOutputDirectory="PreserveNewest" /> |