mirror of
https://github.com/github/codeql.git
synced 2026-07-02 01:55:31 +02:00
Merge pull request #22087 from jketema/subst
Add Windows integration tests showing that `subst` is handled inconsistently
This commit is contained in:
4
java/ql/integration-tests/java/subst/code/test1.java
Normal file
4
java/ql/integration-tests/java/subst/code/test1.java
Normal file
@@ -0,0 +1,4 @@
|
||||
class Test {
|
||||
public static void main(String[] args) {
|
||||
}
|
||||
}
|
||||
1
java/ql/integration-tests/java/subst/code/test2.kt
Normal file
1
java/ql/integration-tests/java/subst/code/test2.kt
Normal file
@@ -0,0 +1 @@
|
||||
fun main() {}
|
||||
5
java/ql/integration-tests/java/subst/file.expected
Normal file
5
java/ql/integration-tests/java/subst/file.expected
Normal 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 |
|
||||
9
java/ql/integration-tests/java/subst/file.ql
Normal file
9
java/ql/integration-tests/java/subst/file.ql
Normal 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
|
||||
7
java/ql/integration-tests/java/subst/test.py
Normal file
7
java/ql/integration-tests/java/subst/test.py
Normal 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)
|
||||
Reference in New Issue
Block a user