Bump test projects up to .NET 4.5.2

- aspnet/Testing#248
- xUnit no longer supports .NET 4.5.1
- build tests for desktop .NET only on Windows
This commit is contained in:
Doug Bunting 2017-02-14 08:48:29 -08:00
parent 0dbf62196c
commit 4861ef3391
8 changed files with 16 additions and 11 deletions

View File

@ -5,7 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Reflection; using System.Reflection;
#if NET451 #if NET452
using System.Runtime.Remoting; using System.Runtime.Remoting;
using System.Runtime.Remoting.Messaging; using System.Runtime.Remoting.Messaging;
#else #else
@ -28,7 +28,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests
private static string FindTestProjectRoot() private static string FindTestProjectRoot()
{ {
#if NET451 #if NET452
var currentDirectory = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory); var currentDirectory = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory);
#else #else
var currentDirectory = new DirectoryInfo(AppContext.BaseDirectory); var currentDirectory = new DirectoryInfo(AppContext.BaseDirectory);
@ -50,14 +50,14 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests
private static readonly bool GenerateBaselines = false; private static readonly bool GenerateBaselines = false;
#endif #endif
#if !NET451 #if !NET452
private static readonly AsyncLocal<string> _filename = new AsyncLocal<string>(); private static readonly AsyncLocal<string> _filename = new AsyncLocal<string>();
#endif #endif
// Used by the test framework to set the 'base' name for test files. // Used by the test framework to set the 'base' name for test files.
public static string Filename public static string Filename
{ {
#if NET451 #if NET452
get get
{ {
var handle = (ObjectHandle)CallContext.LogicalGetData("IntegrationTestBase_Filename"); var handle = (ObjectHandle)CallContext.LogicalGetData("IntegrationTestBase_Filename");

View File

@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0"> <Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Import Project="..\..\build\common.props" /> <Import Project="..\..\build\common.props" />
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>netcoreapp1.1;net451</TargetFrameworks> <TargetFrameworks>netcoreapp1.1;net452</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp1.1</TargetFrameworks>
<DefineConstants>$(DefineConstants);__RemoveThisBitTo__GENERATE_BASELINES</DefineConstants> <DefineConstants>$(DefineConstants);__RemoveThisBitTo__GENERATE_BASELINES</DefineConstants>
<DefaultItemExcludes>$(DefaultItemExcludes);TestFiles\**\*</DefaultItemExcludes> <DefaultItemExcludes>$(DefaultItemExcludes);TestFiles\**\*</DefaultItemExcludes>
</PropertyGroup> </PropertyGroup>

View File

@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0"> <Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Import Project="..\..\build\common.props" /> <Import Project="..\..\build\common.props" />
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>netcoreapp1.1;net451</TargetFrameworks> <TargetFrameworks>netcoreapp1.1;net452</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp1.1</TargetFrameworks>
<DefaultItemExcludes>$(DefaultItemExcludes);TestFiles\**\*</DefaultItemExcludes> <DefaultItemExcludes>$(DefaultItemExcludes);TestFiles\**\*</DefaultItemExcludes>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -30,7 +30,7 @@ namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers
".TagHelpers.DocumentedTagHelper.RemarksProperty\" />"; ".TagHelpers.DocumentedTagHelper.RemarksProperty\" />";
private static readonly string BaseDir = private static readonly string BaseDir =
#if NET451 #if NET452
AppDomain.CurrentDomain.BaseDirectory; AppDomain.CurrentDomain.BaseDirectory;
#else #else
AppContext.BaseDirectory; AppContext.BaseDirectory;

View File

@ -14,7 +14,7 @@ namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers
public class XmlDocumentationProviderTest public class XmlDocumentationProviderTest
{ {
private static readonly string BaseDir = private static readonly string BaseDir =
#if NET451 #if NET452
AppDomain.CurrentDomain.BaseDirectory; AppDomain.CurrentDomain.BaseDirectory;
#else #else
AppContext.BaseDirectory; AppContext.BaseDirectory;

View File

@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0"> <Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Import Project="..\..\build\common.props" /> <Import Project="..\..\build\common.props" />
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>netcoreapp1.1;net451</TargetFrameworks> <TargetFrameworks>netcoreapp1.1;net452</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp1.1</TargetFrameworks>
<DefineConstants>$(DefineConstants);__RemoveThisBitTo__GENERATE_BASELINES</DefineConstants> <DefineConstants>$(DefineConstants);__RemoveThisBitTo__GENERATE_BASELINES</DefineConstants>
<DefaultItemExcludes>$(DefaultItemExcludes);TestFiles\**\*</DefaultItemExcludes> <DefaultItemExcludes>$(DefaultItemExcludes);TestFiles\**\*</DefaultItemExcludes>
</PropertyGroup> </PropertyGroup>

View File

@ -3,7 +3,8 @@
<PropertyGroup> <PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile> <GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS1591</NoWarn> <NoWarn>$(NoWarn);CS1591</NoWarn>
<TargetFrameworks>netcoreapp1.1;net451</TargetFrameworks> <TargetFrameworks>netcoreapp1.1;net452</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp1.1</TargetFrameworks>
<DefaultItemExcludes>$(DefaultItemExcludes);TestFiles\**\*</DefaultItemExcludes> <DefaultItemExcludes>$(DefaultItemExcludes);TestFiles\**\*</DefaultItemExcludes>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' "> <PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">

View File

@ -3,7 +3,8 @@
<PropertyGroup> <PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile> <GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS1591</NoWarn> <NoWarn>$(NoWarn);CS1591</NoWarn>
<TargetFrameworks>netcoreapp1.1;net451</TargetFrameworks> <TargetFrameworks>netcoreapp1.1;net452</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp1.1</TargetFrameworks>
<DefaultItemExcludes>$(DefaultItemExcludes);TestFiles\**\*</DefaultItemExcludes> <DefaultItemExcludes>$(DefaultItemExcludes);TestFiles\**\*</DefaultItemExcludes>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' "> <PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">