Multiplatform test annotations

Actual annotations are provided in kotlin-test-junit on JVM side
and in kotlin-test-js on JS side.

#KT-19696
This commit is contained in:
Ilya Gorbunov
2017-10-10 09:06:02 +03:00
parent 4b1b847f0a
commit f002493218
15 changed files with 146 additions and 9 deletions
@@ -1,4 +1,7 @@
package org.junit
@Suppress("NO_ACTUAL_FOR_EXPECT")
@Deprecated("Use 'Test' from kotlin.test package",
replaceWith = ReplaceWith("kotlin.test.Test", "kotlin.test.Test"),
level = DeprecationLevel.WARNING)
expect annotation class Test()
@@ -0,0 +1,45 @@
/*
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package kotlin.test.tests
import kotlin.test.*
private var value = 5
class AnnotationsTest {
@BeforeTest fun setup() {
value *= 2
}
@AfterTest fun teardown() {
value /= 2
}
@Test fun testValue() {
assertEquals(10, value)
}
@Test fun testValueAgain() {
assertEquals(10, value)
}
@Ignore @Test fun testValueWrong() {
assertEquals(20, value)
}
}
@@ -1,7 +1,6 @@
package kotlin.test.tests
import kotlin.test.*
import org.junit.Test
class BasicAssertionsTest {
@Test