aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Arnson <bob@joyofsetup.com>2018-01-08 13:12:02 -0500
committerBob Arnson <bob@joyofsetup.com>2018-01-08 13:12:02 -0500
commit301388abc7bfe230630e33bfd96ae4af43d59fb0 (patch)
tree7c9d2d9fbe2bdb4e6f89eb305219d4d7a217f554
parentbfd280115ae55bf0e63f5a787c0ab3a3cf8efa32 (diff)
downloadwix-301388abc7bfe230630e33bfd96ae4af43d59fb0.tar.gz
wix-301388abc7bfe230630e33bfd96ae4af43d59fb0.tar.bz2
wix-301388abc7bfe230630e33bfd96ae4af43d59fb0.zip
Add failing unit test for .NET assemblies
Diffstat (limited to '')
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs40
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/TestData/Assembly/Package.en-us.wxl11
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/TestData/Assembly/Package.wxs21
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/TestData/Assembly/PackageComponents.wxs10
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/TestData/Assembly/data/candle.exebin0 -> 28672 bytes
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj4
6 files changed, 86 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs b/src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs
index a171981a..4af7fc44 100644
--- a/src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs
+++ b/src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs
@@ -317,6 +317,46 @@ namespace WixToolsetTest.CoreIntegration
317 } 317 }
318 } 318 }
319 319
320 [Fact]
321 public void CanBuildWithAssembly()
322 {
323 var folder = TestData.Get(@"TestData\Assembly");
324
325 using (var fs = new DisposableFileSystem())
326 {
327 var baseFolder = fs.GetFolder();
328 var intermediateFolder = Path.Combine(baseFolder, "obj");
329
330 var program = new Program();
331 var result = program.Run(new WixToolsetServiceProvider(), null, new[]
332 {
333 "build",
334 Path.Combine(folder, "Package.wxs"),
335 Path.Combine(folder, "PackageComponents.wxs"),
336 "-loc", Path.Combine(folder, "Package.en-us.wxl"),
337 "-bindpath", Path.Combine(folder, "data"),
338 "-intermediateFolder", intermediateFolder,
339 "-o", Path.Combine(baseFolder, @"bin\test.msi")
340 });
341
342 Assert.Equal(0, result);
343
344 Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.msi")));
345 Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.wixpdb")));
346 Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\AssemblyMsiPackage\candle.exe")));
347
348 var intermediate = Intermediate.Load(Path.Combine(baseFolder, @"bin\test.wir"));
349 var section = intermediate.Sections.Single();
350
351 var wixFile = section.Tuples.OfType<WixFileTuple>().Single();
352 Assert.Equal(Path.Combine(folder, @"data\candle.exe"), wixFile[WixFileTupleFields.Source].AsPath().Path);
353 Assert.Equal(@"candle.exe", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path);
354
355 var msiAssemblyNameTuples = section.Tuples.OfType<MsiAssemblyNameTuple>();
356 Assert.NotEmpty(msiAssemblyNameTuples);
357 }
358 }
359
320 [Fact(Skip = "Not implemented yet.")] 360 [Fact(Skip = "Not implemented yet.")]
321 public void CanBuildInstanceTransform() 361 public void CanBuildInstanceTransform()
322 { 362 {
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/Assembly/Package.en-us.wxl b/src/test/WixToolsetTest.CoreIntegration/TestData/Assembly/Package.en-us.wxl
new file mode 100644
index 00000000..38c12ac1
--- /dev/null
+++ b/src/test/WixToolsetTest.CoreIntegration/TestData/Assembly/Package.en-us.wxl
@@ -0,0 +1,11 @@
1<?xml version="1.0" encoding="utf-8"?>
2
3<!--
4This 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.CoreIntegration/TestData/Assembly/Package.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/Assembly/Package.wxs
new file mode 100644
index 00000000..d9a2a34e
--- /dev/null
+++ b/src/test/WixToolsetTest.CoreIntegration/TestData/Assembly/Package.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="AssemblyMsiPackage" 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 </Product>
13
14 <Fragment>
15 <Directory Id="TARGETDIR" Name="SourceDir">
16 <Directory Id="ProgramFilesFolder">
17 <Directory Id="INSTALLFOLDER" Name="AssemblyMsiPackage" />
18 </Directory>
19 </Directory>
20 </Fragment>
21</Wix>
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/Assembly/PackageComponents.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/Assembly/PackageComponents.wxs
new file mode 100644
index 00000000..e0c84c63
--- /dev/null
+++ b/src/test/WixToolsetTest.CoreIntegration/TestData/Assembly/PackageComponents.wxs
@@ -0,0 +1,10 @@
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="candle.exe" Assembly=".net" />
7 </Component>
8 </ComponentGroup>
9 </Fragment>
10</Wix>
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/Assembly/data/candle.exe b/src/test/WixToolsetTest.CoreIntegration/TestData/Assembly/data/candle.exe
new file mode 100644
index 00000000..18129b73
--- /dev/null
+++ b/src/test/WixToolsetTest.CoreIntegration/TestData/Assembly/data/candle.exe
Binary files differ
diff --git a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj
index d1901b38..6d11b2d6 100644
--- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj
+++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj
@@ -44,6 +44,10 @@
44 <Content Include="TestData\ManualUpgrade\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> 44 <Content Include="TestData\ManualUpgrade\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" />
45 <Content Include="TestData\ManualUpgrade\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> 45 <Content Include="TestData\ManualUpgrade\Package.wxs" CopyToOutputDirectory="PreserveNewest" />
46 <Content Include="TestData\ManualUpgrade\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> 46 <Content Include="TestData\ManualUpgrade\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" />
47 <Content Include="TestData\Assembly\data\candle.exe" CopyToOutputDirectory="PreserveNewest" />
48 <Content Include="TestData\Assembly\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" />
49 <Content Include="TestData\Assembly\Package.wxs" CopyToOutputDirectory="PreserveNewest" />
50 <Content Include="TestData\Assembly\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" />
47 </ItemGroup> 51 </ItemGroup>
48 52
49 <ItemGroup> 53 <ItemGroup>