mirror of
https://github.com/github/codeql.git
synced 2026-04-27 17:55:19 +02:00
Rust: update integration tests
This commit is contained in:
committed by
Tom Hvitved
parent
c69aa224c7
commit
1eaa491f39
@@ -1,27 +1,5 @@
|
||||
import codeql.rust.elements.internal.ExtractorStep
|
||||
|
||||
private class Step instanceof ExtractorStep {
|
||||
string toString() {
|
||||
result = super.getAction() + "(" + this.getFilePath() + ")"
|
||||
or
|
||||
not super.hasFile() and result = super.getAction()
|
||||
}
|
||||
|
||||
private string getFilePath() {
|
||||
exists(File file | file = super.getFile() |
|
||||
exists(file.getRelativePath()) and result = file.getAbsolutePath()
|
||||
or
|
||||
not exists(file.getRelativePath()) and result = "/" + file.getBaseName()
|
||||
)
|
||||
}
|
||||
|
||||
predicate hasLocationInfo(
|
||||
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
||||
) {
|
||||
super.hasLocationInfo(_, startline, startcolumn, endline, endcolumn) and
|
||||
filepath = this.getFilePath()
|
||||
}
|
||||
}
|
||||
|
||||
from Step step
|
||||
from ExtractorStep step
|
||||
where not step.getAction() = ["ParseLibrary", "ExtractLibrary"]
|
||||
select step
|
||||
|
||||
@@ -1,27 +1,5 @@
|
||||
import codeql.rust.elements.internal.ExtractorStep
|
||||
|
||||
private class Step instanceof ExtractorStep {
|
||||
string toString() {
|
||||
result = super.getAction() + "(" + this.getFilePath() + ")"
|
||||
or
|
||||
not super.hasFile() and result = super.getAction()
|
||||
}
|
||||
|
||||
private string getFilePath() {
|
||||
exists(File file | file = super.getFile() |
|
||||
exists(file.getRelativePath()) and result = file.getAbsolutePath()
|
||||
or
|
||||
not exists(file.getRelativePath()) and result = "/" + file.getBaseName()
|
||||
)
|
||||
}
|
||||
|
||||
predicate hasLocationInfo(
|
||||
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
||||
) {
|
||||
super.hasLocationInfo(_, startline, startcolumn, endline, endcolumn) and
|
||||
filepath = this.getFilePath()
|
||||
}
|
||||
}
|
||||
|
||||
from Step step
|
||||
from ExtractorStep step
|
||||
where not step.getAction() = ["ParseLibrary", "ExtractLibrary"]
|
||||
select step
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import rust
|
||||
|
||||
from Item i, MacroItems items, int index, Item expanded
|
||||
where i.getAttributeMacroExpansion() = items and items.getItem(index) = expanded
|
||||
where i.fromSource() and i.getAttributeMacroExpansion() = items and items.getItem(index) = expanded
|
||||
select i, index, expanded
|
||||
|
||||
@@ -1,27 +1,5 @@
|
||||
import codeql.rust.elements.internal.ExtractorStep
|
||||
|
||||
private class Step instanceof ExtractorStep {
|
||||
string toString() {
|
||||
result = super.getAction() + "(" + this.getFilePath() + ")"
|
||||
or
|
||||
not super.hasFile() and result = super.getAction()
|
||||
}
|
||||
|
||||
private string getFilePath() {
|
||||
exists(File file | file = super.getFile() |
|
||||
exists(file.getRelativePath()) and result = file.getAbsolutePath()
|
||||
or
|
||||
not exists(file.getRelativePath()) and result = "/" + file.getBaseName()
|
||||
)
|
||||
}
|
||||
|
||||
predicate hasLocationInfo(
|
||||
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
||||
) {
|
||||
super.hasLocationInfo(_, startline, startcolumn, endline, endcolumn) and
|
||||
filepath = this.getFilePath()
|
||||
}
|
||||
}
|
||||
|
||||
from Step step
|
||||
from ExtractorStep step
|
||||
where not step.getAction() = ["ParseLibrary", "ExtractLibrary"]
|
||||
select step
|
||||
|
||||
Reference in New Issue
Block a user