Add test for dotnet run with multiple frameworks.
This commit is contained in:
parent
cbeb5b9912
commit
469f7be5c3
5 changed files with 103 additions and 0 deletions
|
@ -174,6 +174,8 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "dotnet-test3.Tests", "test\
|
|||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dotnet-cli-build", "build_projects\dotnet-cli-build\dotnet-cli-build.csproj", "{8A2FA2D8-0DA1-4814-B5C1-2ECEAA613EB1}"
|
||||
EndProject
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "dotnet-run3.Tests", "test\dotnet-run3.Tests\dotnet-run3.Tests.xproj", "{9229D2A5-E2D1-4BEE-BC89-EFE65042842F}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
@ -1018,6 +1020,22 @@ Global
|
|||
{8A2FA2D8-0DA1-4814-B5C1-2ECEAA613EB1}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU
|
||||
{8A2FA2D8-0DA1-4814-B5C1-2ECEAA613EB1}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU
|
||||
{8A2FA2D8-0DA1-4814-B5C1-2ECEAA613EB1}.RelWithDebInfo|x64.Build.0 = Release|Any CPU
|
||||
{9229D2A5-E2D1-4BEE-BC89-EFE65042842F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9229D2A5-E2D1-4BEE-BC89-EFE65042842F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9229D2A5-E2D1-4BEE-BC89-EFE65042842F}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{9229D2A5-E2D1-4BEE-BC89-EFE65042842F}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{9229D2A5-E2D1-4BEE-BC89-EFE65042842F}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9229D2A5-E2D1-4BEE-BC89-EFE65042842F}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9229D2A5-E2D1-4BEE-BC89-EFE65042842F}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
|
||||
{9229D2A5-E2D1-4BEE-BC89-EFE65042842F}.MinSizeRel|x64.Build.0 = Debug|Any CPU
|
||||
{9229D2A5-E2D1-4BEE-BC89-EFE65042842F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9229D2A5-E2D1-4BEE-BC89-EFE65042842F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9229D2A5-E2D1-4BEE-BC89-EFE65042842F}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{9229D2A5-E2D1-4BEE-BC89-EFE65042842F}.Release|x64.Build.0 = Release|Any CPU
|
||||
{9229D2A5-E2D1-4BEE-BC89-EFE65042842F}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9229D2A5-E2D1-4BEE-BC89-EFE65042842F}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU
|
||||
{9229D2A5-E2D1-4BEE-BC89-EFE65042842F}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU
|
||||
{9229D2A5-E2D1-4BEE-BC89-EFE65042842F}.RelWithDebInfo|x64.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -1083,5 +1101,6 @@ Global
|
|||
{FBE4F1D6-BA4C-46D9-8286-4EE4B032D01E} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}
|
||||
{90236A80-4B84-41D3-A161-AA20709776B1} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}
|
||||
{8A2FA2D8-0DA1-4814-B5C1-2ECEAA613EB1} = {88278B81-7649-45DC-8A6A-D3A645C5AFC3}
|
||||
{9229D2A5-E2D1-4BEE-BC89-EFE65042842F} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFrameworks>net451;netcoreapp1.0</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Sdk">
|
||||
<Version>1.0.0-alpha-20161010-1</Version>
|
||||
<PrivateAssets>All</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">
|
||||
<PackageReference Include="Microsoft.NETCore.App">
|
||||
<Version>1.0.1</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="**\*.cs" />
|
||||
<EmbeddedResource Include="**\*.resx" />
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
|
@ -0,0 +1,12 @@
|
|||
using System;
|
||||
|
||||
namespace ConsoleApplication
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static void Main()
|
||||
{
|
||||
Console.WriteLine("Hello World!");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -87,5 +87,31 @@ namespace Microsoft.DotNet.Cli.Run3.Tests
|
|||
.And
|
||||
.HaveStdOutContaining("Hello World!");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItReportsAGoodErrorWhenProjectHasMultipleFrameworks()
|
||||
{
|
||||
var testAppName = "MSBuildAppWithMultipleFrameworks";
|
||||
var testInstance = TestAssetsManager
|
||||
.CreateTestInstance(testAppName);
|
||||
|
||||
var testProjectDirectory = testInstance.TestRoot;
|
||||
|
||||
new Restore3Command()
|
||||
.WithWorkingDirectory(testProjectDirectory)
|
||||
.Execute()
|
||||
.Should()
|
||||
.Pass();
|
||||
|
||||
// use --no-build so this test can run on all platforms.
|
||||
// the test app targets net451, which can't be built on non-Windows
|
||||
new Run3Command()
|
||||
.WithWorkingDirectory(testProjectDirectory)
|
||||
.ExecuteWithCapturedOutput("--no-build")
|
||||
.Should()
|
||||
.Fail()
|
||||
.And
|
||||
.HaveStdErrContaining("--framework");
|
||||
}
|
||||
}
|
||||
}
|
18
test/dotnet-run3.Tests/dotnet-run3.Tests.xproj
Normal file
18
test/dotnet-run3.Tests/dotnet-run3.Tests.xproj
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0.24720" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.24720</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>9229D2A5-E2D1-4BEE-BC89-EFE65042842F</ProjectGuid>
|
||||
<RootNamespace>Microsoft.DotNet.Cli.Run3.Tests</RootNamespace>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin</OutputPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
</Project>
|
Loading…
Add table
Add a link
Reference in a new issue