From d3c1fef4fa72eea36175ded3f536baa4e599b750 Mon Sep 17 00:00:00 2001 From: Aleksandr Shaurtaev Date: Tue, 30 Aug 2022 18:08:09 +0300 Subject: [PATCH] Remove XUnit tests --- test-suite/README.md | 15 --- test-suite/XunitTests/LocalTest.cs | 144 ------------------------ test-suite/XunitTests/XunitTests.csproj | 85 -------------- 3 files changed, 244 deletions(-) delete mode 100644 test-suite/XunitTests/LocalTest.cs delete mode 100644 test-suite/XunitTests/XunitTests.csproj diff --git a/test-suite/README.md b/test-suite/README.md index 2687380..57f84fd 100644 --- a/test-suite/README.md +++ b/test-suite/README.md @@ -89,13 +89,6 @@ to make all necessary steps. $ powershell.exe -executionpolicy bypass -File run_tests.ps1 [] ``` -- Xunit tests: -``` - $ cd XunitTests - $ dotnet test -``` - - # How to add new test - move to test-suite directory; @@ -117,12 +110,4 @@ to make all necessary steps. - add test name into ALL_TEST_NAMES list in "run_tests.sh", "run_tests.ps1", "sdb_run_tests.sh" and "sdb_run_tests.ps1" scripts; -- add reference to NewTest project in Xunit tests: -``` - $ cd XunitTests - $ dotnet add reference ../NewTest/NewTest.csproj -``` - -- add attribute `[InlineData("NewTest")]` in xunit test class before method `Run()`; - - in MIExampleTest implemented small scenario of NetCoreDbgTest library using. diff --git a/test-suite/XunitTests/LocalTest.cs b/test-suite/XunitTests/LocalTest.cs deleted file mode 100644 index 64e2c82..0000000 --- a/test-suite/XunitTests/LocalTest.cs +++ /dev/null @@ -1,144 +0,0 @@ -using System; -using System.IO; -using Xunit; - -using LocalDebugger; -using NetcoreDbgTestCore; -using NetcoreDbgTestCore.MI; -using NetcoreDbgTestCore.VSCode; - -namespace XUnitTests -{ - public class LocalTest : IDisposable - { - public LocalTest() - { - DebuggerClient = null; - LocalDebugger = null; - } - - [Theory] - [InlineData("MIExampleTest", "Program.cs;Program_second_source.cs")] - [InlineData("MITestBreakpoint", "Program.cs")] - [InlineData("MITestExpression", "Program.cs")] - [InlineData("MITestVariables", "Program.cs")] - [InlineData("MITestStepping", "Program.cs")] - [InlineData("MITestEvaluate", "Program.cs")] - [InlineData("MITestException", "Program.cs")] - [InlineData("MITestEnv", "Program.cs")] - [InlineData("MITestGDB", "Program.cs")] - [InlineData("MITestExecAbort", "Program.cs")] - [InlineData("MITestExecInt", "Program.cs")] - [InlineData("MITestHandshake", "Program.cs")] - [InlineData("MITestTarget", "Program.cs")] - [InlineData("MITestExceptionBreakpoint", "Program.cs")] - [InlineData("MITestExitCode", "Program.cs")] - [InlineData("MITestEvalNotEnglish", "Program.cs")] - [InlineData("MITest中文目录", "中文文件名.cs")] - [InlineData("MITestSrcBreakpointResolve", "Program.cs;folder/Program.cs")] - [InlineData("MITestEnum", "Program.cs")] - [InlineData("MITestBreak", "Program.cs")] - [InlineData("MITestBreakpointToModule", "Program.cs")] - [InlineData("MITestAsyncStepping", "Program.cs")] - [InlineData("MITestNoJMCNoFilterStepping", "Program.cs")] - [InlineData("MITestNoJMCBreakpoint", "Program.cs")] - [InlineData("MITestNoJMCAsyncStepping", "Program.cs")] - [InlineData("MITestNoJMCExceptionBreakpoint", "Program.cs")] - [InlineData("MITestSizeof", "Program.cs")] - [InlineData("MITestAsyncLambdaEvaluate", "Program.cs")] - [InlineData("MITestGeneric", "Program.cs")] - [InlineData("MITestEvalArraysIndexers", "Program.cs")] - [InlineData("VSCodeExampleTest", "Program.cs")] - [InlineData("VSCodeTestBreakpoint", "Program.cs")] - [InlineData("VSCodeTestFuncBreak", "Program.cs")] - [InlineData("VSCodeTestAttach", "Program.cs")] - [InlineData("VSCodeTestPause", "Program.cs")] - [InlineData("VSCodeTestDisconnect", "Program.cs")] - [InlineData("VSCodeTestThreads", "Program.cs")] - [InlineData("VSCodeTestVariables", "Program.cs")] - [InlineData("VSCodeTestEvaluate", "Program.cs")] - [InlineData("VSCodeTestStepping", "Program.cs")] - [InlineData("VSCodeTestEnv", "Program.cs")] - [InlineData("VSCodeTestExitCode", "Program.cs")] - [InlineData("VSCodeTestEvalNotEnglish", "Program.cs")] - [InlineData("VSCodeTest中文目录", "中文文件名.cs")] - [InlineData("VSCodeTestSrcBreakpointResolve", "Program.cs;folder/Program.cs")] - [InlineData("VSCodeTestEnum", "Program.cs")] - [InlineData("VSCodeTestAsyncStepping", "Program.cs")] - [InlineData("VSCodeTestBreak", "Program.cs")] - [InlineData("VSCodeTestNoJMCNoFilterStepping", "Program.cs")] - [InlineData("VSCodeTestNoJMCBreakpoint", "Program.cs")] - [InlineData("VSCodeTestNoJMCAsyncStepping", "Program.cs")] - [InlineData("VSCodeTestExceptionBreakpoint", "Program.cs")] - [InlineData("VSCodeTestNoJMCExceptionBreakpoint", "Program.cs")] - [InlineData("VSCodeTestSizeof", "Program.cs")] - [InlineData("VSCodeTestAsyncLambdaEvaluate", "Program.cs")] - [InlineData("VSCodeTestGeneric", "Program.cs")] - [InlineData("VSCodeTestEvalArraysIndexers", "Program.cs")] - public void Run(string testCaseName, string testCourceList) - { - // Explicit encoding setup, since system console encoding could be not utf8 (Windows OS). - // Note, netcoredbg aimed to interact with utf8 encoding usage only for all protocols. - Console.OutputEncoding = System.Text.Encoding.UTF8; - Console.InputEncoding = System.Text.Encoding.UTF8; - - string testSuiteRoot = Path.GetFullPath( - Path.Combine(Directory.GetCurrentDirectory(), "../../../..") - ); - - var Env = new NetcoreDbgTestCore.Environment(); - Env.TestName = testCaseName; - - string[] testFileArray = testCourceList.Split(";"); - foreach (var FileName in testFileArray) { - Env.SourceFilesPath += Path.Combine(testSuiteRoot, testCaseName, FileName + ";"); - } - Env.SourceFilesPath = Env.SourceFilesPath.Remove(Env.SourceFilesPath.Length - 1); - - Env.TargetAssemblyPath = Path.Combine(testSuiteRoot, - testCaseName + "/bin/Debug/netcoreapp3.1/", - testCaseName + ".dll"); - string fullDebuggerPath = Path.GetFullPath(Path.Combine(testSuiteRoot, DebuggerPath)); - - if (testCaseName.StartsWith("MI")) { - LocalDebugger = new LocalDebuggerProcess(fullDebuggerPath, @" --interpreter=mi"); - LocalDebugger.Start(); - DebuggerClient = new MILocalDebuggerClient(LocalDebugger.Input, - LocalDebugger.Output); - } else if (testCaseName.StartsWith("VSCode")) { - LocalDebugger = new LocalDebuggerProcess(fullDebuggerPath, @" --interpreter=vscode"); - LocalDebugger.Start(); - DebuggerClient = new VSCodeLocalDebuggerClient(LocalDebugger.Input, - LocalDebugger.Output); - } else { - throw new System.Exception(); - } - - Xunit.Assert.True(DebuggerClient.DoHandshake(5000)); - - var Script = new ControlScript(Env.SourceFilesPath, DebuggerClient.Protocol); - - new ControlPart().Run(Script, DebuggerClient, Env); - } - - public void Dispose() - { - if (DebuggerClient != null) { - DebuggerClient.Close(); - } - if (LocalDebugger != null) { - // we may exit debugger by "gdb-exit" call in command script - try - { - LocalDebugger.Close(); - } - // "No such process" exception at System.Diagnostics.Process.Kill() - catch (System.ComponentModel.Win32Exception) {} - } - } - - LocalDebuggerProcess LocalDebugger; - DebuggerClient DebuggerClient; - static string DebuggerPath = "../bin/netcoredbg"; - } -} diff --git a/test-suite/XunitTests/XunitTests.csproj b/test-suite/XunitTests/XunitTests.csproj deleted file mode 100644 index 772efec..0000000 --- a/test-suite/XunitTests/XunitTests.csproj +++ /dev/null @@ -1,85 +0,0 @@ - - - - netcoreapp3.1 - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -