Search in sources :

Example 1 with TestResult

use of org.gradle.api.tasks.testing.TestResult in project gradle by gradle.

the class FailFastTestListenerInternal method completed.

@Override
public void completed(TestDescriptorInternal testDescriptor, TestResult testResult, TestCompleteEvent completeEvent) {
    TestResult delegateResult = testResult;
    if (failed) {
        if (testDescriptor.isComposite()) {
            delegateResult = new DefaultTestResult(TestResult.ResultType.FAILURE, testResult.getStartTime(), testResult.getEndTime(), testResult.getTestCount(), testResult.getSuccessfulTestCount(), testResult.getFailedTestCount(), testResult.getExceptions());
        } else {
            delegateResult = new DefaultTestResult(TestResult.ResultType.SKIPPED, testResult.getStartTime(), testResult.getEndTime(), testResult.getTestCount(), testResult.getSuccessfulTestCount(), testResult.getFailedTestCount(), testResult.getExceptions());
        }
    }
    delegate.completed(testDescriptor, delegateResult, completeEvent);
    if (!failed && testResult.getResultType() == TestResult.ResultType.FAILURE) {
        failed = true;
        testExecuter.stopNow();
    }
}
Also used : DefaultTestResult(org.gradle.api.internal.tasks.testing.results.DefaultTestResult) TestResult(org.gradle.api.tasks.testing.TestResult) DefaultTestResult(org.gradle.api.internal.tasks.testing.results.DefaultTestResult)

Example 2 with TestResult

use of org.gradle.api.tasks.testing.TestResult in project gradle by gradle.

the class TestListenerBuildOperationAdapter method completed.

@Override
public void completed(TestDescriptorInternal testDescriptor, TestResult testResult, TestCompleteEvent completeEvent) {
    long currentTime = clock.getCurrentTime();
    InProgressExecuteTestBuildOperation runningOp = runningTests.remove(testDescriptor);
    listener.finished(runningOp.descriptor, new OperationFinishEvent(runningOp.startTime, currentTime, testResult.getException(), new Result(testResult)));
}
Also used : OperationFinishEvent(org.gradle.internal.operations.OperationFinishEvent) TestResult(org.gradle.api.tasks.testing.TestResult)

Aggregations

TestResult (org.gradle.api.tasks.testing.TestResult)2 DefaultTestResult (org.gradle.api.internal.tasks.testing.results.DefaultTestResult)1 OperationFinishEvent (org.gradle.internal.operations.OperationFinishEvent)1