diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2019-01-12 16:49:42 -0600 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2019-01-12 16:58:52 -0600 |
commit | 2a14c230453744ea896948ca0b4f6692f2962bee (patch) | |
tree | 08227b815bb5ce8e5140f902305d921917fca95d /src/test | |
parent | 9d5d059a2147aa0fe38f7103148c020b66455e83 (diff) | |
download | wix-2a14c230453744ea896948ca0b4f6692f2962bee.tar.gz wix-2a14c230453744ea896948ca0b4f6692f2962bee.tar.bz2 wix-2a14c230453744ea896948ca0b4f6692f2962bee.zip |
Integrate into latest v4.
Diffstat (limited to 'src/test')
6 files changed, 116 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.UI/TestData/WixUI_Minimal/Package.en-us.wxl b/src/test/WixToolsetTest.UI/TestData/WixUI_Minimal/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/test/WixToolsetTest.UI/TestData/WixUI_Minimal/Package.en-us.wxl | |||
@@ -0,0 +1,11 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | |||
3 | <!-- | ||
4 | This file contains the declaration of all the localizable strings. | ||
5 | --> | ||
6 | <WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl" Culture="en-US"> | ||
7 | |||
8 | <String Id="DowngradeError">A newer version of [ProductName] is already installed.</String> | ||
9 | <String Id="FeatureTitle">MsiPackage</String> | ||
10 | |||
11 | </WixLocalization> | ||
diff --git a/src/test/WixToolsetTest.UI/TestData/WixUI_Minimal/Package.wxs b/src/test/WixToolsetTest.UI/TestData/WixUI_Minimal/Package.wxs new file mode 100644 index 00000000..68ff98fd --- /dev/null +++ b/src/test/WixToolsetTest.UI/TestData/WixUI_Minimal/Package.wxs | |||
@@ -0,0 +1,22 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
3 | <Product Id="*" Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a"> | ||
4 | <Package InstallerVersion="200" Compressed="no" InstallScope="perMachine" /> | ||
5 | |||
6 | <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" /> | ||
7 | <MediaTemplate /> | ||
8 | |||
9 | <Feature Id="ProductFeature" Title="!(loc.FeatureTitle)"> | ||
10 | <ComponentGroupRef Id="ProductComponents" /> | ||
11 | </Feature> | ||
12 | |||
13 | </Product> | ||
14 | |||
15 | <Fragment> | ||
16 | <Directory Id="TARGETDIR" Name="SourceDir"> | ||
17 | <Directory Id="ProgramFilesFolder"> | ||
18 | <Directory Id="INSTALLFOLDER" Name="MsiPackage" /> | ||
19 | </Directory> | ||
20 | </Directory> | ||
21 | </Fragment> | ||
22 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.UI/TestData/WixUI_Minimal/PackageComponents.wxs b/src/test/WixToolsetTest.UI/TestData/WixUI_Minimal/PackageComponents.wxs new file mode 100644 index 00000000..c50785a1 --- /dev/null +++ b/src/test/WixToolsetTest.UI/TestData/WixUI_Minimal/PackageComponents.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 | <UIRef Id="WixUI_Minimal" /> | ||
5 | |||
6 | <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> | ||
7 | <Component> | ||
8 | <File Source="example.txt" /> | ||
9 | </Component> | ||
10 | </ComponentGroup> | ||
11 | </Fragment> | ||
12 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.UI/TestData/WixUI_Minimal/example.txt b/src/test/WixToolsetTest.UI/TestData/WixUI_Minimal/example.txt new file mode 100644 index 00000000..1b4ffe8a --- /dev/null +++ b/src/test/WixToolsetTest.UI/TestData/WixUI_Minimal/example.txt | |||
@@ -0,0 +1 @@ | |||
This is example.txt. \ No newline at end of file | |||
diff --git a/src/test/WixToolsetTest.UI/UIExtensionFixture.cs b/src/test/WixToolsetTest.UI/UIExtensionFixture.cs new file mode 100644 index 00000000..43694c49 --- /dev/null +++ b/src/test/WixToolsetTest.UI/UIExtensionFixture.cs | |||
@@ -0,0 +1,32 @@ | |||
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.UI | ||
4 | { | ||
5 | using System.Linq; | ||
6 | using WixBuildTools.TestSupport; | ||
7 | using WixToolset.Core.TestPackage; | ||
8 | using WixToolset.UI; | ||
9 | using Xunit; | ||
10 | |||
11 | public class UIExtensionFixture | ||
12 | { | ||
13 | [Fact(Skip = "Currently fails")] | ||
14 | public void CanBuildUsingWixUIMinimal() | ||
15 | { | ||
16 | var folder = TestData.Get(@"TestData\WixUI_Minimal"); | ||
17 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { folder }); | ||
18 | |||
19 | var results = build.BuildAndQuery(Build, "Property"); | ||
20 | Assert.Equal(new[] | ||
21 | { | ||
22 | "Property:", | ||
23 | }, results.OrderBy(s => s).ToArray()); | ||
24 | } | ||
25 | |||
26 | private static void Build(string[] args) | ||
27 | { | ||
28 | var result = WixRunner.Execute(args) | ||
29 | .AssertSuccess(); | ||
30 | } | ||
31 | } | ||
32 | } | ||
diff --git a/src/test/WixToolsetTest.UI/WixToolsetTest.UI.csproj b/src/test/WixToolsetTest.UI/WixToolsetTest.UI.csproj new file mode 100644 index 00000000..4a3ba5e7 --- /dev/null +++ b/src/test/WixToolsetTest.UI/WixToolsetTest.UI.csproj | |||
@@ -0,0 +1,38 @@ | |||
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"> | ||
5 | <PropertyGroup> | ||
6 | <TargetFramework>netcoreapp2.1</TargetFramework> | ||
7 | <IsPackable>false</IsPackable> | ||
8 | </PropertyGroup> | ||
9 | |||
10 | <PropertyGroup> | ||
11 | <NoWarn>NU1701</NoWarn> | ||
12 | </PropertyGroup> | ||
13 | |||
14 | <ItemGroup> | ||
15 | <Content Include="TestData\WixUI_Minimal\example.txt" CopyToOutputDirectory="PreserveNewest" /> | ||
16 | <Content Include="TestData\WixUI_Minimal\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | ||
17 | <Content Include="TestData\WixUI_Minimal\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
18 | <Content Include="TestData\WixUI_Minimal\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
19 | </ItemGroup> | ||
20 | |||
21 | <ItemGroup> | ||
22 | <ProjectReference Include="..\..\wixext\WixToolset.UI.wixext.csproj" /> | ||
23 | </ItemGroup> | ||
24 | |||
25 | <ItemGroup> | ||
26 | <PackageReference Include="WixToolset.Core.TestPackage" Version="4.0.*" PrivateAssets="all" /> | ||
27 | </ItemGroup> | ||
28 | |||
29 | <ItemGroup> | ||
30 | <PackageReference Include="WixBuildTools.TestSupport" Version="4.0.*" /> | ||
31 | </ItemGroup> | ||
32 | |||
33 | <ItemGroup> | ||
34 | <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" /> | ||
35 | <PackageReference Include="xunit" Version="2.4.0" /> | ||
36 | <PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" /> | ||
37 | </ItemGroup> | ||
38 | </Project> | ||