Exemplo n.º 1
0
        private static void HandleTestExecutionStartMessage(string testRunner, Message message, ReportingChannel channel, ProjectContext projectContext)
        {
            TestHostTracing.Source.TraceInformation("Starting Execution");

            var commandArgs = new List<string> { projectContext.GetAssemblyPath(Constants.DefaultConfiguration) };

            commandArgs.AddRange(new[]
            {
                "--designtime"
            });

            var tests = message.Payload?.ToObject<RunTestsMessage>().Tests;
            if (tests != null)
            {
                foreach (var test in tests)
                {
                    commandArgs.Add("--test");
                    commandArgs.Add(test);
                }
            }

            ExecuteRunnerCommand(testRunner, channel, commandArgs);

            channel.Send(new Message()
            {
                MessageType = "TestExecution.Response",
            });

            TestHostTracing.Source.TraceInformation("Completed Execution");
        }
Exemplo n.º 2
0
        private static int RunConsole(ProjectContext projectContext, CommandLineApplication app, string testRunner)
        {
            var commandArgs = new List<string> {projectContext.GetAssemblyPath(Constants.DefaultConfiguration)};
            commandArgs.AddRange(app.RemainingArguments);

            return Command.Create($"{GetCommandName(testRunner)}", commandArgs, projectContext.TargetFramework)
                .ForwardStdErr()
                .ForwardStdOut()
                .Execute()
                .ExitCode;
        }
Exemplo n.º 3
0
        private static void HandleTestDiscoveryStartMessage(string testRunner, ReportingChannel channel, ProjectContext projectContext)
        {
            TestHostTracing.Source.TraceInformation("Starting Discovery");

            var commandArgs = new List<string> { projectContext.GetAssemblyPath(Constants.DefaultConfiguration) };

            commandArgs.AddRange(new[]
            {
                "--list",
                "--designtime"
            });

            ExecuteRunnerCommand(testRunner, channel, commandArgs);

            channel.Send(new Message()
            {
                MessageType = "TestDiscovery.Response",
            });

            TestHostTracing.Source.TraceInformation("Completed Discovery");
        }