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 4, 2021
1 parent 29a2890 commit 3333dba
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 32 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
75 changes: 60 additions & 15 deletions org.jacoco.core.test.validation/pom.xml
Expand Up @@ -32,7 +32,10 @@

<properties>
<jacoco.skip>true</jacoco.skip>
<groovy.targetBytecode>${maven.compiler.target}</groovy.targetBytecode>

<!-- when bytecode.version not specified -->
<kotlin.compiler.jvmTarget>1.6</kotlin.compiler.jvmTarget>
<groovy.targetBytecode>1.8</groovy.targetBytecode>
</properties>

<profiles>
Expand Down Expand Up @@ -64,6 +67,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,10 @@
<value>7</value>
</property>
</activation>
<properties>
<!-- Kotlin compiler doesn't support 1.7 -->
<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 @@ -111,9 +121,22 @@
</profile>

<profile>
<id>java8-bytecode</id>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<modules>
<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.groovy</module>
<module>../org.jacoco.core.test.validation.scala</module>
</modules>
</profile>

<profile>
<id>java8-bytecode</id>
<activation>
<property>
<name>bytecode.version</name>
<value>8</value>
Expand All @@ -132,6 +155,26 @@
</modules>
</profile>

<profile>
<id>java9-bytecode</id>
<activation>
<property>
<name>bytecode.version</name>
<value>9</value>
</property>
</activation>
<properties>
<kotlin.compiler.jvmTarget>9</kotlin.compiler.jvmTarget>
<groovy.targetBytecode>9</groovy.targetBytecode>
</properties>
<modules>
<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.groovy</module>
</modules>
</profile>

<profile>
<id>java10-bytecode</id>
<activation>
Expand All @@ -141,7 +184,8 @@
</property>
</activation>
<properties>
<kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget>
<kotlin.compiler.jvmTarget>10</kotlin.compiler.jvmTarget>
<groovy.targetBytecode>10</groovy.targetBytecode>
</properties>
<modules>
<module>../org.jacoco.core.test.validation.kotlin</module>
Expand All @@ -160,7 +204,8 @@
</property>
</activation>
<properties>
<kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget>
<kotlin.compiler.jvmTarget>11</kotlin.compiler.jvmTarget>
<groovy.targetBytecode>11</groovy.targetBytecode>
</properties>
<modules>
<module>../org.jacoco.core.test.validation.kotlin</module>
Expand All @@ -180,7 +225,8 @@
</property>
</activation>
<properties>
<kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget>
<kotlin.compiler.jvmTarget>12</kotlin.compiler.jvmTarget>
<groovy.targetBytecode>12</groovy.targetBytecode>
</properties>
<modules>
<module>../org.jacoco.core.test.validation.kotlin</module>
Expand All @@ -200,6 +246,8 @@
</property>
</activation>
<properties>
<kotlin.compiler.jvmTarget>14</kotlin.compiler.jvmTarget>
<groovy.targetBytecode>14</groovy.targetBytecode>
<!-- see respective profile in org.jacoco.build about this override -->
<maven.compiler.source>14</maven.compiler.source>
<maven.compiler.target>14</maven.compiler.target>
Expand All @@ -223,6 +271,8 @@
</property>
</activation>
<properties>
<kotlin.compiler.jvmTarget>15</kotlin.compiler.jvmTarget>
<groovy.targetBytecode>15</groovy.targetBytecode>
<!-- see respective profile in org.jacoco.build about this override -->
<maven.compiler.source>15</maven.compiler.source>
<maven.compiler.target>15</maven.compiler.target>
Expand All @@ -246,17 +296,14 @@
</property>
</activation>
<properties>
<kotlin.compiler.jvmTarget>16</kotlin.compiler.jvmTarget>
<groovy.targetBytecode>16</groovy.targetBytecode>
<!-- see respective profile in org.jacoco.build about this override -->
<maven.compiler.source>16</maven.compiler.source>
<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 @@ -274,17 +321,15 @@
</property>
</activation>
<properties>
<!-- Kotlin compiler 1.5.0 doesn't support 17 -->
<kotlin.compiler.jvmTarget>16</kotlin.compiler.jvmTarget>
<groovy.targetBytecode>17</groovy.targetBytecode>
<!-- see respective profile in org.jacoco.build about this override -->
<maven.compiler.source>17</maven.compiler.source>
<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
10 changes: 5 additions & 5 deletions org.jacoco.doc/docroot/doc/build.html
Expand Up @@ -165,11 +165,11 @@ <h2>Compilation and testing with different JDKs</h2>
<td>6</td>
<td>6</td>
<td>6</td>
<td>7</td>
<td>7</td>
<td>7</td>
<td>7</td>
<td>7</td>
<td>6</td>
<td>6</td>
<td>6</td>
<td>6</td>
<td>6</td>
</tr>
<tr>
<td>all other modules</td>
Expand Down

0 comments on commit 3333dba

Please sign in to comment.