From 075771a12dc19f471cf6c0363500ab6a333e7c7a Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 16 Feb 2017 15:28:46 -0800 Subject: [PATCH] Re-enable netcoreapp1.1 tests (part 2) --- build/repo.props | 7 ------- .../Microsoft.CodeAnalysis.Razor.Test.csproj | 3 ++- test/Microsoft.CodeAnalysis.Razor.Test/TestCompilation.cs | 7 ++++--- test/Microsoft.CodeAnalysis.Razor.Test/xunit.runner.json | 3 +++ 4 files changed, 9 insertions(+), 11 deletions(-) delete mode 100644 build/repo.props create mode 100644 test/Microsoft.CodeAnalysis.Razor.Test/xunit.runner.json diff --git a/build/repo.props b/build/repo.props deleted file mode 100644 index b9e16a63e2..0000000000 --- a/build/repo.props +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/test/Microsoft.CodeAnalysis.Razor.Test/Microsoft.CodeAnalysis.Razor.Test.csproj b/test/Microsoft.CodeAnalysis.Razor.Test/Microsoft.CodeAnalysis.Razor.Test.csproj index 5e14c2b5b8..c0a4efb3c9 100644 --- a/test/Microsoft.CodeAnalysis.Razor.Test/Microsoft.CodeAnalysis.Razor.Test.csproj +++ b/test/Microsoft.CodeAnalysis.Razor.Test/Microsoft.CodeAnalysis.Razor.Test.csproj @@ -1,7 +1,7 @@  - netcoreapp1.1;net46 + netcoreapp1.1;net452 netcoreapp1.1 $(DefaultItemExcludes);TestFiles\**\* true @@ -11,6 +11,7 @@ + diff --git a/test/Microsoft.CodeAnalysis.Razor.Test/TestCompilation.cs b/test/Microsoft.CodeAnalysis.Razor.Test/TestCompilation.cs index f822f95492..0119f1c8b9 100644 --- a/test/Microsoft.CodeAnalysis.Razor.Test/TestCompilation.cs +++ b/test/Microsoft.CodeAnalysis.Razor.Test/TestCompilation.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; @@ -23,13 +24,13 @@ namespace Microsoft.CodeAnalysis.Razor 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; diff --git a/test/Microsoft.CodeAnalysis.Razor.Test/xunit.runner.json b/test/Microsoft.CodeAnalysis.Razor.Test/xunit.runner.json new file mode 100644 index 0000000000..34b2fe2cdd --- /dev/null +++ b/test/Microsoft.CodeAnalysis.Razor.Test/xunit.runner.json @@ -0,0 +1,3 @@ +{ + "shadowCopy": false +} \ No newline at end of file