From 6fc21f5c28fec195f8f6eccfed27109a4098d97f Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Fri, 27 Sep 2019 16:21:40 +1000 Subject: Add failing test for DefaultDir. --- .../MsiQueryFixture.cs | 54 ++++++++++++++++++++++ .../TestData/DefaultDir/DefaultDir.wxs | 21 +++++++++ .../ProductWithComponentGroupRef/Product.wxs | 21 +++++++++ .../WixToolsetTest.CoreIntegration.csproj | 4 +- 4 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/DefaultDir/DefaultDir.wxs create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/ProductWithComponentGroupRef/Product.wxs 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 @@ +// 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. + +namespace WixToolsetTest.CoreIntegration +{ + using System.IO; + using WixBuildTools.TestSupport; + using WixToolset.Core.TestPackage; + using Xunit; + + public class MsiQueryFixture + { + [Fact(Skip = "Test demonstrates failure")] + public void PopulatesDirectoryTableWithValidDefaultDir() + { + var folder = TestData.Get(@"TestData"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var intermediateFolder = Path.Combine(baseFolder, "obj"); + var msiPath = Path.Combine(baseFolder, @"bin\test.msi"); + + var result = WixRunner.Execute(new[] + { + "build", + Path.Combine(folder, "DefaultDir", "DefaultDir.wxs"), + Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), + "-bindpath", Path.Combine(folder, "SingleFile", "data"), + "-intermediateFolder", intermediateFolder, + "-o", msiPath + }); + + result.AssertSuccess(); + + Assert.True(File.Exists(msiPath)); + var results = Query.QueryDatabase(msiPath, new[] { "Directory" }); + Assert.Equal(new[] + { + "Directory:INSTALLFOLDER\tProgramFilesFolder\toekcr5lq|MsiPackage", + "Directory:NAMEANDSHORTNAME\tINSTALLFOLDER\tSHORTNAM|NameAndShortName", + "Directory:NAMEANDSHORTSOURCENAME\tINSTALLFOLDER\tNAMEASSN|NameAndShortSourceName", + "Directory:NAMEWITHSHORTVALUE\tINSTALLFOLDER\tSHORTVAL", + "Directory:ProgramFilesFolder\tTARGETDIR\t.", + "Directory:SHORTNAMEANDLONGSOURCENAME\tINSTALLFOLDER\tSHNALSNM:6ukthv5q|ShortNameAndLongSourceName", + "Directory:SHORTNAMEONLY\tINSTALLFOLDER\tSHORTONL", + "Directory:SOURCENAME\tINSTALLFOLDER\ts2s5bq-i|NameAndSourceName:dhnqygng|SourceNameWithName", + "Directory:SOURCENAMESONLY\tINSTALLFOLDER\t.:SRCNAMON|SourceNameOnly", + "Directory:SOURCENAMEWITHSHORTVALUE\tINSTALLFOLDER\t.:SRTSRCVL", + "Directory:TARGETDIR\t\tSourceDir", + }, results); + } + } + } +} 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 @@ + + + + + + + + + + + + + + + + + + + + + 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 @@ + + + + + + + + + + + + + + + + + + + + + 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 @@ - + @@ -13,10 +13,12 @@ + + -- cgit v1.2.3-55-g6feb