Merge pull request #22087 from jketema/subst

Add Windows integration tests showing that `subst` is handled inconsistently
This commit is contained in:
Jeroen Ketema
2026-07-01 14:48:22 +02:00
committed by GitHub
32 changed files with 147 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
class Test {
public static void main(String[] args) {
}
}

View File

@@ -0,0 +1 @@
fun main() {}

View File

@@ -0,0 +1,5 @@
| file://:0:0:0:0 | | |
| file://:0:0:0:0 | | |
| file://Z:/Test.class:0:0:0:0 | Test | relative |
| file://Z:/test1.java:0:0:0:0 | test1 | relative |
| file://Z:/test2.kt:0:0:0:0 | test2 | relative |

View File

@@ -0,0 +1,9 @@
import java
from File f, string relative
where
not f.getURL().matches("file:///modules/%") and
not f.getURL().matches("file:///!unknown-binary-location/kotlin/%") and
not f.getURL().matches("%/ql/java/kotlin-extractor/%") and
if exists(f.getRelativePath()) then relative = "relative" else relative = ""
select f, relative

View File

@@ -0,0 +1,7 @@
import runs_on
@runs_on.windows
def test(codeql, java, cwd, subst_drive):
drive = subst_drive(cwd / "code")
codeql.database.create(command=["javac test1.java", "kotlinc test2.kt"], source_root=drive)