diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2020-04-29 19:36:24 +1000 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2020-04-29 19:53:29 +1000 |
| commit | ae1751902076edfd8978b7fb42f24d3ac3f7ad55 (patch) | |
| tree | 92011d854d8820cfd61136b7f6aa4378ba31b752 /src/test/WixToolsetTest.ManagedHost | |
| parent | a79ce0b907676e50332139b4c4a8acb5d22a4b46 (diff) | |
| download | wix-ae1751902076edfd8978b7fb42f24d3ac3f7ad55.tar.gz wix-ae1751902076edfd8978b7fb42f24d3ac3f7ad55.tar.bz2 wix-ae1751902076edfd8978b7fb42f24d3ac3f7ad55.zip | |
Add WPF .NET Core test.
Diffstat (limited to 'src/test/WixToolsetTest.ManagedHost')
3 files changed, 65 insertions, 3 deletions
diff --git a/src/test/WixToolsetTest.ManagedHost/DncHostFixture.cs b/src/test/WixToolsetTest.ManagedHost/DncHostFixture.cs index 7f40ee26..f33709ab 100644 --- a/src/test/WixToolsetTest.ManagedHost/DncHostFixture.cs +++ b/src/test/WixToolsetTest.ManagedHost/DncHostFixture.cs | |||
| @@ -335,5 +335,39 @@ namespace WixToolsetTest.ManagedHost | |||
| 335 | Assert.Equal("Shutdown,Restart,0", logMessages[8]); | 335 | Assert.Equal("Shutdown,Restart,0", logMessages[8]); |
| 336 | } | 336 | } |
| 337 | } | 337 | } |
| 338 | |||
| 339 | [Fact] | ||
| 340 | public void CanLoadFDDWPFCoreMBA() | ||
| 341 | { | ||
| 342 | using (var fs = new DisposableFileSystem()) | ||
| 343 | { | ||
| 344 | var baseFolder = fs.GetFolder(); | ||
| 345 | var binFolder = Path.Combine(baseFolder, "bin"); | ||
| 346 | var bundleFile = Path.Combine(binFolder, "FDDWPFCoreMBA.exe"); | ||
| 347 | var baSourceFolder = TestData.Get(@"..\examples"); | ||
| 348 | var bundleSourceFolder = TestData.Get(@"TestData\WPFCoreMBA"); | ||
| 349 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 350 | |||
| 351 | var compileResult = WixRunner.Execute(new[] | ||
| 352 | { | ||
| 353 | "build", | ||
| 354 | Path.Combine(bundleSourceFolder, "FrameworkDependentBundle.wxs"), | ||
| 355 | "-ext", TestData.Get(@"WixToolset.Bal.wixext.dll"), | ||
| 356 | "-intermediateFolder", intermediateFolder, | ||
| 357 | "-bindpath", baSourceFolder, | ||
| 358 | "-burnStub", TestEngine.BurnStubFile, | ||
| 359 | "-o", bundleFile, | ||
| 360 | }); | ||
| 361 | compileResult.AssertSuccess(); | ||
| 362 | var testEngine = new TestEngine(); | ||
| 363 | |||
| 364 | var result = testEngine.RunShutdownEngine(bundleFile, baseFolder); | ||
| 365 | var logMessages = result.Output; | ||
| 366 | Assert.Equal("Loading .NET Core FDD bootstrapper application.", logMessages[0]); | ||
| 367 | Assert.Equal("Creating BA thread to run asynchronously.", logMessages[1]); | ||
| 368 | Assert.Equal("WPFCoreBA", logMessages[2]); | ||
| 369 | Assert.Equal("Shutdown,ReloadBootstrapper,0", logMessages[3]); | ||
| 370 | } | ||
| 371 | } | ||
| 338 | } | 372 | } |
| 339 | } | 373 | } |
diff --git a/src/test/WixToolsetTest.ManagedHost/TestData/WPFCoreMBA/FrameworkDependentBundle.wxs b/src/test/WixToolsetTest.ManagedHost/TestData/WPFCoreMBA/FrameworkDependentBundle.wxs new file mode 100644 index 00000000..ecc5e8c1 --- /dev/null +++ b/src/test/WixToolsetTest.ManagedHost/TestData/WPFCoreMBA/FrameworkDependentBundle.wxs | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" | ||
| 3 | xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> | ||
| 4 | <Bundle Name="FDDWPFCoreMBA" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="5CE5B5C7-4B6B-4B95-B297-731F1F956533"> | ||
| 5 | <BootstrapperApplicationRef Id="DotNetCoreBootstrapperApplicationHost"> | ||
| 6 | <Payload SourceFile='publish\Example.WPFCoreMBA\fdd\Example.WPFCoreMBA.deps.json' Name='Example.WPFCoreMBA.deps.json' /> | ||
| 7 | <Payload SourceFile='publish\Example.WPFCoreMBA\fdd\Example.WPFCoreMBA.dll' Name='Example.WPFCoreMBA.dll' bal:BAFactoryAssembly='yes' /> | ||
| 8 | <Payload SourceFile='publish\Example.WPFCoreMBA\fdd\Example.WPFCoreMBA.pdb' Name='Example.WPFCoreMBA.pdb' /> | ||
| 9 | <Payload SourceFile='publish\Example.WPFCoreMBA\fdd\Example.WPFCoreMBA.runtimeconfig.json' Name='Example.WPFCoreMBA.runtimeconfig.json' /> | ||
| 10 | <Payload SourceFile='publish\Example.WPFCoreMBA\fdd\mbanative.dll' Name='mbanative.dll' /> | ||
| 11 | <Payload SourceFile='publish\Example.WPFCoreMBA\fdd\WixToolset.Mba.Core.dll' Name='WixToolset.Mba.Core.dll' /> | ||
| 12 | </BootstrapperApplicationRef> | ||
| 13 | <Chain> | ||
| 14 | <ExePackage SourceFile="c:\windows\system32\kernel32.dll" bal:PrereqPackage="yes" /> | ||
| 15 | </Chain> | ||
| 16 | </Bundle> | ||
| 17 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.ManagedHost/WixToolsetTest.ManagedHost.csproj b/src/test/WixToolsetTest.ManagedHost/WixToolsetTest.ManagedHost.csproj index 958c63fc..ff472322 100644 --- a/src/test/WixToolsetTest.ManagedHost/WixToolsetTest.ManagedHost.csproj +++ b/src/test/WixToolsetTest.ManagedHost/WixToolsetTest.ManagedHost.csproj | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | <PropertyGroup> | 14 | <PropertyGroup> |
| 15 | <EarliestCoreMBAProjectPath>..\examples\EarliestCoreMBA\Example.EarliestCoreMBA.csproj</EarliestCoreMBAProjectPath> | 15 | <EarliestCoreMBAProjectPath>..\examples\EarliestCoreMBA\Example.EarliestCoreMBA.csproj</EarliestCoreMBAProjectPath> |
| 16 | <LatestCoreMBAProjectPath>..\examples\LatestCoreMBA\Example.LatestCoreMBA.csproj</LatestCoreMBAProjectPath> | 16 | <LatestCoreMBAProjectPath>..\examples\LatestCoreMBA\Example.LatestCoreMBA.csproj</LatestCoreMBAProjectPath> |
| 17 | <WPFCoreMBAProjectPath>..\examples\WPFCoreMBA\Example.WPFCoreMBA.csproj</WPFCoreMBAProjectPath> | ||
| 17 | <MBAPublishPath>$(OutputPath)examples\publish\</MBAPublishPath> | 18 | <MBAPublishPath>$(OutputPath)examples\publish\</MBAPublishPath> |
| 18 | </PropertyGroup> | 19 | </PropertyGroup> |
| 19 | 20 | ||
| @@ -30,6 +31,7 @@ | |||
| 30 | <Content Include="TestData\LatestCoreMBA\HarvestedTrimmedSCD.wxs" CopyToOutputDirectory="PreserveNewest"/> | 31 | <Content Include="TestData\LatestCoreMBA\HarvestedTrimmedSCD.wxs" CopyToOutputDirectory="PreserveNewest"/> |
| 31 | <Content Include="TestData\LatestCoreMBA\SelfContainedBundle.wxs" CopyToOutputDirectory="PreserveNewest"/> | 32 | <Content Include="TestData\LatestCoreMBA\SelfContainedBundle.wxs" CopyToOutputDirectory="PreserveNewest"/> |
| 32 | <Content Include="TestData\LatestCoreMBA\TrimmedSelfContainedBundle.wxs" CopyToOutputDirectory="PreserveNewest"/> | 33 | <Content Include="TestData\LatestCoreMBA\TrimmedSelfContainedBundle.wxs" CopyToOutputDirectory="PreserveNewest"/> |
| 34 | <Content Include="TestData\WPFCoreMBA\FrameworkDependentBundle.wxs" CopyToOutputDirectory="PreserveNewest"/> | ||
| 33 | </ItemGroup> | 35 | </ItemGroup> |
| 34 | 36 | ||
| 35 | <Target Name="CopyExtensions" AfterTargets="Build"> | 37 | <Target Name="CopyExtensions" AfterTargets="Build"> |
| @@ -43,11 +45,17 @@ | |||
| 43 | <CoreMBAProject Include="$(LatestCoreMBAProjectPath)"> | 45 | <CoreMBAProject Include="$(LatestCoreMBAProjectPath)"> |
| 44 | <PublishPath>$(MBAPublishPath)Example.LatestCoreMBA</PublishPath> | 46 | <PublishPath>$(MBAPublishPath)Example.LatestCoreMBA</PublishPath> |
| 45 | </CoreMBAProject> | 47 | </CoreMBAProject> |
| 48 | <CoreMBAProject Include="$(WPFCoreMBAProjectPath)"> | ||
| 49 | <PublishPath>$(MBAPublishPath)Example.WPFCoreMBA</PublishPath> | ||
| 50 | <SkipSCD>true</SkipSCD> | ||
| 51 | <SkipTrimmedSCD>true</SkipTrimmedSCD> | ||
| 52 | </CoreMBAProject> | ||
| 46 | </ItemGroup> | 53 | </ItemGroup> |
| 47 | 54 | ||
| 48 | <ItemGroup> | 55 | <ItemGroup> |
| 49 | <ProjectReference Include="$(EarliestCoreMBAProjectPath)" /> | 56 | <ProjectReference Include="$(EarliestCoreMBAProjectPath)" /> |
| 50 | <ProjectReference Include="$(LatestCoreMBAProjectPath)" /> | 57 | <ProjectReference Include="$(LatestCoreMBAProjectPath)" /> |
| 58 | <ProjectReference Include="$(WPFCoreMBAProjectPath)" /> | ||
| 51 | <ProjectReference Include="..\examples\FullFramework2MBA\Example.FullFramework2MBA.csproj" /> | 59 | <ProjectReference Include="..\examples\FullFramework2MBA\Example.FullFramework2MBA.csproj" /> |
| 52 | <ProjectReference Include="..\examples\FullFramework4MBA\Example.FullFramework4MBA.csproj" /> | 60 | <ProjectReference Include="..\examples\FullFramework4MBA\Example.FullFramework4MBA.csproj" /> |
| 53 | <ProjectReference Include="..\examples\TestEngine\Example.TestEngine.vcxproj" /> | 61 | <ProjectReference Include="..\examples\TestEngine\Example.TestEngine.vcxproj" /> |
| @@ -69,8 +77,11 @@ | |||
| 69 | </ItemGroup> | 77 | </ItemGroup> |
| 70 | 78 | ||
| 71 | <Target Name="PublishExamples" AfterTargets="Build"> | 79 | <Target Name="PublishExamples" AfterTargets="Build"> |
| 72 | <Exec Command='dotnet publish -o "%(CoreMBAProject.PublishPath)\fdd" -r win-x86 -c $(Configuration) --self-contained false "%(CoreMBAProject.Identity)"' /> | 80 | <Exec Command='dotnet publish -o "%(CoreMBAProject.PublishPath)\fdd" -r win-x86 -c $(Configuration) --self-contained false "%(CoreMBAProject.Identity)"' |
| 73 | <Exec Command='dotnet publish -o "%(CoreMBAProject.PublishPath)\scd" -r win-x86 -c $(Configuration) --self-contained true "%(CoreMBAProject.Identity)"' /> | 81 | Condition="'%(CoreMBAProject.SkipFDD)'==''" /> |
| 74 | <Exec Command='dotnet publish -o "%(CoreMBAProject.PublishPath)\trimmedscd" -r win-x86 -c $(Configuration) --self-contained true -p:PublishTrimmed=true "%(CoreMBAProject.Identity)"' /> | 82 | <Exec Command='dotnet publish -o "%(CoreMBAProject.PublishPath)\scd" -r win-x86 -c $(Configuration) --self-contained true "%(CoreMBAProject.Identity)"' |
| 83 | Condition="'%(CoreMBAProject.SkipSCD)'==''" /> | ||
| 84 | <Exec Command='dotnet publish -o "%(CoreMBAProject.PublishPath)\trimmedscd" -r win-x86 -c $(Configuration) --self-contained true -p:PublishTrimmed=true "%(CoreMBAProject.Identity)"' | ||
| 85 | Condition="'%(CoreMBAProject.SkipTrimmedSCD)'==''" /> | ||
| 75 | </Target> | 86 | </Target> |
| 76 | </Project> | 87 | </Project> |
