Re-enable netcoreapp1.1 tests (part 2)
This commit is contained in:
parent
f3a0ee5bdb
commit
075771a12d
|
|
@ -1,7 +0,0 @@
|
||||||
<Project>
|
|
||||||
<ItemGroup>
|
|
||||||
<!-- TODO re-enable tests on .NET Core when we upgrade to 2.0. This project started using 2.0 API but we had to drop temporarily to .NET Core 1.1 -->
|
|
||||||
<ExcludeFromTest Include="$(RepositoryRoot)test\Microsoft.CodeAnalysis.Razor.Test\*.csproj" Condition="'$(OS)' != 'Windows_NT'"/>
|
|
||||||
<ExcludeFromTest Include="$(RepositoryRoot)test\Microsoft.AspNetCore.Razor.Evolution.Test\*.csproj" Condition="'$(OS)' != 'Windows_NT'" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<Import Project="..\..\build\common.props" />
|
<Import Project="..\..\build\common.props" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netcoreapp1.1;net46</TargetFrameworks>
|
<TargetFrameworks>netcoreapp1.1;net452</TargetFrameworks>
|
||||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp1.1</TargetFrameworks>
|
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp1.1</TargetFrameworks>
|
||||||
<DefaultItemExcludes>$(DefaultItemExcludes);TestFiles\**\*</DefaultItemExcludes>
|
<DefaultItemExcludes>$(DefaultItemExcludes);TestFiles\**\*</DefaultItemExcludes>
|
||||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
<PreserveCompilationContext>true</PreserveCompilationContext>
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="TestFiles\**\*" />
|
<EmbeddedResource Include="TestFiles\**\*" />
|
||||||
|
<None Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\src\Microsoft.CodeAnalysis.Razor\Microsoft.CodeAnalysis.Razor.csproj" />
|
<ProjectReference Include="..\..\src\Microsoft.CodeAnalysis.Razor\Microsoft.CodeAnalysis.Razor.csproj" />
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
@ -23,13 +24,13 @@ namespace Microsoft.CodeAnalysis.Razor
|
||||||
syntaxTrees = new[] { syntaxTree };
|
syntaxTrees = new[] { syntaxTree };
|
||||||
}
|
}
|
||||||
|
|
||||||
var assemblyName = new AssemblyName(typeof(TestCompilation).GetTypeInfo().Assembly.GetName().Name);
|
var currentAssembly = typeof(TestCompilation).GetTypeInfo().Assembly;
|
||||||
var dependencyContext = DependencyContext.Load(Assembly.Load(assemblyName));
|
var dependencyContext = DependencyContext.Load(currentAssembly);
|
||||||
|
|
||||||
var references = dependencyContext.CompileLibraries.SelectMany(l => l.ResolveReferencePaths())
|
var references = dependencyContext.CompileLibraries.SelectMany(l => l.ResolveReferencePaths())
|
||||||
.Select(assemblyPath => MetadataReference.CreateFromFile(assemblyPath));
|
.Select(assemblyPath => MetadataReference.CreateFromFile(assemblyPath));
|
||||||
|
|
||||||
var compilation = CSharpCompilation.Create("TestAssembly", syntaxTrees, references);
|
var compilation = CSharpCompilation.Create("TestAssembly", syntaxTrees, references);
|
||||||
|
|
||||||
EnsureValidCompilation(compilation);
|
EnsureValidCompilation(compilation);
|
||||||
|
|
||||||
return compilation;
|
return compilation;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"shadowCopy": false
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue