From 3a5de4fada9dae8eb75816abe740152480409165 Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Thu, 2 Jul 2020 09:44:50 +0200 Subject: Implement template mechanism for Gradle integration tests --- .../dokka/it/gradle/AbstractGradleIntegrationTest.kt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'integration-tests/gradle/src/main') 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 d8a9a60f..2efb9c55 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 @@ -4,17 +4,25 @@ import org.gradle.testkit.runner.GradleRunner import org.junit.Rule import org.junit.rules.TemporaryFolder import java.io.File +import kotlin.test.BeforeTest import kotlin.test.assertFalse abstract class AbstractGradleIntegrationTest { @get:Rule - val projectTemporaryFolder = TemporaryFolder() + val temporaryTestFolder = TemporaryFolder() - val projectPath get() = projectTemporaryFolder.root.toPath() + val projectDir get() = File(temporaryTestFolder.root, "project") - val projectDir get() = projectTemporaryFolder.root + val projectPath get() = projectDir.toPath() + @BeforeTest + fun copyTemplates() { + File("projects").listFiles().orEmpty() + .filter { it.isFile } + .filter { it.name.startsWith("template.") } + .forEach { file -> file.copyTo(File(temporaryTestFolder.root, file.name)) } + } fun createGradleRunner( buildVersions: BuildVersions, arguments: Array -- cgit