diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2020-05-10 14:18:29 +1000 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2020-05-10 14:20:58 +1000 |
| commit | 43b794567dacd6b11dd508dca4aff29650139946 (patch) | |
| tree | 77d079557bd687e5a4c05a765b312775e1f4ef2f /src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs | |
| parent | a5f59cb11a6372a6da8540bd1bebf6dec20e92e3 (diff) | |
| download | wix-43b794567dacd6b11dd508dca4aff29650139946.tar.gz wix-43b794567dacd6b11dd508dca4aff29650139946.tar.bz2 wix-43b794567dacd6b11dd508dca4aff29650139946.zip | |
Add test for building a bundle from .wixproj.
Diffstat (limited to 'src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs')
| -rw-r--r-- | src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs index c6e260be..f1874743 100644 --- a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs +++ b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs | |||
| @@ -14,6 +14,43 @@ namespace WixToolsetTest.BuildTasks | |||
| 14 | private static readonly string WixTargetsPath = Path.Combine(Path.GetDirectoryName(new Uri(typeof(DoIt).Assembly.CodeBase).AbsolutePath), "wix.targets"); | 14 | private static readonly string WixTargetsPath = Path.Combine(Path.GetDirectoryName(new Uri(typeof(DoIt).Assembly.CodeBase).AbsolutePath), "wix.targets"); |
| 15 | 15 | ||
| 16 | [Fact] | 16 | [Fact] |
| 17 | public void CanBuildSimpleBundle() | ||
| 18 | { | ||
| 19 | var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\SimpleBundle\SimpleBundle.wixproj"); | ||
| 20 | |||
| 21 | using (var fs = new DisposableFileSystem()) | ||
| 22 | { | ||
| 23 | var baseFolder = fs.GetFolder(); | ||
| 24 | var binFolder = Path.Combine(baseFolder, @"bin\"); | ||
| 25 | var intermediateFolder = Path.Combine(baseFolder, @"obj\"); | ||
| 26 | |||
| 27 | var result = MsbuildRunner.Execute(projectPath, new[] | ||
| 28 | { | ||
| 29 | $"-p:WixTargetsPath={WixTargetsPath}", | ||
| 30 | $"-p:IntermediateOutputPath={intermediateFolder}", | ||
| 31 | $"-p:OutputPath={binFolder}" | ||
| 32 | }); | ||
| 33 | result.AssertSuccess(); | ||
| 34 | |||
| 35 | var platformSwitches = result.Output.Where(line => line.TrimStart().StartsWith("wix.exe build -platform x86")); | ||
| 36 | Assert.Single(platformSwitches); | ||
| 37 | |||
| 38 | var warnings = result.Output.Where(line => line.Contains(": warning")); | ||
| 39 | Assert.Empty(warnings); | ||
| 40 | |||
| 41 | var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) | ||
| 42 | .Select(s => s.Substring(baseFolder.Length + 1)) | ||
| 43 | .OrderBy(s => s) | ||
| 44 | .ToArray(); | ||
| 45 | Assert.Equal(new[] | ||
| 46 | { | ||
| 47 | //@"bin\SimpleBundle.exe", | ||
| 48 | @"bin\SimpleBundle.wixpdb", | ||
| 49 | }, paths); | ||
| 50 | } | ||
| 51 | } | ||
| 52 | |||
| 53 | [Fact] | ||
| 17 | public void CanBuildSimpleMsiPackage() | 54 | public void CanBuildSimpleMsiPackage() |
| 18 | { | 55 | { |
| 19 | var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); | 56 | var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); |
