diff --git a/libraries/kotlin.test/annotations-common/build.gradle b/libraries/kotlin.test/annotations-common/build.gradle index 5988043c1b7..13d497a6172 100644 --- a/libraries/kotlin.test/annotations-common/build.gradle +++ b/libraries/kotlin.test/annotations-common/build.gradle @@ -9,6 +9,7 @@ configurePublishing(project) dependencies { compile project(':kotlin-stdlib-common') + testCompile project(":kotlin-test:kotlin-test-common") } pill { diff --git a/libraries/kotlin.test/common/src/test/kotlin/kotlin/test/tests/AnnotationsTest.kt b/libraries/kotlin.test/annotations-common/src/test/kotlin/AnnotationsTest.kt similarity index 53% rename from libraries/kotlin.test/common/src/test/kotlin/kotlin/test/tests/AnnotationsTest.kt rename to libraries/kotlin.test/annotations-common/src/test/kotlin/AnnotationsTest.kt index dd6e1340e36..319ac6e2009 100644 --- a/libraries/kotlin.test/common/src/test/kotlin/kotlin/test/tests/AnnotationsTest.kt +++ b/libraries/kotlin.test/annotations-common/src/test/kotlin/AnnotationsTest.kt @@ -8,32 +8,48 @@ package kotlin.test.tests import kotlin.test.* private var value = 5 +private var tests: MutableSet? = null class AnnotationsTest { @BeforeTest fun setup() { value *= 2 + assertNull(tests) + tests = mutableSetOf() } @AfterTest fun teardown() { value /= 2 + assertNotNull(tests).let { tests -> + assertNotEquals(emptySet(), tests) + } + tests = null + } + + private fun logTestRun(name: String) { + assertNotNull(tests).let { tests -> + assertEquals(emptySet(), tests) + tests.add(name) + } } @Test fun testValue() { assertEquals(10, value) + logTestRun("testValue") } @Test fun testValueAgain() { assertEquals(10, value) + logTestRun("testValueAgain") } @Ignore @Test - fun testValueWrong() { + fun testValueWrongIgnored() { assertEquals(20, value) }