aboutsummaryrefslogtreecommitdiff
path: root/runners/gradle-integration-tests/src/test
diff options
context:
space:
mode:
authorPaul Merlin <paul@gradle.com>2018-09-15 15:45:15 +0200
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2019-01-25 17:29:02 +0300
commitfa6e8ab0b0a846192d46cf9d13a0e4f01262432f (patch)
treee480b19535bf4a294e022d20599229af02e3ac9c /runners/gradle-integration-tests/src/test
parentcf8279e49446e812ea43ccd4e825fbdfbf169b78 (diff)
downloaddokka-fa6e8ab0b0a846192d46cf9d13a0e4f01262432f.tar.gz
dokka-fa6e8ab0b0a846192d46cf9d13a0e4f01262432f.tar.bz2
dokka-fa6e8ab0b0a846192d46cf9d13a0e4f01262432f.zip
Add integration test for type safe configuration
by leveraging Groovy's @CompileStatic Signed-off-by: Paul Merlin <paul@gradle.com>
Diffstat (limited to 'runners/gradle-integration-tests/src/test')
-rw-r--r--runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/TypeSafeConfigurationTest.kt38
1 files changed, 38 insertions, 0 deletions
diff --git a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/TypeSafeConfigurationTest.kt b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/TypeSafeConfigurationTest.kt
new file mode 100644
index 00000000..ab8bc62b
--- /dev/null
+++ b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/TypeSafeConfigurationTest.kt
@@ -0,0 +1,38 @@
+package org.jetbrains.dokka.gradle
+
+import org.gradle.testkit.runner.TaskOutcome
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.Parameterized
+import kotlin.test.assertEquals
+
+@RunWith(Parameterized::class)
+class TypeSafeConfigurationTest(private val testCase: TestCase) : AbstractDokkaGradleTest() {
+
+ data class TestCase(val gradleVersion: String, val kotlinVersion: String) {
+ override fun toString(): String = "Gradle $gradleVersion and Kotlin $kotlinVersion"
+ }
+
+ companion object {
+ @Parameterized.Parameters(name = "{0}")
+ @JvmStatic
+ fun testCases() = listOf(
+ TestCase("4.0", "1.1.2"),
+ TestCase("4.5", "1.2.20"),
+ TestCase("4.10.1", "1.2.60")
+ )
+ }
+
+ @Test
+ fun test() {
+ testDataFolder.resolve("typeSafeConfiguration").toFile().copyRecursively(testProjectDir.root)
+ configure(
+ testCase.gradleVersion,
+ testCase.kotlinVersion,
+ arguments = arrayOf("help", "-s")
+ ).build().apply {
+ println(output)
+ assertEquals(TaskOutcome.SUCCESS, task(":help")?.outcome)
+ }
+ }
+} \ No newline at end of file