aboutsummaryrefslogtreecommitdiff
path: root/integration-tests
diff options
context:
space:
mode:
authorsebastian.sellmair <sebastian.sellmair@jetbrains.com>2020-08-24 14:02:07 +0200
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-08-25 16:21:32 +0200
commit7196323582dce7ca3f9b07262a1f94ecd8514539 (patch)
tree0c326aee84d4727d5cd5bc5c8198b992d5b58de6 /integration-tests
parent219e2c98f5d03fc8581fd6ce9dd870919523be44 (diff)
downloaddokka-7196323582dce7ca3f9b07262a1f94ecd8514539.tar.gz
dokka-7196323582dce7ca3f9b07262a1f94ecd8514539.tar.bz2
dokka-7196323582dce7ca3f9b07262a1f94ecd8514539.zip
- Move `test` projects into semantic parent projects
- Implement new `:test-utils` project - Resolve requirement for Android SDK installation
Diffstat (limited to 'integration-tests')
-rw-r--r--integration-tests/build.gradle.kts2
-rw-r--r--integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Android0GradleIntegrationTest.kt22
-rw-r--r--integration-tests/src/main/kotlin/org/jetbrains/dokka/it/environmentUtils.kt16
3 files changed, 8 insertions, 32 deletions
diff --git a/integration-tests/build.gradle.kts b/integration-tests/build.gradle.kts
index a41269b9..76dfeb76 100644
--- a/integration-tests/build.gradle.kts
+++ b/integration-tests/build.gradle.kts
@@ -58,7 +58,7 @@ subprojects {
dependencies {
implementation(kotlin("stdlib"))
- implementation(kotlin("test-junit"))
+ api(project(":test-utils"))
val coroutines_version: String by project
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version")
implementation("org.jsoup:jsoup:1.12.1")
diff --git a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Android0GradleIntegrationTest.kt b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Android0GradleIntegrationTest.kt
index 6246cade..145992fc 100644
--- a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Android0GradleIntegrationTest.kt
+++ b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Android0GradleIntegrationTest.kt
@@ -1,9 +1,7 @@
package org.jetbrains.dokka.it.gradle
import org.gradle.testkit.runner.TaskOutcome
-import org.jetbrains.dokka.it.isAndroidSdkInstalled
-import org.jetbrains.dokka.it.isCI
-import org.junit.Assume
+import org.jetbrains.dokka.test.assumeAndroidSdkInstalled
import org.junit.runners.Parameterized.Parameters
import java.io.File
import kotlin.test.*
@@ -28,16 +26,10 @@ class Android0GradleIntegrationTest(override val versions: BuildVersions) : Abst
)
}
- @BeforeTest
- fun assumeAndroidInstallation() {
- if (isCI) {
- return
- }
- Assume.assumeTrue("Missing ANDROID_SDK_ROOT", isAndroidSdkInstalled)
- }
@BeforeTest
fun prepareProjectFiles() {
+ assumeAndroidSdkInstalled()
val templateProjectDir = File("projects", "it-android-0")
templateProjectDir.listFiles().orEmpty()
@@ -91,9 +83,9 @@ class Android0GradleIntegrationTest(override val versions: BuildVersions) : Abst
// TODO: remove this list when https://github.com/Kotlin/dokka/issues/1306 is closed
private val knownUnresolvedDRIs = setOf(
- "it.android/IntegrationTestActivity/findViewById/#kotlin.Int/PointingToGenericParameters(0)/",
- "it.android/IntegrationTestActivity/getExtraData/#java.lang.Class[TypeParam(bounds=[androidx.core.app.ComponentActivity.ExtraData])]/PointingToGenericParameters(0)/",
- "it.android/IntegrationTestActivity/getSystemService/#java.lang.Class[TypeParam(bounds=[kotlin.Any])]/PointingToGenericParameters(0)/",
- "it.android/IntegrationTestActivity/requireViewById/#kotlin.Int/PointingToGenericParameters(0)/"
- )
+ "it.android/IntegrationTestActivity/findViewById/#kotlin.Int/PointingToGenericParameters(0)/",
+ "it.android/IntegrationTestActivity/getExtraData/#java.lang.Class[TypeParam(bounds=[androidx.core.app.ComponentActivity.ExtraData])]/PointingToGenericParameters(0)/",
+ "it.android/IntegrationTestActivity/getSystemService/#java.lang.Class[TypeParam(bounds=[kotlin.Any])]/PointingToGenericParameters(0)/",
+ "it.android/IntegrationTestActivity/requireViewById/#kotlin.Int/PointingToGenericParameters(0)/"
+ )
}
diff --git a/integration-tests/src/main/kotlin/org/jetbrains/dokka/it/environmentUtils.kt b/integration-tests/src/main/kotlin/org/jetbrains/dokka/it/environmentUtils.kt
deleted file mode 100644
index eadf5a8c..00000000
--- a/integration-tests/src/main/kotlin/org/jetbrains/dokka/it/environmentUtils.kt
+++ /dev/null
@@ -1,16 +0,0 @@
-package org.jetbrains.dokka.it
-
-import java.io.File
-
-/**
- * Indicating whether or not the current machine executing the test is a CI
- */
-val isCI: Boolean get() = System.getenv("CI") == "true"
-
-val isAndroidSdkInstalled: Boolean = System.getenv("ANDROID_SDK_ROOT") != null ||
- System.getenv("ANDROID_HOME") != null
-
-val isMavenInstalled: Boolean = System.getenv("PATH").orEmpty()
- .split(File.pathSeparator)
- .flatMap { pathElement -> File(pathElement).listFiles().orEmpty().toList() }
- .any { pathElement -> "mvn" == pathElement.name }