@joebigelow / wix-1 / commits / 6fc21f5c

Add failing test for DefaultDir.

Sean Hall committed Sep 27, 2019 at 16:21 UTC 6fc21f5c28fec195f8f6eccfed27109a4098d97f
4 files changed +99 -1
src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs new
+54
@@ -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 +}
src/test/WixToolsetTest.CoreIntegration/TestData/DefaultDir/DefaultDir.wxs new
+21
@@ -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>
src/test/WixToolsetTest.CoreIntegration/TestData/ProductWithComponentGroupRef/Product.wxs new
+21
@@ -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>
src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj
+3 -1
@@ -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. -->
3
4 <Project Sdk="Microsoft.NET.Sdk">
@@ -13,10 +13,12 @@
13 </PropertyGroup>
14
15 <ItemGroup>
16 + <Content Include="TestData\DefaultDir\DefaultDir.wxs" CopyToOutputDirectory="PreserveNewest" />
17 <Content Include="TestData\DialogsInInstallUISequence\data\test.txt" CopyToOutputDirectory="PreserveNewest" />
18 <Content Include="TestData\DialogsInInstallUISequence\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" />
19 <Content Include="TestData\DialogsInInstallUISequence\Package.wxs" CopyToOutputDirectory="PreserveNewest" />
20 <Content Include="TestData\DialogsInInstallUISequence\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" />
21 + <Content Include="TestData\ProductWithComponentGroupRef\Product.wxs" CopyToOutputDirectory="PreserveNewest" />
22 <Content Include="TestData\SimpleModule\data\test.txt" CopyToOutputDirectory="PreserveNewest" />
23 <Content Include="TestData\SimpleModule\Module.en-us.wxl" CopyToOutputDirectory="PreserveNewest" />
24 <Content Include="TestData\SimpleModule\Module.wxs" CopyToOutputDirectory="PreserveNewest" />