File: integTest.gradle

package info (click to toggle)
gradle 4.4.1-6
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 85,104 kB
  • sloc: java: 319,724; xml: 14,356; cpp: 4,200; ansic: 1,025; sh: 300; makefile: 60; asm: 17; jsp: 17; objc: 10
file content (80 lines) | stat: -rw-r--r-- 2,728 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import org.gradle.testing.IntegrationTest

apply plugin: 'java'

sourceSets {
    integTest {
        compileClasspath += main.output
        runtimeClasspath += main.output
    }
}

configurations {
    integTestCompile.extendsFrom testCompile
    integTestImplementation.extendsFrom testImplementation
    integTestRuntime.extendsFrom testRuntime
    partialDistribution.extendsFrom integTestRuntimeClasspath
}

dependencies {
    integTestCompile project(":internalIntegTesting")

    //so that implicit help tasks are available:
    integTestRuntime project(':diagnostics')

    //So that the wrapper and init task are added when integTests are run via commandline
    integTestRuntime project(':buildInit')
    //above can be removed when we implement the auto-apply plugins
}

ext.integTestTasks = tasks.withType(IntegrationTest)

integTestTasks.all { IntegrationTest task ->
    group = "verification"
    classpath = sourceSets.integTest.runtimeClasspath
}

task integTest(type: IntegrationTest) {
    def defaultExecuter = project.hasProperty("defaultIntegTestExecuter") ? project.defaultIntegTestExecuter : "embedded"
    description "Runs integTests with '${defaultExecuter}' executer"
    systemProperties['org.gradle.integtest.executer'] = defaultExecuter
    if (project.hasProperty('org.gradle.integtest.debug')) {
        systemProperties['org.gradle.integtest.debug'] = 'true'
        testLogging.showStandardStreams = true
    }
    if (project.hasProperty('org.gradle.integtest.verbose')) {
        testLogging.showStandardStreams = true
    }
    if(project.hasProperty('org.gradle.integtest.launcher.debug')) {
        systemProperties['org.gradle.integtest.launcher.debug'] = 'true'
    }
}
check.dependsOn(integTest)

['embedded', 'forking', 'noDaemon', 'parallel'].each { mode ->
    def taskName = "${mode}IntegTest"
    tasks.create(taskName, IntegrationTest).configure {
        description "Runs integTests with '${mode}' executer"
        systemProperties['org.gradle.integtest.executer'] = mode
    }
}

plugins.withType(org.gradle.plugins.ide.idea.IdeaPlugin) { // lazy as plugin not applied yet
    idea {
        module {
            testSourceDirs += sourceSets.integTest.groovy.srcDirs
            testSourceDirs += sourceSets.integTest.resources.srcDirs
            scopes.TEST.plus.add(configurations.integTestCompile)
            scopes.TEST.plus.add(configurations.integTestRuntime)
        }
    }
}

plugins.withType(org.gradle.plugins.ide.eclipse.EclipsePlugin) { // lazy as plugin not applied yet
    eclipse {
        classpath {
            plusConfigurations.add(configurations.integTestCompile)
            plusConfigurations.add(configurations.integTestRuntime)
        }
    }
}