mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Java: Rename integration test directories.
We are no longer bound to the platform-specific directories, so simplify the test organization. If you don't want this change, just skip merging this PR. It's purely optional. I kept the platform-specific directories around under `kotlin`, but you could also easily merge all these together if you find them unhelpful. I'll leave that change to you.
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
package extlib;
|
||||
|
||||
public class A {
|
||||
protected void m() {}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
| extlib.jar/extlib/A.class:0:0:0:0 | m | protected |
|
||||
| test.kt:4:3:4:22 | m | override, protected |
|
||||
@@ -0,0 +1,6 @@
|
||||
import extlib.A;
|
||||
|
||||
class B : A() {
|
||||
override fun m() { }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import commands
|
||||
import pathlib
|
||||
|
||||
|
||||
def test(codeql, java_full):
|
||||
# Compile Java untraced. Note the Java source is hidden under `javasrc` so the Kotlin compiler
|
||||
# will certainly reference the jar, not the source or class file for extlib.Lib
|
||||
java_srcs = pathlib.Path("libsrc", "extlib").glob("*.java")
|
||||
commands.run(["javac", *java_srcs, "-d", "build"])
|
||||
commands.run("jar cf extlib.jar -C build extlib")
|
||||
codeql.database.create(command="kotlinc test.kt -cp extlib.jar")
|
||||
@@ -0,0 +1,6 @@
|
||||
import java
|
||||
|
||||
query predicate mods(Method m, string modifiers) {
|
||||
m.getName() = "m" and
|
||||
modifiers = concat(string s | m.hasModifier(s) | s, ", ")
|
||||
}
|
||||
Reference in New Issue
Block a user