Skip to content

Commit

Permalink
Upgrade Kotlin to 1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Godin committed May 3, 2021
1 parent 29a2890 commit 0beb066
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 22 deletions.
6 changes: 1 addition & 5 deletions org.jacoco.core.test.validation.kotlin/pom.xml
Expand Up @@ -25,11 +25,7 @@
<name>JaCoCo :: Test :: Core :: Validation Kotlin</name>

<properties>
<!--
re-include this module in profiles for JDK 16 and 17 in org.jacoco.core.test.validation
once there is version with resolved https://youtrack.jetbrains.com/issue/KT-43704
-->
<kotlin.version>1.4.20</kotlin.version>
<kotlin.version>1.5.0</kotlin.version>
</properties>

<dependencies>
Expand Down
Expand Up @@ -24,4 +24,10 @@ public KotlinDefaultMethodsTest() {
super(KotlinDefaultMethodsTarget.class);
}

@Override
public void all_missed_instructions_should_have_line_number() {
// instructions without line numbers
// corresponding to non-executed default implementations
}

}
Expand Up @@ -47,7 +47,7 @@ object KotlinControlStructuresTarget {

private fun missedWhileBlock() {

while (f()) { // assertPartlyCovered(1, 1)
while (f()) { // assertFullyCovered(1, 1)
nop() // assertNotCovered()
}

Expand Down
Expand Up @@ -20,9 +20,9 @@ import org.jacoco.core.test.validation.targets.Stubs.nop
object KotlinDataClassTarget {

data class DataClass( // assertFullyCovered()
val valNoRead: Int, // assertNotCovered()
val valNoRead: Int, // assertPartlyCovered()
val valRead: Int, // assertFullyCovered()
var varNoReadNoWrite: Int, // assertNotCovered()
var varNoReadNoWrite: Int, // assertPartlyCovered()
var varNoWrite: Int, // assertPartlyCovered()
var varNoRead: Int, // assertPartlyCovered()
var varReadWrite: Int // assertFullyCovered()
Expand Down
Expand Up @@ -30,8 +30,8 @@ object KotlinWhenExpressionTarget {
@Suppress("REDUNDANT_ELSE_IN_WHEN")
private fun whenSealedRedundantElse(p: Sealed): Int = when (p) { // assertFullyCovered()
is Sealed.Sealed1 -> 1 // assertFullyCovered(0, 2)
is Sealed.Sealed2 -> 2 // assertFullyCovered(1, 1)
else -> throw NoWhenBranchMatchedException() // assertNotCovered()
is Sealed.Sealed2 -> 2 // assertFullyCovered(0, 0)
else -> throw NoWhenBranchMatchedException() // assertEmpty()
} // assertFullyCovered()

private enum class Enum {
Expand All @@ -44,10 +44,10 @@ object KotlinWhenExpressionTarget {
} // assertFullyCovered()

@Suppress("REDUNDANT_ELSE_IN_WHEN")
private fun whenEnumRedundantElse(p: Enum): Int = when (p) { // assertFullyCovered(1, 2)
private fun whenEnumRedundantElse(p: Enum): Int = when (p) { // assertFullyCovered(0, 2)
Enum.A -> 1 // assertFullyCovered()
Enum.B -> 2 // assertFullyCovered()
else -> throw NoWhenBranchMatchedException() // assertNotCovered()
else -> throw NoWhenBranchMatchedException() // assertEmpty()
} // assertFullyCovered()

private fun whenString(p: String): Int = when (p) { // assertFullyCovered(0, 7)
Expand Down
22 changes: 12 additions & 10 deletions org.jacoco.core.test.validation/pom.xml
Expand Up @@ -64,6 +64,9 @@
<value>6</value>
</property>
</activation>
<properties>
<kotlin.compiler.jvmTarget>1.6</kotlin.compiler.jvmTarget>
</properties>
<modules>
<module>../org.jacoco.core.test.validation.kotlin</module>
</modules>
Expand All @@ -77,6 +80,9 @@
<value>6</value>
</property>
</activation>
<properties>
<kotlin.compiler.jvmTarget>1.6</kotlin.compiler.jvmTarget>
</properties>
<modules>
<module>../org.jacoco.core.test.validation.kotlin</module>
</modules>
Expand All @@ -90,6 +96,9 @@
<value>7</value>
</property>
</activation>
<properties>
<kotlin.compiler.jvmTarget>1.6</kotlin.compiler.jvmTarget>
</properties>
<modules>
<module>../org.jacoco.core.test.validation.kotlin</module>
<module>../org.jacoco.core.test.validation.java7</module>
Expand All @@ -104,6 +113,9 @@
<value>7</value>
</property>
</activation>
<properties>
<kotlin.compiler.jvmTarget>1.6</kotlin.compiler.jvmTarget>
</properties>
<modules>
<module>../org.jacoco.core.test.validation.kotlin</module>
<module>../org.jacoco.core.test.validation.java7</module>
Expand Down Expand Up @@ -251,12 +263,7 @@
<maven.compiler.target>16</maven.compiler.target>
</properties>
<modules>
<!--
kotlin-maven-plugin versions 1.4.20 and 1.4.21 fail
due to https://openjdk.java.net/jeps/396
see https://youtrack.jetbrains.com/issue/KT-43704
<module>../org.jacoco.core.test.validation.kotlin</module>
-->
<module>../org.jacoco.core.test.validation.java7</module>
<module>../org.jacoco.core.test.validation.java8</module>
<module>../org.jacoco.core.test.validation.java14</module>
Expand All @@ -279,12 +286,7 @@
<maven.compiler.target>17</maven.compiler.target>
</properties>
<modules>
<!--
kotlin-maven-plugin versions 1.4.20 and 1.4.21 fail
due to https://openjdk.java.net/jeps/396
see https://youtrack.jetbrains.com/issue/KT-43704
<module>../org.jacoco.core.test.validation.kotlin</module>
-->
<module>../org.jacoco.core.test.validation.java7</module>
<module>../org.jacoco.core.test.validation.java8</module>
<module>../org.jacoco.core.test.validation.java14</module>
Expand Down

0 comments on commit 0beb066

Please sign in to comment.