Skip to content

Commit 1707be2

Browse files
committed
(WIP) add validation tests
1 parent 44b4e5a commit 1707be2

File tree

4 files changed

+118
-0
lines changed

4 files changed

+118
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2009, 2024 Mountainminds GmbH & Co. KG and Contributors
3+
* This program and the accompanying materials are made available under
4+
* the terms of the Eclipse Public License 2.0 which is available at
5+
* http://www.eclipse.org/legal/epl-2.0
6+
*
7+
* SPDX-License-Identifier: EPL-2.0
8+
*
9+
* Contributors:
10+
* Evgeny Mandrikov - initial API and implementation
11+
*
12+
*******************************************************************************/
13+
package org.jacoco.core.test.validation.kotlin;
14+
15+
import org.jacoco.core.test.validation.ValidationTestBase;
16+
import org.jacoco.core.test.validation.kotlin.targets.KotlinInlineReifiedTarget;
17+
18+
/**
19+
* Test of code coverage in {@link KotlinInlineReifiedTarget}.
20+
*/
21+
public class KotlinInlineReifiedTest extends ValidationTestBase {
22+
23+
public KotlinInlineReifiedTest() {
24+
super(KotlinInlineReifiedTarget.class);
25+
}
26+
27+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2009, 2024 Mountainminds GmbH & Co. KG and Contributors
3+
* This program and the accompanying materials are made available under
4+
* the terms of the Eclipse Public License 2.0 which is available at
5+
* http://www.eclipse.org/legal/epl-2.0
6+
*
7+
* SPDX-License-Identifier: EPL-2.0
8+
*
9+
* Contributors:
10+
* Evgeny Mandrikov - initial API and implementation
11+
*
12+
*******************************************************************************/
13+
package org.jacoco.core.test.validation.kotlin;
14+
15+
import org.jacoco.core.test.validation.ValidationTestBase;
16+
import org.jacoco.core.test.validation.kotlin.targets.KotlinJvmSyntheticTarget;
17+
18+
/**
19+
* Test of code coverage in {@link KotlinJvmSyntheticTarget}.
20+
*/
21+
public class KotlinJvmSyntheticTest extends ValidationTestBase {
22+
23+
public KotlinJvmSyntheticTest() {
24+
super(KotlinJvmSyntheticTarget.class);
25+
}
26+
27+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2009, 2024 Mountainminds GmbH & Co. KG and Contributors
3+
* This program and the accompanying materials are made available under
4+
* the terms of the Eclipse Public License 2.0 which is available at
5+
* http://www.eclipse.org/legal/epl-2.0
6+
*
7+
* SPDX-License-Identifier: EPL-2.0
8+
*
9+
* Contributors:
10+
* Evgeny Mandrikov - initial API and implementation
11+
*
12+
*******************************************************************************/
13+
package org.jacoco.core.test.validation.kotlin.targets
14+
15+
import org.jacoco.core.test.validation.targets.Stubs.nop
16+
17+
/**
18+
* Test target containing `inline` function with
19+
* [`reified` type parameter](https://kotlinlang.org/docs/inline-functions.html#reified-type-parameters).
20+
*/
21+
object KotlinInlineReifiedTarget {
22+
23+
private inline fun <reified T> example() { // assertEmpty()
24+
nop(T::class) // assertFullyCovered()
25+
} // assertFullyCovered()
26+
27+
@JvmStatic
28+
fun main(args: Array<String>) {
29+
example<String>()
30+
}
31+
32+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2009, 2024 Mountainminds GmbH & Co. KG and Contributors
3+
* This program and the accompanying materials are made available under
4+
* the terms of the Eclipse Public License 2.0 which is available at
5+
* http://www.eclipse.org/legal/epl-2.0
6+
*
7+
* SPDX-License-Identifier: EPL-2.0
8+
*
9+
* Contributors:
10+
* Evgeny Mandrikov - initial API and implementation
11+
*
12+
*******************************************************************************/
13+
package org.jacoco.core.test.validation.kotlin.targets
14+
15+
import org.jacoco.core.test.validation.targets.Stubs.nop
16+
17+
/**
18+
* Test target containing [JvmSynthetic] function.
19+
*/
20+
object KotlinJvmSyntheticTarget {
21+
22+
@JvmSynthetic
23+
private fun example() { // assertEmpty()
24+
nop() // assertFullyCovered()
25+
} // assertFullyCovered()
26+
27+
@JvmStatic
28+
fun main(args: Array<String>) {
29+
example()
30+
}
31+
32+
}

0 commit comments

Comments
 (0)