add separate test for publish layout

This commit is contained in:
Andrew Stanton-Nurse 2016-04-11 12:19:42 -07:00
parent 586acf4210
commit f2bf60d06f
8 changed files with 73 additions and 0 deletions

View file

@ -0,0 +1,11 @@
using System;
namespace DesktopAppWithNativeDep
{
public static class Program
{
public static void Main(string[] args)
{
}
}
}

View file

@ -0,0 +1,12 @@
{
"version": "1.0.0-*",
"dependencies": {
"PackageWithFakeNativeDep": "1.0.0-*"
},
"compilationOptions": {
"emitEntryPoint": true
},
"frameworks": {
"net451": { }
}
}

View file

@ -0,0 +1,10 @@
namespace PackageWithFakeNativeDep
{
public static class Lib
{
public static string GetMessage()
{
return "Hello, World";
}
}
}

View file

@ -0,0 +1,9 @@
{
"version": "1.0.0",
"packInclude": {
"runtimes/": "runtimes/"
},
"frameworks": {
"net45": {}
}
}

View file

@ -0,0 +1 @@
This is just a marker to ensure things are deployed right

View file

@ -0,0 +1 @@
This is just a marker to ensure things are deployed right

View file

@ -25,6 +25,15 @@ namespace Microsoft.DotNet.Cli.Build
public static readonly dynamic[] Projects = new[]
{
new
{
Name = "PackageWithFakeNativeDep",
IsTool = false,
Path = "TestAssets/TestPackages/PackageWithFakeNativeDep",
IsApplicable = new Func<bool>(() => true),
VersionSuffix = s_testPackageBuildVersionSuffix,
Clean = true
},
new
{
Name = "dotnet-dependency-context-test",

View file

@ -12,6 +12,26 @@ namespace Microsoft.DotNet.Tools.Publish.Tests
{
public class PublishDesktopTests : TestBase
{
[WindowsOnlyTheory]
[InlineData(null, "the-win-x64-version.txt")]
[InlineData("win7-x64", "the-win-x64-version.txt")]
[InlineData("win7-x86", "the-win-x86-version.txt")]
public async Task DesktopApp_WithDependencyOnNativePackage_ProducesExpectedOutput(string runtime, string expectedOutputName)
{
var testInstance = TestAssetsManager.CreateTestInstance(Path.Combine("..", "DesktopTestProjects", "DesktopAppWithNativeDep"))
.WithLockFiles();
var publishCommand = new PublishCommand(testInstance.TestRoot, runtime: runtime);
var result = await publishCommand.ExecuteAsync();
result.Should().Pass();
// Test the output
var outputDir = publishCommand.GetOutputDirectory(portable: false);
outputDir.Should().HaveFile(expectedOutputName);
outputDir.Should().HaveFile(publishCommand.GetOutputExecutable());
}
[WindowsOnlyTheory]
[InlineData("KestrelDesktopWithRuntimes", "http://localhost:20201", null, "libuv.dll", true)]
[InlineData("KestrelDesktopWithRuntimes", "http://localhost:20202", "win7-x64", "libuv.dll", true)]