update project templates for portable app

also fix dotnet run
This commit is contained in:
Andrew Stanton-Nurse 2016-03-15 11:50:14 -07:00
parent 11e218d341
commit cc00d9d839
10 changed files with 95 additions and 45 deletions

View file

@ -8,11 +8,13 @@ using System.Runtime.InteropServices;
using Microsoft.DotNet.Tools.Test.Utilities;
using Microsoft.Extensions.PlatformAbstractions;
using Xunit;
using System.Diagnostics;
namespace Microsoft.DotNet.Tests.EndToEnd
{
public class EndToEndTest : TestBase
{
private static readonly string NetStandardTfm = "netstandard1.5";
private static readonly string s_expectedOutput = "Hello World!" + Environment.NewLine;
private static readonly string s_testdirName = "e2etestroot";
private static readonly string s_outputdirName = "test space/bin";
@ -42,20 +44,20 @@ namespace Microsoft.DotNet.Tests.EndToEnd
[Fact]
public void TestDotnetBuild()
{
var buildCommand = new BuildCommand(TestProject, output: OutputDirectory, framework: DefaultFramework);
var buildCommand = new BuildCommand(TestProject, output: OutputDirectory, framework: NetStandardTfm);
buildCommand.Execute().Should().Pass();
TestOutputExecutable(OutputDirectory, buildCommand.GetOutputExecutableName(), s_expectedOutput);
TestOutputExecutable(OutputDirectory, buildCommand.GetPortableOutputName(), s_expectedOutput);
}
[Fact]
public void TestDotnetIncrementalBuild()
{
// first build
var buildCommand = new BuildCommand(TestProject, output: OutputDirectory, framework: DefaultFramework);
var buildCommand = new BuildCommand(TestProject, output: OutputDirectory, framework: NetStandardTfm);
buildCommand.Execute().Should().Pass();
TestOutputExecutable(OutputDirectory, buildCommand.GetOutputExecutableName(), s_expectedOutput);
TestOutputExecutable(OutputDirectory, buildCommand.GetPortableOutputName(), s_expectedOutput);
var binariesOutputDirectory = GetCompilationOutputPath(OutputDirectory, false);
var latestWriteTimeFirstBuild = GetLastWriteTimeUtcOfDirectoryFiles(
@ -63,7 +65,7 @@ namespace Microsoft.DotNet.Tests.EndToEnd
// second build; should get skipped (incremental because no inputs changed)
buildCommand.Execute().Should().Pass();
TestOutputExecutable(OutputDirectory, buildCommand.GetOutputExecutableName(), s_expectedOutput);
TestOutputExecutable(OutputDirectory, buildCommand.GetPortableOutputName(), s_expectedOutput);
var latestWriteTimeUtcSecondBuild = GetLastWriteTimeUtcOfDirectoryFiles(
binariesOutputDirectory);
@ -73,14 +75,14 @@ namespace Microsoft.DotNet.Tests.EndToEnd
// third build; should get compiled because the source file got touched
buildCommand.Execute().Should().Pass();
TestOutputExecutable(OutputDirectory, buildCommand.GetOutputExecutableName(), s_expectedOutput);
TestOutputExecutable(OutputDirectory, buildCommand.GetPortableOutputName(), s_expectedOutput);
var latestWriteTimeUtcThirdBuild = GetLastWriteTimeUtcOfDirectoryFiles(
binariesOutputDirectory);
Assert.NotEqual(latestWriteTimeUtcSecondBuild, latestWriteTimeUtcThirdBuild);
}
[Fact]
[Fact(Skip = "Native compilation isn't shipping in 1.0 and we're moving it out anyway")]
public void TestDotnetBuildNativeRyuJit()
{
if (!IsNativeCompilationSupported())
@ -88,14 +90,14 @@ namespace Microsoft.DotNet.Tests.EndToEnd
return;
}
var buildCommand = new BuildCommand(TestProject, output: OutputDirectory, native: true, framework: DefaultFramework);
var buildCommand = new BuildCommand(TestProject, output: OutputDirectory, native: true, framework: NetStandardTfm);
buildCommand.Execute().Should().Pass();
TestNativeOutputExecutable(OutputDirectory, buildCommand.GetOutputExecutableName(), s_expectedOutput);
}
[Fact]
[Fact(Skip = "Native compilation isn't shipping in 1.0 and we're moving it out anyway")]
public void TestDotnetBuildNativeCpp()
{
if (!IsNativeCompilationSupported())
@ -103,14 +105,14 @@ namespace Microsoft.DotNet.Tests.EndToEnd
return;
}
var buildCommand = new BuildCommand(TestProject, output: OutputDirectory, native: true, nativeCppMode: true, framework: DefaultFramework);
var buildCommand = new BuildCommand(TestProject, output: OutputDirectory, native: true, nativeCppMode: true, framework: NetStandardTfm);
buildCommand.Execute().Should().Pass();
TestNativeOutputExecutable(OutputDirectory, buildCommand.GetOutputExecutableName(), s_expectedOutput);
}
[Fact]
[Fact(Skip = "Native compilation isn't shipping in 1.0 and we're moving it out anyway")]
public void TestDotnetCompileNativeCppIncremental()
{
if (!IsNativeCompilationSupported())
@ -119,7 +121,7 @@ namespace Microsoft.DotNet.Tests.EndToEnd
}
// first build
var buildCommand = new BuildCommand(TestProject, output: OutputDirectory, native: true, nativeCppMode: true, framework: DefaultFramework);
var buildCommand = new BuildCommand(TestProject, output: OutputDirectory, native: true, nativeCppMode: true, framework: NetStandardTfm);
var binariesOutputDirectory = GetCompilationOutputPath(OutputDirectory, false);
buildCommand.Execute().Should().Pass();
@ -163,7 +165,7 @@ namespace Microsoft.DotNet.Tests.EndToEnd
var publishCommand = new PublishCommand(TestProject, output: OutputDirectory);
publishCommand.Execute().Should().Pass();
TestExecutable(OutputDirectory, publishCommand.GetOutputExecutable(), s_expectedOutput);
TestExecutable(OutputDirectory, publishCommand.GetPortableOutputName(), s_expectedOutput);
}
[Fact]