Kotlin: Add an integration test for extractor information

This commit is contained in:
Ian Lynagh
2023-08-22 12:37:50 +01:00
parent c67cc23e07
commit deaf912cb8
6 changed files with 27 additions and 1 deletions

View File

@@ -0,0 +1,7 @@
| Number of files with extension jar | 1 |
| Number of files with extension kt | 1 |
| Number of lines of code | 2 |
| Number of lines of code with extension kt | 2 |
| Total number of lines | 3 |
| Total number of lines with extension kt | 3 |
| Uses Kotlin 2: false | 1 |

View File

@@ -0,0 +1,13 @@
extensions:
- addsTo:
pack: codeql/java-queries
extensible: extractorInformationSkipKey
data:
# These will have unstable values, as they are dependent on the
# JDK that the test is run with, so filter them out:
- ["Number of files"]
- ["Number of files with extension class"]
# These depend on the Kotlin version you have installed
- ["Kotlin Compiler Version: %"]
- ["Kotlin Extractor Name: %"]

View File

@@ -0,0 +1 @@
Telemetry/ExtractorInformation.ql

View File

@@ -0,0 +1,2 @@
class SomeClass {
}

View File

@@ -0,0 +1,3 @@
from create_database_utils import *
run_codeql_database_create(["kotlinc SomeClass.kt"], lang="java")

View File

@@ -87,7 +87,7 @@ predicate extractorTotalDiagnostics(string key, int value) {
from string key, int value
where
not extractorInformationSkipKey(key) and
not exists(string pattern | extractorInformationSkipKey(pattern) and key.matches(pattern)) and
(
compilationInfo(key, value) or
fileCount(key, value) or