Search in sources :

Example 6 with ToggleAutoTestAction

use of com.intellij.execution.testframework.autotest.ToggleAutoTestAction in project go-lang-idea-plugin by go-lang-plugin-org.

the class GoTestRunningState method execute.

@NotNull
@Override
public ExecutionResult execute(@NotNull Executor executor, @NotNull ProgramRunner runner) throws ExecutionException {
    ProcessHandler processHandler = startProcess();
    TextConsoleBuilder consoleBuilder = TextConsoleBuilderFactory.getInstance().createBuilder(myConfiguration.getProject());
    setConsoleBuilder(consoleBuilder);
    GoTestConsoleProperties consoleProperties = new GoTestConsoleProperties(myConfiguration, executor);
    String frameworkName = myConfiguration.getTestFramework().getName();
    ConsoleView consoleView = SMTestRunnerConnectionUtil.createAndAttachConsole(frameworkName, processHandler, consoleProperties);
    consoleView.addMessageFilter(new GoConsoleFilter(myConfiguration.getProject(), myModule, myConfiguration.getWorkingDirectoryUrl()));
    ProcessTerminatedListener.attach(processHandler);
    DefaultExecutionResult executionResult = new DefaultExecutionResult(consoleView, processHandler);
    AbstractRerunFailedTestsAction rerunFailedTestsAction = consoleProperties.createRerunFailedTestsAction(consoleView);
    if (rerunFailedTestsAction != null) {
        rerunFailedTestsAction.setModelProvider(((SMTRunnerConsoleView) consoleView)::getResultsViewer);
        executionResult.setRestartActions(rerunFailedTestsAction, new ToggleAutoTestAction());
    } else {
        executionResult.setRestartActions(new ToggleAutoTestAction());
    }
    return executionResult;
}
Also used : GoConsoleFilter(com.goide.runconfig.GoConsoleFilter) DefaultExecutionResult(com.intellij.execution.DefaultExecutionResult) TextConsoleBuilder(com.intellij.execution.filters.TextConsoleBuilder) SMTRunnerConsoleView(com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView) ConsoleView(com.intellij.execution.ui.ConsoleView) ProcessHandler(com.intellij.execution.process.ProcessHandler) AbstractRerunFailedTestsAction(com.intellij.execution.testframework.actions.AbstractRerunFailedTestsAction) ToggleAutoTestAction(com.intellij.execution.testframework.autotest.ToggleAutoTestAction) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

ToggleAutoTestAction (com.intellij.execution.testframework.autotest.ToggleAutoTestAction)6 SMTRunnerConsoleView (com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView)6 ProcessHandler (com.intellij.execution.process.ProcessHandler)5 NotNull (org.jetbrains.annotations.NotNull)5 DefaultExecutionResult (com.intellij.execution.DefaultExecutionResult)4 ConsoleView (com.intellij.execution.ui.ConsoleView)4 AbstractRerunFailedTestsAction (com.intellij.execution.testframework.actions.AbstractRerunFailedTestsAction)3 BaseTestsOutputConsoleView (com.intellij.execution.testframework.ui.BaseTestsOutputConsoleView)2 GoConsoleFilter (com.goide.runconfig.GoConsoleFilter)1 GenericDebuggerRunnerSettings (com.intellij.debugger.impl.GenericDebuggerRunnerSettings)1 ExecutionException (com.intellij.execution.ExecutionException)1 TextConsoleBuilder (com.intellij.execution.filters.TextConsoleBuilder)1 KillableColoredProcessHandler (com.intellij.execution.process.KillableColoredProcessHandler)1 NopProcessHandler (com.intellij.execution.process.NopProcessHandler)1 OSProcessHandler (com.intellij.execution.process.OSProcessHandler)1 ProcessAdapter (com.intellij.execution.process.ProcessAdapter)1 ProcessEvent (com.intellij.execution.process.ProcessEvent)1 AbstractAutoTestManager (com.intellij.execution.testframework.autotest.AbstractAutoTestManager)1 SMTRunnerConsoleProperties (com.intellij.execution.testframework.sm.runner.SMTRunnerConsoleProperties)1 SMTestRunnerResultsForm (com.intellij.execution.testframework.sm.runner.ui.SMTestRunnerResultsForm)1