Search in sources :

Example 1 with JvmTestExecutionSpec

use of org.gradle.api.internal.tasks.testing.JvmTestExecutionSpec in project gradle by gradle.

the class Test method createTestExecutionSpec.

/**
 * {@inheritDoc}
 *
 * @since 4.4
 */
@Override
protected JvmTestExecutionSpec createTestExecutionSpec() {
    validateToolchainConfiguration();
    JavaForkOptions javaForkOptions = getForkOptionsFactory().newJavaForkOptions();
    copyTo(javaForkOptions);
    JavaModuleDetector javaModuleDetector = getJavaModuleDetector();
    boolean testIsModule = javaModuleDetector.isModule(modularity.getInferModulePath().get(), getTestClassesDirs());
    FileCollection classpath = javaModuleDetector.inferClasspath(testIsModule, stableClasspath);
    FileCollection modulePath = javaModuleDetector.inferModulePath(testIsModule, stableClasspath);
    return new JvmTestExecutionSpec(getTestFramework(), classpath, modulePath, getCandidateClassFiles(), isScanForTestClasses(), getTestClassesDirs(), getPath(), getIdentityPath(), getForkEvery(), javaForkOptions, getMaxParallelForks(), getPreviousFailedTestClasses());
}
Also used : JavaForkOptions(org.gradle.process.JavaForkOptions) JavaModuleDetector(org.gradle.internal.jvm.JavaModuleDetector) ConfigurableFileCollection(org.gradle.api.file.ConfigurableFileCollection) FileCollection(org.gradle.api.file.FileCollection) JvmTestExecutionSpec(org.gradle.api.internal.tasks.testing.JvmTestExecutionSpec)

Aggregations

ConfigurableFileCollection (org.gradle.api.file.ConfigurableFileCollection)1 FileCollection (org.gradle.api.file.FileCollection)1 JvmTestExecutionSpec (org.gradle.api.internal.tasks.testing.JvmTestExecutionSpec)1 JavaModuleDetector (org.gradle.internal.jvm.JavaModuleDetector)1 JavaForkOptions (org.gradle.process.JavaForkOptions)1