aboutsummaryrefslogtreecommitdiff
path: root/integration-tests/gradle
diff options
context:
space:
mode:
authorsebastian.sellmair <sebastian.sellmair@jetbrains.com>2020-07-07 11:08:34 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-07-07 13:31:38 +0200
commitcb20227d354b1b74ca6784d55ea75cc8b5281abd (patch)
tree2284ff9b5535a735655a9ad0ee436f2aa4e68a07 /integration-tests/gradle
parent72e6c72774f65308ce1da807bc0fa5798575d013 (diff)
downloaddokka-cb20227d354b1b74ca6784d55ea75cc8b5281abd.tar.gz
dokka-cb20227d354b1b74ca6784d55ea75cc8b5281abd.tar.bz2
dokka-cb20227d354b1b74ca6784d55ea75cc8b5281abd.zip
Implement simple cli integration test
Diffstat (limited to 'integration-tests/gradle')
-rw-r--r--integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt37
1 files changed, 2 insertions, 35 deletions
diff --git a/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt b/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt
index bb2d0cc6..c8c8c844 100644
--- a/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt
+++ b/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt
@@ -2,25 +2,17 @@ package org.jetbrains.dokka.it.gradle
import org.gradle.testkit.runner.GradleRunner
import org.gradle.testkit.runner.internal.DefaultGradleRunner
-import org.junit.Rule
-import org.junit.rules.TemporaryFolder
+import org.jetbrains.dokka.it.AbstractIntegrationTest
import org.junit.runner.RunWith
import org.junit.runners.Parameterized
import java.io.File
import kotlin.test.BeforeTest
-import kotlin.test.Test
-import kotlin.test.assertFalse
@RunWith(Parameterized::class)
-abstract class AbstractGradleIntegrationTest {
+abstract class AbstractGradleIntegrationTest : AbstractIntegrationTest() {
abstract val versions: BuildVersions
- @get:Rule
- val temporaryTestFolder = TemporaryFolder()
-
- val projectDir get() = File(temporaryTestFolder.root, "project")
-
@BeforeTest
fun copyTemplates() {
File("projects").listFiles().orEmpty()
@@ -49,30 +41,5 @@ abstract class AbstractGradleIntegrationTest {
).run { this as DefaultGradleRunner }
.withJvmArguments("-Xmx4G", "-XX:MaxMetaspaceSize=512M")
}
-
- fun File.allDescendentsWithExtension(extension: String): Sequence<File> {
- return this.walkTopDown().filter { it.isFile && it.extension == extension }
- }
-
- fun File.allHtmlFiles(): Sequence<File> {
- return allDescendentsWithExtension("html")
- }
-
- protected fun assertContainsNoErrorClass(file: File) {
- val fileText = file.readText()
- assertFalse(
- fileText.contains("ERROR CLASS", ignoreCase = true),
- "Unexpected `ERROR CLASS` in ${file.path}\n" + fileText
- )
- }
-
- protected fun assertNoUnresolvedLInks(file: File) {
- val regex = Regex("[\"']#[\"']")
- val fileText = file.readText()
- assertFalse(
- fileText.contains(regex),
- "Unexpected unresolved link in ${file.path}\n" + fileText
- )
- }
}