From 2afe032280e384a44f7e0f3cabe15e923c84c93e Mon Sep 17 00:00:00 2001 From: Bryan Thornbury Date: Thu, 17 Mar 2016 18:02:48 -0700 Subject: [PATCH] Add tests and change to call exec --- src/dotnet/commands/dotnet-run/RunCommand.cs | 2 +- test/dotnet-run.Tests/RunTests.cs | 29 ++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/dotnet/commands/dotnet-run/RunCommand.cs b/src/dotnet/commands/dotnet-run/RunCommand.cs index 4270cfc16..5936c2d7a 100644 --- a/src/dotnet/commands/dotnet-run/RunCommand.cs +++ b/src/dotnet/commands/dotnet-run/RunCommand.cs @@ -158,7 +158,7 @@ namespace Microsoft.DotNet.Tools.Run // The executable is a ".dll", we need to call it through dotnet.exe var muxer = new Muxer(); - command = Command.Create(muxer.MuxerPath, Enumerable.Concat(new[] { outputName }, _args)); + command = Command.Create(muxer.MuxerPath, Enumerable.Concat(new[] { "exec", outputName }, _args)); } else { diff --git a/test/dotnet-run.Tests/RunTests.cs b/test/dotnet-run.Tests/RunTests.cs index eaadc4c09..0ef74da61 100644 --- a/test/dotnet-run.Tests/RunTests.cs +++ b/test/dotnet-run.Tests/RunTests.cs @@ -11,6 +11,7 @@ namespace Microsoft.DotNet.Tools.Run.Tests { public class RunTests : TestBase { + private const string PortableAppsTestBase = "PortableTests"; private const string RunTestsBase = "RunTestsApps"; [WindowsOnlyFact] @@ -40,6 +41,34 @@ namespace Microsoft.DotNet.Tools.Run.Tests new RunCommand(instance.TestRoot).Execute().Should().Fail(); } + [Fact] + public void ItRunsPortableApps() + { + TestInstance instance = TestAssetsManager.CreateTestInstance(Path.Combine(PortableAppsTestBase, "PortableApp")) + .WithLockFiles() + .WithBuildArtifacts(); + new RunCommand(instance.TestRoot).Execute().Should().Pass(); + } + + [Fact(Skip = "https://github.com/dotnet/cli/issues/1940")] + public void ItRunsPortableAppsWithNative() + { + TestInstance instance = TestAssetsManager.CreateTestInstance(Path.Combine(PortableAppsTestBase, "PortableAppWithNative")) + .WithLockFiles() + .WithBuildArtifacts(); + new RunCommand(instance.TestRoot).Execute().Should().Pass(); + } + + [Fact] + public void ItRunsStandaloneApps() + { + TestInstance instance = TestAssetsManager.CreateTestInstance(Path.Combine(PortableAppsTestBase, "StandaloneApp")) + .WithLockFiles() + .WithBuildArtifacts(); + new RunCommand(instance.TestRoot).Execute().Should().Pass(); + } + + private void CopyProjectToTempDir(string projectDir, TempDirectory tempDir) { // copy all the files to temp dir