From db1d86a4aff88cd99e081349cf8b01060100a988 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Thu, 17 Dec 2015 12:20:41 -0800 Subject: [PATCH] Migrate test runner to build tools --- Tests/MatterControl.nunit | 13 ++++ Tests/MatterControlAutomation.nunit | 11 +++ Tests/TestRunner/MatterControl.nunit | 13 ---- .../TestRunner/MatterControlAutomation.nunit | 11 --- .../TestRunner/NunitConsoleRunner.cs | 69 ------------------- Tests/TestRunner/TestRunner/Program.cs | 30 -------- .../TestRunner/Properties/AssemblyInfo.cs | 36 ---------- Tests/TestRunner/TestRunner/TestRunner.csproj | 56 --------------- Tests/TestRunner/TestRunner/TestRunner.sln | 20 ------ 9 files changed, 24 insertions(+), 235 deletions(-) create mode 100644 Tests/MatterControl.nunit create mode 100644 Tests/MatterControlAutomation.nunit delete mode 100644 Tests/TestRunner/MatterControl.nunit delete mode 100644 Tests/TestRunner/MatterControlAutomation.nunit delete mode 100644 Tests/TestRunner/TestRunner/NunitConsoleRunner.cs delete mode 100644 Tests/TestRunner/TestRunner/Program.cs delete mode 100644 Tests/TestRunner/TestRunner/Properties/AssemblyInfo.cs delete mode 100644 Tests/TestRunner/TestRunner/TestRunner.csproj delete mode 100644 Tests/TestRunner/TestRunner/TestRunner.sln diff --git a/Tests/MatterControl.nunit b/Tests/MatterControl.nunit new file mode 100644 index 000000000..0b5237668 --- /dev/null +++ b/Tests/MatterControl.nunit @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/Tests/MatterControlAutomation.nunit b/Tests/MatterControlAutomation.nunit new file mode 100644 index 000000000..eb0a3ede0 --- /dev/null +++ b/Tests/MatterControlAutomation.nunit @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/Tests/TestRunner/MatterControl.nunit b/Tests/TestRunner/MatterControl.nunit deleted file mode 100644 index a9c7fc8ae..000000000 --- a/Tests/TestRunner/MatterControl.nunit +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/Tests/TestRunner/MatterControlAutomation.nunit b/Tests/TestRunner/MatterControlAutomation.nunit deleted file mode 100644 index e9806b8cc..000000000 --- a/Tests/TestRunner/MatterControlAutomation.nunit +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/Tests/TestRunner/TestRunner/NunitConsoleRunner.cs b/Tests/TestRunner/TestRunner/NunitConsoleRunner.cs deleted file mode 100644 index dd51a5078..000000000 --- a/Tests/TestRunner/TestRunner/NunitConsoleRunner.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Net; -using System.Text; - -namespace TestRunner -{ - public class NunitConsoleRunner - { - // Currently just running from the bin folder - private const string nunitPath = "NUnit-2.6.4"; - - private Uri siteBaseUri = new Uri("http://matterdata.azurewebsites.net/"); - - public void RunTests(string projectFilePath, string resultsFilePath) - { - if (File.Exists(resultsFilePath)) - { - File.Delete(resultsFilePath); - } - - string binPath = !Directory.Exists(nunitPath) ? null : Path.Combine(nunitPath, "bin\\nunit-console-x86.exe"); - - // Run the unit tests - if (!string.IsNullOrWhiteSpace(binPath) && File.Exists(binPath)) - { - Process process = new Process(); - process.StartInfo.Arguments = string.Format( - "{0} /xml:{1} /noshadow:true /config:Release", // /include:Agg.UI" // /include:MatterControl.UI2;Leveling" - projectFilePath, - resultsFilePath); - process.StartInfo.FileName = binPath; - process.StartInfo.UseShellExecute = true; - process.Start(); - - process.WaitForExit(); - } - } - - public Uri RunAndReport(string projectFilePath, string resultsFilePath) - { - RunTests(projectFilePath, resultsFilePath); - - Debugger.Launch(); - - // Post the results - if (!File.Exists(resultsFilePath)) - { - return null; - } - else - { - var uri = new Uri(siteBaseUri, "testresults/create/"); - - // Post the file to the server - var client = new WebClient(); - var bytes = client.UploadFile(uri, resultsFilePath); - - string reportID = UTF8Encoding.UTF8.GetString(bytes); - - // Launch the results - return new Uri(siteBaseUri, "testresults/details/" + reportID); - } - } - } -} diff --git a/Tests/TestRunner/TestRunner/Program.cs b/Tests/TestRunner/TestRunner/Program.cs deleted file mode 100644 index 8301d3ddf..000000000 --- a/Tests/TestRunner/TestRunner/Program.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Text; -using System.Net; - -namespace TestRunner -{ - class Program - { - - static void Main(string[] args) - { - Uri siteBaseUri = new Uri("http://matterdata.azurewebsites.net/"); - - var consoleRunner = new NunitConsoleRunner(); - var resultsUrl = consoleRunner.RunAndReport( - Path.GetFullPath("../../../MatterControl.nunit"), - Path.GetFullPath("results.xml")); - - if(resultsUrl != null) - { - // Launch the results - Process.Start(resultsUrl.AbsoluteUri); - } - } - } -} diff --git a/Tests/TestRunner/TestRunner/Properties/AssemblyInfo.cs b/Tests/TestRunner/TestRunner/Properties/AssemblyInfo.cs deleted file mode 100644 index 0b46526fb..000000000 --- a/Tests/TestRunner/TestRunner/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("TestRunner")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("TestRunner")] -[assembly: AssemblyCopyright("Copyright © 2014")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("053add9e-15c5-4ca2-8669-88889e28ef32")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Tests/TestRunner/TestRunner/TestRunner.csproj b/Tests/TestRunner/TestRunner/TestRunner.csproj deleted file mode 100644 index 1bc44bace..000000000 --- a/Tests/TestRunner/TestRunner/TestRunner.csproj +++ /dev/null @@ -1,56 +0,0 @@ - - - - - Debug - AnyCPU - {33677C3F-145C-476B-A882-2A44179CDECB} - Exe - Properties - TestRunner - TestRunner - v4.0 - 512 - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Tests/TestRunner/TestRunner/TestRunner.sln b/Tests/TestRunner/TestRunner/TestRunner.sln deleted file mode 100644 index 9ac51c74e..000000000 --- a/Tests/TestRunner/TestRunner/TestRunner.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestRunner", "TestRunner.csproj", "{33677C3F-145C-476B-A882-2A44179CDECB}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {33677C3F-145C-476B-A882-2A44179CDECB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {33677C3F-145C-476B-A882-2A44179CDECB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {33677C3F-145C-476B-A882-2A44179CDECB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {33677C3F-145C-476B-A882-2A44179CDECB}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal