From 490f4af0d4f03b77f8874098d65d066dd60d0a46 Mon Sep 17 00:00:00 2001 From: Eric Erhardt Date: Tue, 9 Feb 2016 16:23:56 -0600 Subject: [PATCH] Refactoring test directories. - Rename Compiler.Common.Tests to Microsoft.DotNet.Compiler.Common.Tests. - Create the Microsoft.DotNet.Cli.Utils.Tests and move StreamForwarderTests to it. - ArgumentForwardingTests will be moved here in the future - Remove LoadContextTest, since it is old and no longer relevant. Partial #1250 --- Microsoft.DotNet.Cli.sln | 57 ++++++++++++------- scripts/configuration/testProjects.csv | 4 +- test/LoadContextTest/Program.cs | 53 ----------------- test/LoadContextTest/project.json | 20 ------- .../Microsoft.DotNet.Cli.Utils.Tests.xproj} | 8 +-- .../StreamForwarderTests.cs | 0 .../project.json | 0 ...rosoft.DotNet.Compiler.Common.Tests.xproj} | 5 +- .../Tests.cs | 0 .../project.json | 0 10 files changed, 45 insertions(+), 102 deletions(-) delete mode 100644 test/LoadContextTest/Program.cs delete mode 100644 test/LoadContextTest/project.json rename test/{LoadContextTest/LoadContextTest.xproj => Microsoft.DotNet.Cli.Utils.Tests/Microsoft.DotNet.Cli.Utils.Tests.xproj} (88%) rename test/{StreamForwarderTests => Microsoft.DotNet.Cli.Utils.Tests}/StreamForwarderTests.cs (100%) rename test/{StreamForwarderTests => Microsoft.DotNet.Cli.Utils.Tests}/project.json (100%) rename test/{StreamForwarderTests/StreamForwarderTests.xproj => Microsoft.DotNet.Compiler.Common.Tests/Microsoft.DotNet.Compiler.Common.Tests.xproj} (83%) rename test/{Compiler.Common.Tests => Microsoft.DotNet.Compiler.Common.Tests}/Tests.cs (100%) rename test/{Compiler.Common.Tests => Microsoft.DotNet.Compiler.Common.Tests}/project.json (100%) diff --git a/Microsoft.DotNet.Cli.sln b/Microsoft.DotNet.Cli.sln index 60b419d44..bd7e28c5a 100644 --- a/Microsoft.DotNet.Cli.sln +++ b/Microsoft.DotNet.Cli.sln @@ -27,8 +27,6 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.DotNet.ProjectMod EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "LoadContextTest", "test\LoadContextTest\LoadContextTest.xproj", "{7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{0722D325-24C8-4E83-B5AF-0A083E7F0749}" EndProject Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "MultiProjectValidator", "tools\MultiProjectValidator\MultiProjectValidator.xproj", "{08A68C6A-86F6-4ED2-89A7-B166D33E9F85}" @@ -63,6 +61,10 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.DotNet.Files", "s EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TestAssets", "TestAssets", "{82BD2E61-326D-4EA4-A1C1-93A565573C81}" EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.DotNet.Cli.Utils.Tests", "test\Microsoft.DotNet.Cli.Utils.Tests\Microsoft.DotNet.Cli.Utils.Tests.xproj", "{09C52F96-EFDD-4448-95EC-6D362DD60BAA}" +EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.DotNet.Compiler.Common.Tests", "test\Microsoft.DotNet.Compiler.Common.Tests\Microsoft.DotNet.Compiler.Common.Tests.xproj", "{44E7D1AC-DCF1-4A18-9C22-F09E6BB302B5}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -187,22 +189,6 @@ Global {C7AF0290-EF0D-44DC-9EDC-600803B664F8}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU {C7AF0290-EF0D-44DC-9EDC-600803B664F8}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU {C7AF0290-EF0D-44DC-9EDC-600803B664F8}.RelWithDebInfo|x64.Build.0 = Release|Any CPU - {7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}.Debug|x64.ActiveCfg = Debug|Any CPU - {7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}.Debug|x64.Build.0 = Debug|Any CPU - {7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU - {7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU - {7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU - {7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}.MinSizeRel|x64.Build.0 = Debug|Any CPU - {7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}.Release|Any CPU.Build.0 = Release|Any CPU - {7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}.Release|x64.ActiveCfg = Release|Any CPU - {7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}.Release|x64.Build.0 = Release|Any CPU - {7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU - {7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU - {7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU - {7A75ACC4-3C2F-44E1-B492-0EC08704E9FF}.RelWithDebInfo|x64.Build.0 = Release|Any CPU {08A68C6A-86F6-4ED2-89A7-B166D33E9F85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {08A68C6A-86F6-4ED2-89A7-B166D33E9F85}.Debug|Any CPU.Build.0 = Debug|Any CPU {08A68C6A-86F6-4ED2-89A7-B166D33E9F85}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -443,6 +429,38 @@ Global {D521DD9F-0614-4929-93B4-D8FA5682C174}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU {D521DD9F-0614-4929-93B4-D8FA5682C174}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU {D521DD9F-0614-4929-93B4-D8FA5682C174}.RelWithDebInfo|x64.Build.0 = Release|Any CPU + {09C52F96-EFDD-4448-95EC-6D362DD60BAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {09C52F96-EFDD-4448-95EC-6D362DD60BAA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {09C52F96-EFDD-4448-95EC-6D362DD60BAA}.Debug|x64.ActiveCfg = Debug|Any CPU + {09C52F96-EFDD-4448-95EC-6D362DD60BAA}.Debug|x64.Build.0 = Debug|Any CPU + {09C52F96-EFDD-4448-95EC-6D362DD60BAA}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU + {09C52F96-EFDD-4448-95EC-6D362DD60BAA}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU + {09C52F96-EFDD-4448-95EC-6D362DD60BAA}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU + {09C52F96-EFDD-4448-95EC-6D362DD60BAA}.MinSizeRel|x64.Build.0 = Debug|Any CPU + {09C52F96-EFDD-4448-95EC-6D362DD60BAA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {09C52F96-EFDD-4448-95EC-6D362DD60BAA}.Release|Any CPU.Build.0 = Release|Any CPU + {09C52F96-EFDD-4448-95EC-6D362DD60BAA}.Release|x64.ActiveCfg = Release|Any CPU + {09C52F96-EFDD-4448-95EC-6D362DD60BAA}.Release|x64.Build.0 = Release|Any CPU + {09C52F96-EFDD-4448-95EC-6D362DD60BAA}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU + {09C52F96-EFDD-4448-95EC-6D362DD60BAA}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU + {09C52F96-EFDD-4448-95EC-6D362DD60BAA}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU + {09C52F96-EFDD-4448-95EC-6D362DD60BAA}.RelWithDebInfo|x64.Build.0 = Release|Any CPU + {44E7D1AC-DCF1-4A18-9C22-F09E6BB302B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {44E7D1AC-DCF1-4A18-9C22-F09E6BB302B5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {44E7D1AC-DCF1-4A18-9C22-F09E6BB302B5}.Debug|x64.ActiveCfg = Debug|Any CPU + {44E7D1AC-DCF1-4A18-9C22-F09E6BB302B5}.Debug|x64.Build.0 = Debug|Any CPU + {44E7D1AC-DCF1-4A18-9C22-F09E6BB302B5}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU + {44E7D1AC-DCF1-4A18-9C22-F09E6BB302B5}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU + {44E7D1AC-DCF1-4A18-9C22-F09E6BB302B5}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU + {44E7D1AC-DCF1-4A18-9C22-F09E6BB302B5}.MinSizeRel|x64.Build.0 = Debug|Any CPU + {44E7D1AC-DCF1-4A18-9C22-F09E6BB302B5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {44E7D1AC-DCF1-4A18-9C22-F09E6BB302B5}.Release|Any CPU.Build.0 = Release|Any CPU + {44E7D1AC-DCF1-4A18-9C22-F09E6BB302B5}.Release|x64.ActiveCfg = Release|Any CPU + {44E7D1AC-DCF1-4A18-9C22-F09E6BB302B5}.Release|x64.Build.0 = Release|Any CPU + {44E7D1AC-DCF1-4A18-9C22-F09E6BB302B5}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU + {44E7D1AC-DCF1-4A18-9C22-F09E6BB302B5}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU + {44E7D1AC-DCF1-4A18-9C22-F09E6BB302B5}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU + {44E7D1AC-DCF1-4A18-9C22-F09E6BB302B5}.RelWithDebInfo|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -455,7 +473,6 @@ Global {DB29F219-DC92-4AF7-A2EE-E89FFBB3F5F0} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F} {DCDFE282-03DE-4DBC-B90C-CC3CE3EC8162} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F} {C7AF0290-EF0D-44DC-9EDC-600803B664F8} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F} - {7A75ACC4-3C2F-44E1-B492-0EC08704E9FF} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} {08A68C6A-86F6-4ED2-89A7-B166D33E9F85} = {0722D325-24C8-4E83-B5AF-0A083E7F0749} {688870C8-9843-4F9E-8576-D39290AD0F25} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F} {65741CB1-8AEE-4C66-8198-10A7EA0E4258} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} @@ -471,5 +488,7 @@ Global {386D412C-003C-47B1-8258-0E35865CB7C4} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} {11C77123-E4DA-499F-8900-80C88C2C69F2} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} {D521DD9F-0614-4929-93B4-D8FA5682C174} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F} + {09C52F96-EFDD-4448-95EC-6D362DD60BAA} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} + {44E7D1AC-DCF1-4A18-9C22-F09E6BB302B5} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} EndGlobalSection EndGlobal diff --git a/scripts/configuration/testProjects.csv b/scripts/configuration/testProjects.csv index d7bd1a57b..bc53a303d 100644 --- a/scripts/configuration/testProjects.csv +++ b/scripts/configuration/testProjects.csv @@ -1,6 +1,6 @@ EndToEnd -StreamForwarderTests dotnet-publish.Tests dotnet-compile.Tests dotnet-build.Tests -Compiler.Common.Tests +Microsoft.DotNet.Cli.Utils.Tests +Microsoft.DotNet.Compiler.Common.Tests diff --git a/test/LoadContextTest/Program.cs b/test/LoadContextTest/Program.cs deleted file mode 100644 index 467c6ac1d..000000000 --- a/test/LoadContextTest/Program.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System; -using System.IO; -using System.Reflection; -using Microsoft.DotNet.ProjectModel; -using Microsoft.DotNet.ProjectModel.Loader; -using Microsoft.Extensions.PlatformAbstractions; -using NuGet.Frameworks; - -namespace LoadContextTest -{ - public class Program - { - public static int Main(string[] args) - { - Console.WriteLine("Press enter to start"); - Console.ReadLine(); - // Get the path to the project - if(args.Length < 1) - { - Console.Error.WriteLine("Usage: LoadContextTest "); - return 1; - } - var project = Path.GetFullPath(args[0]); - - // Load the project load context - Console.WriteLine($"Creating load context for {project}"); - var rid = PlatformServices.Default.Runtime.GetRuntimeIdentifier(); - var context = ProjectContext.Create(project, FrameworkConstants.CommonFrameworks.DnxCore50, new[] { rid }); - var loadContext = context.CreateLoadContext(); - - // Load the project assembly - var asm = loadContext.LoadFromAssemblyName(new AssemblyName(context.ProjectFile.Name)); - - // Find the helper type and method - var type = asm.GetType("TestLibrary.Helper"); - if(type == null) - { - Console.Error.WriteLine("Failed to find type"); - return 1; - } - var method = type.GetMethod("SayHi", BindingFlags.Public | BindingFlags.Static); - if(method == null) - { - Console.Error.WriteLine("Failed to find method"); - return 1; - } - - // Call it! - method.Invoke(null, new object[0]); - return 0; - } - } -} diff --git a/test/LoadContextTest/project.json b/test/LoadContextTest/project.json deleted file mode 100644 index e5fb932d2..000000000 --- a/test/LoadContextTest/project.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": "1.0.0-*", - "description": "LoadContextTest Console Application", - - "compilationOptions": { - "emitEntryPoint": true - }, - - "dependencies": { - "NETStandard.Library" : "1.0.0-rc2-23808", - "Microsoft.Extensions.PlatformAbstractions": "1.0.0-rc2-16530", - "Microsoft.DotNet.ProjectModel.Loader": "1.0.0-*" - }, - - "frameworks": { - "dnxcore50": { - "imports": "portable-net45+win8" - } - } -} diff --git a/test/LoadContextTest/LoadContextTest.xproj b/test/Microsoft.DotNet.Cli.Utils.Tests/Microsoft.DotNet.Cli.Utils.Tests.xproj similarity index 88% rename from test/LoadContextTest/LoadContextTest.xproj rename to test/Microsoft.DotNet.Cli.Utils.Tests/Microsoft.DotNet.Cli.Utils.Tests.xproj index 466d4af8e..5c11f2cd2 100644 --- a/test/LoadContextTest/LoadContextTest.xproj +++ b/test/Microsoft.DotNet.Cli.Utils.Tests/Microsoft.DotNet.Cli.Utils.Tests.xproj @@ -4,17 +4,15 @@ 14.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - 7a75acc4-3c2f-44e1-b492-0ec08704e9ff - LoadContextTest + 09c52f96-efdd-4448-95ec-6d362dd60baa + Microsoft.DotNet.Cli.Utils ..\..\artifacts\obj\$(MSBuildProjectName) ..\..\artifacts\bin\$(MSBuildProjectName)\ - 2.0 - + \ No newline at end of file diff --git a/test/StreamForwarderTests/StreamForwarderTests.cs b/test/Microsoft.DotNet.Cli.Utils.Tests/StreamForwarderTests.cs similarity index 100% rename from test/StreamForwarderTests/StreamForwarderTests.cs rename to test/Microsoft.DotNet.Cli.Utils.Tests/StreamForwarderTests.cs diff --git a/test/StreamForwarderTests/project.json b/test/Microsoft.DotNet.Cli.Utils.Tests/project.json similarity index 100% rename from test/StreamForwarderTests/project.json rename to test/Microsoft.DotNet.Cli.Utils.Tests/project.json diff --git a/test/StreamForwarderTests/StreamForwarderTests.xproj b/test/Microsoft.DotNet.Compiler.Common.Tests/Microsoft.DotNet.Compiler.Common.Tests.xproj similarity index 83% rename from test/StreamForwarderTests/StreamForwarderTests.xproj rename to test/Microsoft.DotNet.Compiler.Common.Tests/Microsoft.DotNet.Compiler.Common.Tests.xproj index 8d2e1ee44..c9004da8c 100644 --- a/test/StreamForwarderTests/StreamForwarderTests.xproj +++ b/test/Microsoft.DotNet.Compiler.Common.Tests/Microsoft.DotNet.Compiler.Common.Tests.xproj @@ -6,14 +6,13 @@ - 386d412c-003c-47b1-8258-0e35865cb7c4 - StreamForwarderTests + 44e7d1ac-dcf1-4a18-9c22-f09e6bb302b5 + Microsoft.DotNet.Cli.Utils ..\..\artifacts\obj\$(MSBuildProjectName) ..\..\artifacts\bin\$(MSBuildProjectName)\ 2.0 - \ No newline at end of file diff --git a/test/Compiler.Common.Tests/Tests.cs b/test/Microsoft.DotNet.Compiler.Common.Tests/Tests.cs similarity index 100% rename from test/Compiler.Common.Tests/Tests.cs rename to test/Microsoft.DotNet.Compiler.Common.Tests/Tests.cs diff --git a/test/Compiler.Common.Tests/project.json b/test/Microsoft.DotNet.Compiler.Common.Tests/project.json similarity index 100% rename from test/Compiler.Common.Tests/project.json rename to test/Microsoft.DotNet.Compiler.Common.Tests/project.json