Fix windows x86 test failure.

Use the correct rid for windows x86 in the test.
This commit is contained in:
Sridhar Periyasamy 2016-04-06 15:29:10 -07:00
parent 71680d30aa
commit 4de28dc58b
2 changed files with 18 additions and 3 deletions

View file

@ -94,7 +94,7 @@ namespace Microsoft.DotNet.Cli.Utils
if (framework.IsDesktop()) if (framework.IsDesktop())
{ {
var platformCommandSpecFactory = default(IPlatformCommandSpecFactory); IPlatformCommandSpecFactory platformCommandSpecFactory = null;
if (PlatformServices.Default.Runtime.OperatingSystemPlatform == Platform.Windows) if (PlatformServices.Default.Runtime.OperatingSystemPlatform == Platform.Windows)
{ {
platformCommandSpecFactory = new WindowsExePreferredCommandSpecFactory(); platformCommandSpecFactory = new WindowsExePreferredCommandSpecFactory();

View file

@ -2,9 +2,11 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System; using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.Tools.Test.Utilities; using Microsoft.DotNet.Tools.Test.Utilities;
using Microsoft.Extensions.PlatformAbstractions;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using Xunit; using Xunit;
using FluentAssertions; using FluentAssertions;
@ -44,8 +46,7 @@ namespace Microsoft.DotNet.Tests
// need conditional theories so we can skip on non-Windows // need conditional theories so we can skip on non-Windows
[Theory] [Theory]
[InlineData(".NETStandardApp,Version=v1.5", "CoreFX", @"lib\netstandard1.5\dotnet-desktop-and-portable.dll")] [MemberData("DependencyToolArguments")]
[InlineData(".NETFramework,Version=v4.5.1", "NetFX", @"AppWithDirectDependencyDesktopAndPortable\bin\Debug\net451\win7-x64\dotnet-desktop-and-portable.exe")]
public void TestFrameworkSpecificDependencyToolsCanBeInvoked(string framework, string args, string expectedDependencyToolPath) public void TestFrameworkSpecificDependencyToolsCanBeInvoked(string framework, string args, string expectedDependencyToolPath)
{ {
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
@ -70,6 +71,20 @@ namespace Microsoft.DotNet.Tests
result.Should().Pass(); result.Should().Pass();
} }
public static IEnumerable<object[]> DependencyToolArguments
{
get
{
var rid = PlatformServices.Default.Runtime.GetLegacyRestoreRuntimeIdentifier();
var projectOutputPath = $"AppWithDirectDependencyDesktopAndPortable\\bin\\Debug\\net451\\{rid}\\dotnet-desktop-and-portable.exe";
return new[]
{
new object[] { ".NETStandardApp,Version=v1.5", "CoreFX", "lib\\netstandard1.5\\dotnet-desktop-and-portable.dll" },
new object[] { ".NETFramework,Version=v4.5.1", "NetFX", projectOutputPath }
};
}
}
[Fact] [Fact]
public void TestProjectDependencyIsNotAvailableThroughDriver() public void TestProjectDependencyIsNotAvailableThroughDriver()
{ {