Move index overflow tests to another test source set

To avoid reporting them as ignored and to make it more easy to run them
when needed.
This commit is contained in:
Ilya Gorbunov
2018-11-16 21:33:59 +03:00
parent c5922bf74b
commit a534bfc32f
2 changed files with 14 additions and 12 deletions
+14 -4
View File
@@ -48,6 +48,11 @@ sourceSets {
srcDir 'test' srcDir 'test'
} }
} }
longRunningTest {
kotlin {
srcDir 'testLongRunning'
}
}
java9 { java9 {
java { java {
srcDir 'java9' srcDir 'java9'
@@ -59,6 +64,7 @@ configurations {
commonSources commonSources
coroutinesExperimentalTestCompile.extendsFrom(testCompile) coroutinesExperimentalTestCompile.extendsFrom(testCompile)
coroutinesExperimentalMigrationTestCompile.extendsFrom(coroutinesExperimentalTestCompile) coroutinesExperimentalMigrationTestCompile.extendsFrom(coroutinesExperimentalTestCompile)
longRunningTestCompile.extendsFrom(testCompile)
} }
dependencies { dependencies {
@@ -238,8 +244,12 @@ compileTestKotlin {
} }
} }
test { task longRunningTest(type: Test, dependsOn: longRunningTestClasses) {
if (project.hasProperty("kotlin.stdlib.test.long.sequences")) { group = "verification"
systemProperty("kotlin.stdlib.test.long.sequences", "true") testClassesDirs = sourceSets.longRunningTest.output.classesDirs
} classpath = sourceSets.longRunningTest.runtimeClasspath
}
if (project.hasProperty("kotlin.stdlib.test.long.running")) {
check.dependsOn(longRunningTest)
} }
@@ -5,18 +5,10 @@
package test.collections package test.collections
import org.junit.Assume
import org.junit.Test
import kotlin.test.* import kotlin.test.*
class IndexOverflowJVMTest { class IndexOverflowJVMTest {
@BeforeTest
fun checkIsNotIgnored() {
Assume.assumeTrue(System.getProperty("kotlin.stdlib.test.long.sequences")?.toBoolean() ?: false)
}
companion object { companion object {
fun <T> repeatCounted(value: T, count: Long = Int.MAX_VALUE + 1L): Sequence<T> = Sequence { fun <T> repeatCounted(value: T, count: Long = Int.MAX_VALUE + 1L): Sequence<T> = Sequence {
object : Iterator<T> { object : Iterator<T> {