aboutsummaryrefslogtreecommitdiff
path: root/gradle
diff options
context:
space:
mode:
authorRene Groeschke <rene@gradle.com>2015-11-18 12:48:31 +0000
committerRene Groeschke <rene@gradle.com>2015-11-18 12:48:31 +0000
commitda9a1b100639e7eb5a7986952f5a1f3ba0d675e6 (patch)
tree5a6227a8f7417a4cca0a522fe3e9ecf83bcc469a /gradle
parentacfa74706b83d620c675df81fcb81b805f6293a8 (diff)
downloadfrege-gradle-plugin-da9a1b100639e7eb5a7986952f5a1f3ba0d675e6.tar.gz
frege-gradle-plugin-da9a1b100639e7eb5a7986952f5a1f3ba0d675e6.tar.bz2
frege-gradle-plugin-da9a1b100639e7eb5a7986952f5a1f3ba0d675e6.zip
Add infrastructure for adding integration tests using testkit
Diffstat (limited to 'gradle')
-rw-r--r--gradle/integTest.gradle50
1 files changed, 50 insertions, 0 deletions
diff --git a/gradle/integTest.gradle b/gradle/integTest.gradle
new file mode 100644
index 0000000..07b0743
--- /dev/null
+++ b/gradle/integTest.gradle
@@ -0,0 +1,50 @@
+sourceSets {
+ integTest {
+ compileClasspath += main.output + test.output
+ runtimeClasspath += main.output + test.output
+ }
+}
+
+configurations {
+ integTestCompile.extendsFrom testCompile
+ integTestRuntime.extendsFrom testRuntime
+}
+
+task integTest(type: Test) {
+ shouldRunAfter 'test'
+ testClassesDir = sourceSets.integTest.output.classesDir
+ classpath = sourceSets.integTest.runtimeClasspath
+
+}
+check.dependsOn(integTest)
+
+plugins.withType(org.gradle.plugins.ide.idea.IdeaPlugin) {
+ idea {
+ module {
+ testSourceDirs += sourceSets.integTest.groovy.srcDirs
+ testSourceDirs += sourceSets.integTest.resources.srcDirs
+ scopes.TEST.plus.add(configurations.integTestCompile)
+ scopes.TEST.plus.add(configurations.integTestRuntime)
+ }
+ }
+}
+
+
+// START SNIPPET test-logic-classpath
+// Write the plugin's classpath to a file to share with the tests
+task createClasspathManifest {
+ def outputDir = file("$buildDir/$name")
+
+ inputs.files sourceSets.main.runtimeClasspath
+ outputs.dir outputDir
+
+ doLast {
+ outputDir.mkdirs()
+ file("$outputDir/plugin-classpath.txt").text = sourceSets.main.runtimeClasspath.join("\n")
+ }
+}
+
+// Add the classpath file to the test runtime classpath
+dependencies {
+ integTestRuntime files(createClasspathManifest)
+} \ No newline at end of file