Search in sources :

Example 1 with CoverageEnabledConfiguration

use of com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration in project intellij-community by JetBrains.

the class CoverageDataManagerImpl method processGatheredCoverage.

public static void processGatheredCoverage(RunConfigurationBase configuration) {
    final Project project = configuration.getProject();
    if (project.isDisposed())
        return;
    final CoverageDataManager coverageDataManager = CoverageDataManager.getInstance(project);
    final CoverageEnabledConfiguration coverageEnabledConfiguration = CoverageEnabledConfiguration.getOrCreate(configuration);
    //noinspection ConstantConditions
    final CoverageSuite coverageSuite = coverageEnabledConfiguration.getCurrentCoverageSuite();
    if (coverageSuite != null) {
        ((BaseCoverageSuite) coverageSuite).setConfiguration(configuration);
        coverageDataManager.coverageGathered(coverageSuite);
    }
}
Also used : Project(com.intellij.openapi.project.Project) CoverageEnabledConfiguration(com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration)

Example 2 with CoverageEnabledConfiguration

use of com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration in project intellij-community by JetBrains.

the class CoverageHelper method resetCoverageSuit.

public static void resetCoverageSuit(RunConfigurationBase configuration) {
    final CoverageEnabledConfiguration covConfig = CoverageEnabledConfiguration.getOrCreate(configuration);
    // reset coverage suite
    covConfig.setCurrentCoverageSuite(null);
    // register new coverage suite
    final CoverageDataManager coverageDataManager = CoverageDataManager.getInstance(configuration.getProject());
    covConfig.setCurrentCoverageSuite(coverageDataManager.addCoverageSuite(covConfig));
}
Also used : CoverageEnabledConfiguration(com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration)

Example 3 with CoverageEnabledConfiguration

use of com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration in project intellij-plugins by JetBrains.

the class JstdCoverageProgramRunner method start.

@Nullable
private static RunContentDescriptor start(@Nullable JstdServer server, @NotNull ExecutionEnvironment environment) throws ExecutionException {
    FileDocumentManager.getInstance().saveAllDocuments();
    JstdRunConfiguration runConfiguration = (JstdRunConfiguration) environment.getRunProfile();
    CoverageEnabledConfiguration coverageEnabledConfiguration = CoverageEnabledConfiguration.getOrCreate(runConfiguration);
    String coverageFilePath = coverageEnabledConfiguration.getCoverageFilePath();
    JstdRunProfileState jstdState = new JstdRunProfileState(environment, runConfiguration.getRunSettings(), coverageFilePath);
    ExecutionResult executionResult = jstdState.executeWithServer(server);
    RunContentBuilder contentBuilder = new RunContentBuilder(executionResult, environment);
    final RunContentDescriptor descriptor = contentBuilder.showRunContent(environment.getContentToReuse());
    ProcessHandler processHandler = executionResult.getProcessHandler();
    if (processHandler instanceof NopProcessHandler) {
        if (server != null) {
            server.addLifeCycleListener(new JstdServerLifeCycleAdapter() {

                @Override
                public void onBrowserCaptured(@NotNull JstdBrowserInfo info) {
                    ExecutionUtil.restartIfActive(descriptor);
                    server.removeLifeCycleListener(this);
                }
            }, contentBuilder);
        }
    } else {
        CoverageHelper.attachToProcess(runConfiguration, processHandler, environment.getRunnerSettings());
    }
    return descriptor;
}
Also used : JstdRunConfiguration(com.google.jstestdriver.idea.execution.JstdRunConfiguration) RunContentDescriptor(com.intellij.execution.ui.RunContentDescriptor) CoverageEnabledConfiguration(com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration) JstdRunProfileState(com.google.jstestdriver.idea.execution.JstdRunProfileState) NopProcessHandler(com.intellij.execution.process.NopProcessHandler) ProcessHandler(com.intellij.execution.process.ProcessHandler) ExecutionResult(com.intellij.execution.ExecutionResult) NopProcessHandler(com.intellij.execution.process.NopProcessHandler) RunContentBuilder(com.intellij.execution.runners.RunContentBuilder) JstdServerLifeCycleAdapter(com.google.jstestdriver.idea.server.JstdServerLifeCycleAdapter) JstdBrowserInfo(com.google.jstestdriver.idea.server.JstdBrowserInfo) Nullable(org.jetbrains.annotations.Nullable)

Example 4 with CoverageEnabledConfiguration

use of com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration in project intellij-community by JetBrains.

the class CoverageHelper method doWriteExternal.

public static void doWriteExternal(RunConfigurationBase runConfiguration, Element element) throws WriteExternalException {
    final CoverageEnabledConfiguration covConf = CoverageEnabledConfiguration.getOrCreate(runConfiguration);
    covConf.writeExternal(element);
}
Also used : CoverageEnabledConfiguration(com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration)

Example 5 with CoverageEnabledConfiguration

use of com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration in project intellij-community by JetBrains.

the class CoverageHelper method doReadExternal.

public static void doReadExternal(RunConfigurationBase runConfiguration, Element element) throws InvalidDataException {
    final CoverageEnabledConfiguration covConf = CoverageEnabledConfiguration.getOrCreate(runConfiguration);
    covConf.readExternal(element);
}
Also used : CoverageEnabledConfiguration(com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration)

Aggregations

CoverageEnabledConfiguration (com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration)7 ExecutionResult (com.intellij.execution.ExecutionResult)3 Nullable (org.jetbrains.annotations.Nullable)3 RunContentBuilder (com.intellij.execution.runners.RunContentBuilder)2 RunContentDescriptor (com.intellij.execution.ui.RunContentDescriptor)2 Project (com.intellij.openapi.project.Project)2 GoTestRunConfiguration (com.goide.runconfig.testing.GoTestRunConfiguration)1 GoTestRunningState (com.goide.runconfig.testing.GoTestRunningState)1 JstdRunConfiguration (com.google.jstestdriver.idea.execution.JstdRunConfiguration)1 JstdRunProfileState (com.google.jstestdriver.idea.execution.JstdRunProfileState)1 JstdBrowserInfo (com.google.jstestdriver.idea.server.JstdBrowserInfo)1 JstdServerLifeCycleAdapter (com.google.jstestdriver.idea.server.JstdServerLifeCycleAdapter)1 CoverageDataManager (com.intellij.coverage.CoverageDataManager)1 CoverageExecutor (com.intellij.coverage.CoverageExecutor)1 CoverageHelper (com.intellij.coverage.CoverageHelper)1 CoverageRunnerData (com.intellij.coverage.CoverageRunnerData)1 ExecutionException (com.intellij.execution.ExecutionException)1 ConfigurationInfoProvider (com.intellij.execution.configurations.ConfigurationInfoProvider)1 RunProfile (com.intellij.execution.configurations.RunProfile)1 RunProfileState (com.intellij.execution.configurations.RunProfileState)1