aboutsummaryrefslogtreecommitdiff
path: root/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2021-04-22 17:57:31 -0700
committerRob Mensching <rob@firegiant.com>2021-04-29 16:49:19 -0700
commit03d5c46cbbb94f73ac468709345fc6a0e50def8d (patch)
tree9460f73cc308ead863e7a28a68fdeb6d85a2e69e /src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs
parent35606d2cd04a7b1bec1d669f9619501dff2bf9dc (diff)
downloadwix-03d5c46cbbb94f73ac468709345fc6a0e50def8d.tar.gz
wix-03d5c46cbbb94f73ac468709345fc6a0e50def8d.tar.bz2
wix-03d5c46cbbb94f73ac468709345fc6a0e50def8d.zip
Move Tools into wix
Diffstat (limited to 'src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs')
-rw-r--r--src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs67
1 files changed, 0 insertions, 67 deletions
diff --git a/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs b/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs
deleted file mode 100644
index 9d132f66..00000000
--- a/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs
+++ /dev/null
@@ -1,67 +0,0 @@
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
3namespace WixToolsetTest.BuildTasks
4{
5 using System.IO;
6 using System.Linq;
7 using Microsoft.Build.Utilities;
8 using WixBuildTools.TestSupport;
9 using WixToolset.BuildTasks;
10 using WixToolset.Data;
11 using WixToolset.Data.Symbols;
12 using Xunit;
13
14 public class WixBuildTaskFixture
15 {
16 [Fact]
17 public void CanBuildSimpleMsiPackage()
18 {
19 var folder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage");
20
21 using (var fs = new DisposableFileSystem())
22 {
23 var baseFolder = fs.GetFolder();
24 var intermediateFolder = Path.Combine(baseFolder, "obj");
25 var pdbPath = Path.Combine(baseFolder, @"bin\testpackage.wixpdb");
26 var engine = new FakeBuildEngine();
27
28 var task = new WixBuild
29 {
30 BuildEngine = engine,
31 SourceFiles = new[]
32 {
33 new TaskItem(Path.Combine(folder, "Package.wxs")),
34 new TaskItem(Path.Combine(folder, "PackageComponents.wxs")),
35 },
36 LocalizationFiles = new[]
37 {
38 new TaskItem(Path.Combine(folder, "Package.en-us.wxl")),
39 },
40 BindInputPaths = new[]
41 {
42 new TaskItem(Path.Combine(folder, "data")),
43 },
44 IntermediateDirectory = new TaskItem(intermediateFolder),
45 OutputFile = new TaskItem(Path.Combine(baseFolder, @"bin\test.msi")),
46 PdbType = "Full",
47 PdbFile = new TaskItem(pdbPath),
48 DefaultCompressionLevel = "nOnE",
49 };
50
51 var result = task.Execute();
52 Assert.True(result, $"MSBuild task failed unexpectedly. Output:\r\n{engine.Output}");
53
54 Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.msi")));
55 Assert.True(File.Exists(pdbPath));
56 Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\cab1.cab")));
57
58 var intermediate = Intermediate.Load(pdbPath);
59 var section = intermediate.Sections.Single();
60
61 var fileSymbol = section.Symbols.OfType<FileSymbol>().Single();
62 Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path);
63 Assert.Equal(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path);
64 }
65 }
66 }
67}