make 'platform' flag dependent upon CLI bitness

this will make net451 deployment work for x86 apps
This commit is contained in:
Andrew Stanton-Nurse 2016-04-11 15:56:44 -07:00
parent f2bf60d06f
commit a48596ff23
15 changed files with 94 additions and 28 deletions

View file

@ -9,7 +9,7 @@
<ProjectGuid>0B31C336-149D-471A-B7B1-27B0F1E80F83</ProjectGuid>
<RootNamespace>Microsoft.DotNet.Cli.Msi.Tests</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\..\artifacts\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>

View file

@ -1,11 +1,14 @@
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using FluentAssertions;
using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.TestFramework;
using Microsoft.DotNet.Tools.Test.Utilities;
using Microsoft.Extensions.PlatformAbstractions;
using Xunit;
namespace Microsoft.DotNet.Tools.Publish.Tests
@ -13,11 +16,16 @@ namespace Microsoft.DotNet.Tools.Publish.Tests
public class PublishDesktopTests : TestBase
{
[WindowsOnlyTheory]
[InlineData(null, "the-win-x64-version.txt")]
[InlineData(null, null)]
[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)
{
if(string.IsNullOrEmpty(expectedOutputName))
{
expectedOutputName = $"the-win-{RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant()}-version.txt";
}
var testInstance = TestAssetsManager.CreateTestInstance(Path.Combine("..", "DesktopTestProjects", "DesktopAppWithNativeDep"))
.WithLockFiles();
@ -33,12 +41,17 @@ namespace Microsoft.DotNet.Tools.Publish.Tests
}
[WindowsOnlyTheory]
[InlineData("KestrelDesktopWithRuntimes", "http://localhost:20201", null, "libuv.dll", true)]
[InlineData("KestrelDesktopWithRuntimes", "http://localhost:20202", "win7-x64", "libuv.dll", true)]
[InlineData("KestrelDesktop", "http://localhost:20204", null, "libuv.dll", true)]
[InlineData("KestrelDesktop", "http://localhost:20205", "win7-x64", "libuv.dll", true)]
public async Task DesktopApp_WithKestrel_WorksWhenPublished(string project, string url, string runtime, string libuvName, bool runnable)
[InlineData("KestrelDesktopWithRuntimes", "http://localhost:20201", null, "libuv.dll", false)]
[InlineData("KestrelDesktopWithRuntimes", "http://localhost:20202", "win7-x64", "libuv.dll", false)]
[InlineData("KestrelDesktopWithRuntimes", "http://localhost:20203", "win7-x86", "libuv.dll", false)]
[InlineData("KestrelDesktopForce32", "http://localhost:20204", "win7-x86", "libuv.dll", true)]
[InlineData("KestrelDesktop", "http://localhost:20205", null, "libuv.dll", false)]
[InlineData("KestrelDesktop", "http://localhost:20206", "win7-x64", "libuv.dll", false)]
[InlineData("KestrelDesktop", "http://localhost:20207", "win7-x86", "libuv.dll", false)]
public async Task DesktopApp_WithKestrel_WorksWhenPublished(string project, string url, string runtime, string libuvName, bool forceRunnable)
{
var runnable = forceRunnable || string.IsNullOrEmpty(runtime) || (PlatformServices.Default.Runtime.GetLegacyRestoreRuntimeIdentifier().Contains(runtime));
var testInstance = GetTestInstance()
.WithLockFiles();
@ -55,7 +68,9 @@ namespace Microsoft.DotNet.Tools.Publish.Tests
Task exec = null;
if (runnable)
{
var command = new TestCommand(Path.Combine(outputDir.FullName, publishCommand.GetOutputExecutable()));
var outputExePath = Path.Combine(outputDir.FullName, publishCommand.GetOutputExecutable());
var command = new TestCommand(outputExePath);
try
{
exec = command.ExecuteAsync(url);
@ -74,10 +89,16 @@ namespace Microsoft.DotNet.Tools.Publish.Tests
}
[WindowsOnlyTheory]
[InlineData("KestrelDesktop", "http://localhost:20207")]
[InlineData("KestrelDesktopWithRuntimes", "http://localhost:20208")]
[InlineData("KestrelDesktop", "http://localhost:20301")]
[InlineData("KestrelDesktopWithRuntimes", "http://localhost:20302")]
public async Task DesktopApp_WithKestrel_WorksWhenRun(string project, string url)
{
// Disabled due to https://github.com/dotnet/cli/issues/2428
if (RuntimeInformation.ProcessArchitecture == Architecture.X86)
{
return;
}
var testInstance = GetTestInstance()
.WithLockFiles()
.WithBuildArtifacts();

View file

@ -12,7 +12,8 @@
},
"xunit": "2.1.0",
"xunit.netcore.extensions": "1.0.0-prerelease-00206",
"dotnet-test-xunit": "1.0.0-dev-140469-38"
"dotnet-test-xunit": "1.0.0-dev-140469-38",
"System.Runtime.InteropServices.RuntimeInformation": "4.0.0-rc2-24008"
},
"frameworks": {
"netcoreapp1.0": {