Skip to content

Commit

Permalink
Re-enable netcoreapp1.1 tests (part 2)
Browse files Browse the repository at this point in the history
  • Loading branch information
pranavkm committed Feb 16, 2017
1 parent f3a0ee5 commit 075771a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
7 changes: 0 additions & 7 deletions build/repo.props

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<TargetFrameworks>netcoreapp1.1;net46</TargetFrameworks>
<TargetFrameworks>netcoreapp1.1;net452</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp1.1</TargetFrameworks>
<DefaultItemExcludes>$(DefaultItemExcludes);TestFiles\**\*</DefaultItemExcludes>
<PreserveCompilationContext>true</PreserveCompilationContext>
Expand All @@ -11,6 +11,7 @@
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="TestFiles\**\*" />
<None Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Microsoft.CodeAnalysis.Razor\Microsoft.CodeAnalysis.Razor.csproj" />
Expand Down
7 changes: 4 additions & 3 deletions test/Microsoft.CodeAnalysis.Razor.Test/TestCompilation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
Expand All @@ -23,13 +24,13 @@ public static Compilation Create(SyntaxTree syntaxTree = null)
syntaxTrees = new[] { syntaxTree };
}

var assemblyName = new AssemblyName(typeof(TestCompilation).GetTypeInfo().Assembly.GetName().Name);
var dependencyContext = DependencyContext.Load(Assembly.Load(assemblyName));
var currentAssembly = typeof(TestCompilation).GetTypeInfo().Assembly;
var dependencyContext = DependencyContext.Load(currentAssembly);

var references = dependencyContext.CompileLibraries.SelectMany(l => l.ResolveReferencePaths())
.Select(assemblyPath => MetadataReference.CreateFromFile(assemblyPath));

var compilation = CSharpCompilation.Create("TestAssembly", syntaxTrees, references);

EnsureValidCompilation(compilation);

return compilation;
Expand Down
3 changes: 3 additions & 0 deletions test/Microsoft.CodeAnalysis.Razor.Test/xunit.runner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"shadowCopy": false
}

0 comments on commit 075771a

Please sign in to comment.