Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions csharp/ql/integration-tests/windows/subst/code/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class Program
{
static void Main() {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
5 changes: 5 additions & 0 deletions csharp/ql/integration-tests/windows/subst/code/global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"sdk": {
"version": "9.0.201"
}
}
8 changes: 8 additions & 0 deletions csharp/ql/integration-tests/windows/subst/file.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
| code/Program.cs:0:0:0:0 | code/Program.cs | |
| code/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs:0:0:0:0 | code/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs | |
| code/obj/Debug/net9.0/dotnet_build.AssemblyInfo.cs:0:0:0:0 | code/obj/Debug/net9.0/dotnet_build.AssemblyInfo.cs | |
| code/obj/Debug/net9.0/dotnet_build.GlobalUsings.g.cs:0:0:0:0 | code/obj/Debug/net9.0/dotnet_build.GlobalUsings.g.cs | |
| code/obj/Debug/net9.0/dotnet_build.dll:0:0:0:0 | code/obj/Debug/net9.0/dotnet_build.dll | |
| file://:0:0:0:0 | | |
| file://Z:/dotnet_build.csproj:0:0:0:0 | Z:/dotnet_build.csproj | relative |
| file://Z:/obj/dotnet_build.csproj.nuget.g.props:0:0:0:0 | Z:/obj/dotnet_build.csproj.nuget.g.props | relative |
7 changes: 7 additions & 0 deletions csharp/ql/integration-tests/windows/subst/file.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import csharp

from File f, string relative
where
not f.getURL().matches("file://C:/Program Files/%") and
if exists(f.getRelativePath()) then relative = "relative" else relative = ""
select f, relative
7 changes: 7 additions & 0 deletions csharp/ql/integration-tests/windows/subst/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import runs_on


@runs_on.windows
def test(codeql, csharp, cwd, subst_drive):
drive = subst_drive(cwd / "code")
codeql.database.create(source_root=drive)
3 changes: 3 additions & 0 deletions go/ql/integration-tests/subst/code/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package main

func main() {}
1 change: 1 addition & 0 deletions go/ql/integration-tests/subst/file.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
| file://Z:/main.go:0:0:0:0 | Z:/main.go | relative |
5 changes: 5 additions & 0 deletions go/ql/integration-tests/subst/file.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import go

from File f, string relative
where if exists(f.getRelativePath()) then relative = "relative" else relative = ""
select f, relative
7 changes: 7 additions & 0 deletions go/ql/integration-tests/subst/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import runs_on


@runs_on.windows
def test(codeql, go, cwd, subst_drive):
drive = subst_drive(cwd / "code")
codeql.database.create(command="go build main.go", source_root=drive)
4 changes: 4 additions & 0 deletions java/ql/integration-tests/java/subst/code/test1.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class test {
public static void main(String[] args) {
}
}
1 change: 1 addition & 0 deletions java/ql/integration-tests/java/subst/code/test2.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fun main() {}
5 changes: 5 additions & 0 deletions java/ql/integration-tests/java/subst/file.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
| file://:0:0:0:0 | | |
| file://:0:0:0:0 | | |
| file://Z:/test1.java:0:0:0:0 | test1 | relative |
| file://Z:/test2.kt:0:0:0:0 | test2 | relative |
| file://Z:/test.class:0:0:0:0 | test | relative |
9 changes: 9 additions & 0 deletions java/ql/integration-tests/java/subst/file.ql
Original file line number Diff line number Diff line change
@@ -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("%/semmle-code/semmle-code/%") and
if exists(f.getRelativePath()) then relative = "relative" else relative = ""
select f, relative
7 changes: 7 additions & 0 deletions java/ql/integration-tests/java/subst/test.py
Original file line number Diff line number Diff line change
@@ -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)
1 change: 1 addition & 0 deletions javascript/ql/integration-tests/subst/code/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
function interesting() { }
1 change: 1 addition & 0 deletions javascript/ql/integration-tests/subst/code/test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
2 changes: 2 additions & 0 deletions javascript/ql/integration-tests/subst/file.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
| file://Z:/main.js:0:0:0:0 | Z:/main.js | relative |
| file://Z:/test.ts:0:0:0:0 | Z:/test.ts | relative |
7 changes: 7 additions & 0 deletions javascript/ql/integration-tests/subst/file.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import javascript

from File f, string relative
where
not f.getURL().matches("%/semmle-code/semmle-code/%") and
if exists(f.getRelativePath()) then relative = "relative" else relative = ""
select f, relative
7 changes: 7 additions & 0 deletions javascript/ql/integration-tests/subst/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import runs_on


@runs_on.windows
def test(codeql, javascript, cwd, subst_drive):
drive = subst_drive(cwd / "code")
codeql.database.create(source_root=drive)
1 change: 1 addition & 0 deletions python/ql/integration-tests/subst/code/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print(0)
1 change: 1 addition & 0 deletions python/ql/integration-tests/subst/file.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
| code/main.py:0:0:0:0 | code/main.py | |
5 changes: 5 additions & 0 deletions python/ql/integration-tests/subst/file.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import python

from File f, string relative
where if exists(f.getRelativePath()) then relative = "relative" else relative = ""
select f, relative
7 changes: 7 additions & 0 deletions python/ql/integration-tests/subst/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import runs_on


@runs_on.windows
def test(codeql, python, cwd, subst_drive):
drive = subst_drive(cwd / "code")
codeql.database.create(source_root=drive)
1 change: 1 addition & 0 deletions ruby/ql/integration-tests/subst/code/test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
2 changes: 2 additions & 0 deletions ruby/ql/integration-tests/subst/file.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
| code/test.rb:0:0:0:0 | code/test.rb | |
| file://:0:0:0:0 | | |
5 changes: 5 additions & 0 deletions ruby/ql/integration-tests/subst/file.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import ruby

from File f, string relative
where if exists(f.getRelativePath()) then relative = "relative" else relative = ""
select f, relative
7 changes: 7 additions & 0 deletions ruby/ql/integration-tests/subst/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import runs_on


@runs_on.windows
def test(codeql, ruby, cwd, subst_drive):
drive = subst_drive(cwd / "code")
codeql.database.create(source_root=drive)
1 change: 1 addition & 0 deletions rust/ql/integration-tests/subst/code/test.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fn main() {}
2 changes: 2 additions & 0 deletions rust/ql/integration-tests/subst/file.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
| code/test.rs:0:0:0:0 | code/test.rs | |
| file://:0:0:0:0 | | |
7 changes: 7 additions & 0 deletions rust/ql/integration-tests/subst/file.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import rust

from File f, string relative
where
not f.getURL().matches("%/semmle-code/semmle-code/%") and
if exists(f.getRelativePath()) then relative = "relative" else relative = ""
select f, relative
7 changes: 7 additions & 0 deletions rust/ql/integration-tests/subst/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import runs_on


@runs_on.windows
def test(codeql, rust, cwd, subst_drive):
drive = subst_drive(cwd / "code")
codeql.database.create(source_root=drive)
Loading