diff options
Diffstat (limited to 'src/test')
7 files changed, 204 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs b/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs index 3515b314..cd9ef9fc 100644 --- a/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs +++ b/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs | |||
@@ -49,6 +49,41 @@ namespace WixToolsetTest.MSBuild | |||
49 | [Theory] | 49 | [Theory] |
50 | [InlineData(BuildSystem.MSBuild)] | 50 | [InlineData(BuildSystem.MSBuild)] |
51 | [InlineData(BuildSystem.MSBuild64)] | 51 | [InlineData(BuildSystem.MSBuild64)] |
52 | public void CanBuildSimpleMergeModule(BuildSystem buildSystem) | ||
53 | { | ||
54 | var sourceFolder = TestData.Get(@"TestData\MergeModule\SimpleMergeModule"); | ||
55 | |||
56 | using (var fs = new TestDataFolderFileSystem()) | ||
57 | { | ||
58 | fs.Initialize(sourceFolder); | ||
59 | var baseFolder = fs.BaseFolder; | ||
60 | var binFolder = Path.Combine(baseFolder, @"bin\"); | ||
61 | var projectPath = Path.Combine(baseFolder, "SimpleMergeModule.wixproj"); | ||
62 | |||
63 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); | ||
64 | result.AssertSuccess(); | ||
65 | |||
66 | var platformSwitches = result.Output.Where(line => line.TrimStart().StartsWith("wix.exe build -platform x86")); | ||
67 | Assert.Single(platformSwitches); | ||
68 | |||
69 | var warnings = result.Output.Where(line => line.Contains(": warning")); | ||
70 | Assert.Empty(warnings); | ||
71 | |||
72 | var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) | ||
73 | .Select(s => s.Substring(baseFolder.Length + 1)) | ||
74 | .OrderBy(s => s) | ||
75 | .ToArray(); | ||
76 | Assert.Equal(new[] | ||
77 | { | ||
78 | @"bin\x86\Debug\SimpleMergeModule.msm", | ||
79 | @"bin\x86\Debug\SimpleMergeModule.wixpdb", | ||
80 | }, paths); | ||
81 | } | ||
82 | } | ||
83 | |||
84 | [Theory] | ||
85 | [InlineData(BuildSystem.MSBuild)] | ||
86 | [InlineData(BuildSystem.MSBuild64)] | ||
52 | public void CanBuildSimpleMsiPackage(BuildSystem buildSystem) | 87 | public void CanBuildSimpleMsiPackage(BuildSystem buildSystem) |
53 | { | 88 | { |
54 | var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); | 89 | var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); |
@@ -85,6 +120,39 @@ namespace WixToolsetTest.MSBuild | |||
85 | [Theory] | 120 | [Theory] |
86 | [InlineData(BuildSystem.MSBuild)] | 121 | [InlineData(BuildSystem.MSBuild)] |
87 | [InlineData(BuildSystem.MSBuild64)] | 122 | [InlineData(BuildSystem.MSBuild64)] |
123 | public void CanBuildSimpleMsiPackageWithMergeModule(BuildSystem buildSystem) | ||
124 | { | ||
125 | var sourceFolder = TestData.Get(@"TestData\MergeModule"); | ||
126 | |||
127 | using (var fs = new TestDataFolderFileSystem()) | ||
128 | { | ||
129 | fs.Initialize(sourceFolder); | ||
130 | var baseFolder = Path.Combine(fs.BaseFolder, "MergeMsiPackage"); | ||
131 | var binFolder = Path.Combine(baseFolder, @"bin\"); | ||
132 | var projectPath = Path.Combine(baseFolder, "MergeMsiPackage.wixproj"); | ||
133 | |||
134 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); | ||
135 | result.AssertSuccess(); | ||
136 | |||
137 | var warnings = result.Output.Where(line => line.Contains(": warning")); | ||
138 | Assert.Empty(warnings); | ||
139 | |||
140 | var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) | ||
141 | .Select(s => s.Substring(baseFolder.Length + 1)) | ||
142 | .OrderBy(s => s) | ||
143 | .ToArray(); | ||
144 | Assert.Equal(new[] | ||
145 | { | ||
146 | @"bin\x86\Debug\cab1.cab", | ||
147 | @"bin\x86\Debug\MergeMsiPackage.msi", | ||
148 | @"bin\x86\Debug\MergeMsiPackage.wixpdb", | ||
149 | }, paths); | ||
150 | } | ||
151 | } | ||
152 | |||
153 | [Theory] | ||
154 | [InlineData(BuildSystem.MSBuild)] | ||
155 | [InlineData(BuildSystem.MSBuild64)] | ||
88 | public void CanBuildWithDefaultAndExplicitlyFullWixpdbs(BuildSystem buildSystem) | 156 | public void CanBuildWithDefaultAndExplicitlyFullWixpdbs(BuildSystem buildSystem) |
89 | { | 157 | { |
90 | var expectedOutputs = new[] | 158 | var expectedOutputs = new[] |
diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/MergeMsiPackage/MergeMsiPackage.wixproj b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/MergeMsiPackage/MergeMsiPackage.wixproj new file mode 100644 index 00000000..77ee4420 --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/MergeMsiPackage/MergeMsiPackage.wixproj | |||
@@ -0,0 +1,44 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
3 | <Import Project="$(WixMSBuildProps)" /> | ||
4 | <PropertyGroup> | ||
5 | <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
6 | <Platform Condition=" '$(Platform)' == '' ">x86</Platform> | ||
7 | </PropertyGroup> | ||
8 | |||
9 | <PropertyGroup> | ||
10 | <ProjectGuid>{B00939D5-7952-4ADF-BEB1-507D227B2FE2}</ProjectGuid> | ||
11 | </PropertyGroup> | ||
12 | |||
13 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> | ||
14 | <PlatformName>$(Platform)</PlatformName> | ||
15 | <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath> | ||
16 | <DefineConstants>Debug</DefineConstants> | ||
17 | </PropertyGroup> | ||
18 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> | ||
19 | <PlatformName>$(Platform)</PlatformName> | ||
20 | <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath> | ||
21 | </PropertyGroup> | ||
22 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> | ||
23 | <PlatformName>$(Platform)</PlatformName> | ||
24 | <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath> | ||
25 | <DefineConstants>Debug</DefineConstants> | ||
26 | </PropertyGroup> | ||
27 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> | ||
28 | <PlatformName>$(Platform)</PlatformName> | ||
29 | <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath> | ||
30 | </PropertyGroup> | ||
31 | |||
32 | <ItemGroup> | ||
33 | <Compile Include="Package.wxs" /> | ||
34 | </ItemGroup> | ||
35 | |||
36 | <ItemGroup> | ||
37 | <ProjectReference Include="..\SimpleMergeModule\SimpleMergeModule.wixproj"> | ||
38 | <Name>SimpleMergeModule</Name> | ||
39 | <Project>{9F84998B-7F45-4CB3-8795-915801DBBB74}</Project> | ||
40 | </ProjectReference> | ||
41 | </ItemGroup> | ||
42 | |||
43 | <Import Project="$(WixTargetsPath)" /> | ||
44 | </Project> \ No newline at end of file | ||
diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/MergeMsiPackage/Package.wxs b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/MergeMsiPackage/Package.wxs new file mode 100644 index 00000000..1c25e684 --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/MergeMsiPackage/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="yes" InstallScope="perMachine" /> | ||
5 | |||
6 | <MediaTemplate /> | ||
7 | |||
8 | <Feature Id="ProductFeature" Title="ATitle"> | ||
9 | <MergeRef Id="SimpleMM" /> | ||
10 | </Feature> | ||
11 | </Product> | ||
12 | |||
13 | <Fragment> | ||
14 | <Directory Id="TARGETDIR" Name="SourceDir"> | ||
15 | <Directory Id="ProgramFilesFolder"> | ||
16 | <Directory Id="INSTALLFOLDER" Name="MsiPackage"> | ||
17 | <Merge Id="SimpleMM" Language="1033" SourceFile="$(var.SimpleMergeModule.TargetPath)" DiskId="1" /> | ||
18 | </Directory> | ||
19 | </Directory> | ||
20 | </Directory> | ||
21 | </Fragment> | ||
22 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs new file mode 100644 index 00000000..b9ab953a --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs | |||
@@ -0,0 +1,22 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
3 | <Module Id="SimpleMM" Language="1033" Version="1.0.0.0"> | ||
4 | <Package Id="86FB9E91-ACF3-4EDF-B711-72DAF2443692" InstallerVersion="200" Manufacturer="Example Corporation" /> | ||
5 | |||
6 | <ComponentGroupRef Id="ProductComponents" /> | ||
7 | </Module> | ||
8 | |||
9 | <Fragment> | ||
10 | <Directory Id="TARGETDIR" Name="SourceDir"> | ||
11 | <Directory Id="MergeRedirectFolder" /> | ||
12 | </Directory> | ||
13 | </Fragment> | ||
14 | |||
15 | <Fragment> | ||
16 | <ComponentGroup Id="ProductComponents" Directory="MergeRedirectFolder"> | ||
17 | <Component Id="MMtxt" Guid="2D93B748-4926-4185-BC84-9F1D6883AF20"> | ||
18 | <File Source="MergeModule.txt" /> | ||
19 | </Component> | ||
20 | </ComponentGroup> | ||
21 | </Fragment> | ||
22 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/SimpleMergeModule.wixproj b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/SimpleMergeModule.wixproj new file mode 100644 index 00000000..91579790 --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/SimpleMergeModule.wixproj | |||
@@ -0,0 +1,42 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
3 | <Import Project="$(WixMSBuildProps)" /> | ||
4 | <PropertyGroup> | ||
5 | <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
6 | <Platform Condition=" '$(Platform)' == '' ">x86</Platform> | ||
7 | <OutputType>Module</OutputType> | ||
8 | </PropertyGroup> | ||
9 | |||
10 | <PropertyGroup> | ||
11 | <ProjectGuid>{9F84998B-7F45-4CB3-8795-915801DBBB74}</ProjectGuid> | ||
12 | </PropertyGroup> | ||
13 | |||
14 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> | ||
15 | <PlatformName>$(Platform)</PlatformName> | ||
16 | <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath> | ||
17 | <DefineConstants>Debug</DefineConstants> | ||
18 | </PropertyGroup> | ||
19 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> | ||
20 | <PlatformName>$(Platform)</PlatformName> | ||
21 | <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath> | ||
22 | </PropertyGroup> | ||
23 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> | ||
24 | <PlatformName>$(Platform)</PlatformName> | ||
25 | <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath> | ||
26 | <DefineConstants>Debug</DefineConstants> | ||
27 | </PropertyGroup> | ||
28 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> | ||
29 | <PlatformName>$(Platform)</PlatformName> | ||
30 | <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath> | ||
31 | </PropertyGroup> | ||
32 | |||
33 | <ItemGroup> | ||
34 | <Compile Include="MergeModule.wxs" /> | ||
35 | </ItemGroup> | ||
36 | |||
37 | <ItemGroup> | ||
38 | <BindInputPaths Include="data" /> | ||
39 | </ItemGroup> | ||
40 | |||
41 | <Import Project="$(WixTargetsPath)" /> | ||
42 | </Project> \ No newline at end of file | ||
diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/data/MergeModule.txt b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/data/MergeModule.txt new file mode 100644 index 00000000..cd0db0e1 --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/data/MergeModule.txt | |||
@@ -0,0 +1 @@ | |||
This is test.txt. \ No newline at end of file | |||
diff --git a/src/test/WixToolsetTest.MSBuild/WixToolsetTest.MSBuild.csproj b/src/test/WixToolsetTest.MSBuild/WixToolsetTest.MSBuild.csproj index bb109557..916300af 100644 --- a/src/test/WixToolsetTest.MSBuild/WixToolsetTest.MSBuild.csproj +++ b/src/test/WixToolsetTest.MSBuild/WixToolsetTest.MSBuild.csproj | |||
@@ -15,6 +15,11 @@ | |||
15 | <Content Include="TestData\HeatFileMultipleFilesSameFileName\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | 15 | <Content Include="TestData\HeatFileMultipleFilesSameFileName\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> |
16 | <Content Include="TestData\HeatFileMultipleFilesSameFileName\MyProgram.txt" CopyToOutputDirectory="PreserveNewest" /> | 16 | <Content Include="TestData\HeatFileMultipleFilesSameFileName\MyProgram.txt" CopyToOutputDirectory="PreserveNewest" /> |
17 | <Content Include="TestData\HeatFileMultipleFilesSameFileName\MyProgram.json" CopyToOutputDirectory="PreserveNewest" /> | 17 | <Content Include="TestData\HeatFileMultipleFilesSameFileName\MyProgram.json" CopyToOutputDirectory="PreserveNewest" /> |
18 | <Content Include="TestData\MergeModule\MergeMsiPackage\MergeMsiPackage.wixproj" CopyToOutputDirectory="PreserveNewest" /> | ||
19 | <Content Include="TestData\MergeModule\MergeMsiPackage\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
20 | <Content Include="TestData\MergeModule\SimpleMergeModule\data\MergeModule.txt" CopyToOutputDirectory="PreserveNewest" /> | ||
21 | <Content Include="TestData\MergeModule\SimpleMergeModule\MergeModule.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
22 | <Content Include="TestData\MergeModule\SimpleMergeModule\SimpleMergeModule.wixproj" CopyToOutputDirectory="PreserveNewest" /> | ||
18 | <Content Include="TestData\MultiCulturalMsiPackage\MsiPackage\MsiPackage.wixproj" CopyToOutputDirectory="PreserveNewest" /> | 23 | <Content Include="TestData\MultiCulturalMsiPackage\MsiPackage\MsiPackage.wixproj" CopyToOutputDirectory="PreserveNewest" /> |
19 | <Content Include="TestData\MultiCulturalMsiPackage\MsiPackage\Package.de-de.wxl" CopyToOutputDirectory="PreserveNewest" /> | 24 | <Content Include="TestData\MultiCulturalMsiPackage\MsiPackage\Package.de-de.wxl" CopyToOutputDirectory="PreserveNewest" /> |
20 | <Content Include="TestData\MultiCulturalMsiPackage\MsiPackage\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | 25 | <Content Include="TestData\MultiCulturalMsiPackage\MsiPackage\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> |