mirror of
https://github.com/github/codeql.git
synced 2026-06-30 17:15:34 +02:00
Kotlin tests: roll Kotlin1 suites forward to language-version 2.0
Why this is needed: - The extractor compatibility fixes now preserve the information these Kotlin1-era tests were protecting, even when compiled with Kotlin 2.4 and `-language-version 2.0`. - Keeping mixed legacy language-version wiring in individual tests is no longer necessary and obscures the intended steady-state execution mode. What this changes: - Update all affected Kotlin1 compatibility integration tests to run with `-language-version 2.0` directly. - Keep the expected extraction signal aligned for extractor information output. - Remove the obsolete CODEOWNERS entry for the retired `java/ql/test-kotlin1/` path. This consolidates the language-version transition into a single test rollup commit, as requested. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import pathlib
|
||||
|
||||
|
||||
def test(codeql, java_full, kotlinc_2_3_20):
|
||||
def test(codeql, java_full):
|
||||
java_srcs = " ".join([str(s) for s in pathlib.Path().glob("*.java")])
|
||||
codeql.database.create(
|
||||
command=[
|
||||
f"javac {java_srcs} -d build",
|
||||
"kotlinc -language-version 1.9 user.kt -cp build",
|
||||
"kotlinc -language-version 2.0 user.kt -cp build",
|
||||
]
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import commands
|
||||
|
||||
|
||||
def test(codeql, java_full, kotlinc_2_3_20):
|
||||
commands.run("kotlinc -language-version 1.9 test.kt -d lib")
|
||||
codeql.database.create(command="kotlinc -language-version 1.9 user.kt -cp lib")
|
||||
def test(codeql, java_full):
|
||||
commands.run("kotlinc -language-version 2.0 test.kt -d lib")
|
||||
codeql.database.create(command="kotlinc -language-version 2.0 user.kt -cp lib")
|
||||
|
||||
@@ -9,4 +9,4 @@
|
||||
| Percentage of calls with call target | 100 |
|
||||
| Total number of lines | 3 |
|
||||
| Total number of lines with extension kt | 3 |
|
||||
| Uses Kotlin 2: false | 1 |
|
||||
| Uses Kotlin 2: true | 1 |
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
def test(codeql, java_full, kotlinc_2_3_20):
|
||||
codeql.database.create(command=f"kotlinc -J-Xmx2G -language-version 1.9 SomeClass.kt")
|
||||
def test(codeql, java_full):
|
||||
codeql.database.create(command="kotlinc -J-Xmx2G -language-version 2.0 SomeClass.kt")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import commands
|
||||
|
||||
|
||||
def test(codeql, java_full, kotlinc_2_3_20):
|
||||
commands.run("kotlinc -language-version 1.9 A.kt")
|
||||
codeql.database.create(command="kotlinc -cp . -language-version 1.9 B.kt C.kt")
|
||||
def test(codeql, java_full):
|
||||
commands.run("kotlinc -language-version 2.0 A.kt")
|
||||
codeql.database.create(command="kotlinc -cp . -language-version 2.0 B.kt C.kt")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import commands
|
||||
|
||||
|
||||
def test(codeql, java_full, kotlinc_2_3_20):
|
||||
def test(codeql, java_full):
|
||||
commands.run(["javac", "Test.java", "-d", "bin"])
|
||||
codeql.database.create(command="kotlinc -language-version 1.9 user.kt -cp bin")
|
||||
codeql.database.create(command="kotlinc -language-version 2.0 user.kt -cp bin")
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import commands
|
||||
|
||||
|
||||
def test(codeql, java_full, kotlinc_2_3_20):
|
||||
def test(codeql, java_full):
|
||||
# Compile the JavaDefns2 copy outside tracing, to make sure the Kotlin view of it matches the Java view seen by the traced javac compilation of JavaDefns.java below.
|
||||
commands.run(["javac", "JavaDefns2.java"])
|
||||
codeql.database.create(
|
||||
command=[
|
||||
"kotlinc kotlindefns.kt",
|
||||
"javac JavaUser.java JavaDefns.java -cp .",
|
||||
"kotlinc -language-version 1.9 -cp . kotlinuser.kt",
|
||||
"kotlinc -language-version 2.0 -cp . kotlinuser.kt",
|
||||
]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user