aboutsummaryrefslogtreecommitdiff
path: root/integration-tests/gradle/src/main
diff options
context:
space:
mode:
authorsebastian.sellmair <sebastian.sellmair@jetbrains.com>2020-07-30 13:25:02 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-07-30 14:55:16 +0200
commit0a2e62ac839f15939e61de990e57307658f69832 (patch)
tree4d2718cfc81d4d2910c0b7fc3787d86de126fd02 /integration-tests/gradle/src/main
parentb593337bc686a942c36a7effd61e00ace388567b (diff)
downloaddokka-0a2e62ac839f15939e61de990e57307658f69832.tar.gz
dokka-0a2e62ac839f15939e61de990e57307658f69832.tar.bz2
dokka-0a2e62ac839f15939e61de990e57307658f69832.zip
Implement `TestEnvironment` and `exhaustive` APIs for Gradle integration tests
Diffstat (limited to 'integration-tests/gradle/src/main')
-rw-r--r--integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/TestEnvironment.kt14
1 files changed, 14 insertions, 0 deletions
diff --git a/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/TestEnvironment.kt b/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/TestEnvironment.kt
new file mode 100644
index 00000000..6e393a6d
--- /dev/null
+++ b/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/TestEnvironment.kt
@@ -0,0 +1,14 @@
+package org.jetbrains.dokka.it.gradle
+
+object TestEnvironment {
+ val isExhaustive = checkNotNull(System.getenv("isExhaustive")) {
+ "Missing `isExhaustive` environment variable"
+ }.toBoolean()
+}
+
+/**
+ * Will only return values if [TestEnvironment.isExhaustive] is set to true
+ */
+inline fun <reified T> ifExhaustive(vararg values: T): Array<out T> {
+ return if (TestEnvironment.isExhaustive) values else emptyArray()
+}