예제 #1
0
            private string[] GetArguments(string testList = null)
            {
                var arguments = new List <string>();

                arguments.Add(TestLauncherPath);

                if (string.IsNullOrEmpty(testList))
                {
                    foreach (var test in GetTestCases())
                    {
                        arguments.Add("-t");
                        arguments.Add(test.Key);
                    }
                }
                else
                {
                    arguments.Add("--test-list");
                    arguments.Add(testList);
                }

                if (_dryRun)
                {
                    arguments.Add("--dry-run");
                }

                if (_codeCoverageFile != null)
                {
                    arguments.Add("--coverage");
                    arguments.Add(_codeCoverageFile);
                }

                if (_debugMode == PythonDebugMode.PythonOnly)
                {
                    arguments.Add("-p");
                    arguments.Add(_debugPort.ToString());

                    arguments.Add("-d");
                    arguments.Add(ExecutorService.GetDebuggerSearchPath(_settings.UseLegacyDebugger));

                    if (_settings.UseLegacyDebugger)
                    {
                        arguments.Add("-s");
                        arguments.Add(_debugSecret);
                    }
                }
                else if (_debugMode == PythonDebugMode.PythonAndNative)
                {
                    arguments.Add("-x");
                }

                arguments.Add("-r");
                arguments.Add(((IPEndPoint)_socket.LocalEndPoint).Port.ToString());
                return(arguments.ToArray());
            }