use of com.goide.runconfig.testing.GoTestRunConfiguration in project go-lang-idea-plugin by go-lang-plugin-org.
the class GoCoverageProgramRunner method doExecute.
@Nullable
@Override
protected RunContentDescriptor doExecute(@NotNull RunProfileState state, @NotNull ExecutionEnvironment environment) throws ExecutionException {
assert state instanceof GoTestRunningState;
GoTestRunningState runningState = (GoTestRunningState) state;
GoTestRunConfiguration runConfiguration = ObjectUtils.tryCast(environment.getRunProfile(), GoTestRunConfiguration.class);
if (runConfiguration == null) {
return null;
}
FileDocumentManager.getInstance().saveAllDocuments();
CoverageEnabledConfiguration coverageEnabledConfiguration = CoverageEnabledConfiguration.getOrCreate(runConfiguration);
runningState.setCoverageFilePath(coverageEnabledConfiguration.getCoverageFilePath());
ExecutionResult executionResult = state.execute(environment.getExecutor(), this);
if (executionResult == null) {
return null;
}
CoverageHelper.attachToProcess(runConfiguration, executionResult.getProcessHandler(), environment.getRunnerSettings());
return new RunContentBuilder(executionResult, environment).showRunContent(environment.getContentToReuse());
}
Aggregations