summaryrefslogtreecommitdiff
path: root/build.gradle
diff options
context:
space:
mode:
authorThibault Gagnaux <tgagnaux@gmail.com>2021-07-07 22:58:47 +0200
committerThibault Gagnaux <tgagnaux@gmail.com>2021-07-07 22:58:47 +0200
commit2fceaad440fffc1f6edbd8e4887469cc948edb5d (patch)
tree8ceac945432e7c38ac7655d4590bdc5e2f9ef6c3 /build.gradle
parentcd5d39b867ad5435039d1a47244252078600ca0b (diff)
downloadfrege-gradle-plugin-2fceaad440fffc1f6edbd8e4887469cc948edb5d.tar.gz
frege-gradle-plugin-2fceaad440fffc1f6edbd8e4887469cc948edb5d.tar.bz2
frege-gradle-plugin-2fceaad440fffc1f6edbd8e4887469cc948edb5d.zip
Splits tests into fast unit tests and slow functional tests
Diffstat (limited to 'build.gradle')
-rw-r--r--build.gradle33
1 files changed, 28 insertions, 5 deletions
diff --git a/build.gradle b/build.gradle
index d889b1f..9d7ac13 100644
--- a/build.gradle
+++ b/build.gradle
@@ -6,15 +6,18 @@ repositories {
mavenCentral()
}
-dependencies {
- testImplementation('org.junit.jupiter:junit-jupiter-api:5.7.2')
- testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine:5.7.2')
-}
-
group = 'ch.fhnw.thga'
version = '0.0.1-SNAPSHOT'
+sourceSets {
+ functionalTest {
+ compileClasspath += sourceSets.main.output + sourceSets.test.output
+ runtimeClasspath += sourceSets.test.runtimeClasspath
+ }
+}
+
gradlePlugin {
+ testSourceSets project.sourceSets.functionalTest
plugins {
fregePlugin {
id = 'ch.fhnw.thga.frege'
@@ -23,6 +26,26 @@ gradlePlugin {
}
}
+configurations {
+ functionalTestImplementation.extendsFrom testImplementation
+ functionalRuntimeOnly.extendsFrom runtimeOnly
+}
+
+tasks.register('functionalTest', Test) {
+ description = 'Runs functional tests.'
+ group = 'verification'
+ testClassesDirs = sourceSets.functionalTest.output.classesDirs
+ classpath = sourceSets.functionalTest.runtimeClasspath
+ shouldRunAfter test
+}
+
+check.dependsOn functionalTest
+
tasks.withType(Test).configureEach {
useJUnitPlatform()
}
+
+dependencies {
+ testImplementation('org.junit.jupiter:junit-jupiter-api:5.7.2')
+ testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine:5.7.2')
+}