mirror of
https://github.com/github/codeql.git
synced 2026-04-26 01:05:15 +02:00
This collapses all generated test QL sources into a single one per directory, using query predicates to run the different tests. This should improve the time required to run generated tests.
39 lines
1.5 KiB
Plaintext
Generated
39 lines
1.5 KiB
Plaintext
Generated
// generated by codegen, do not edit
|
|
import codeql.rust.elements
|
|
import TestUtils
|
|
|
|
query predicate instances(
|
|
ConstParam x, string getNumberOfAttrs__label, int getNumberOfAttrs, string hasDefaultVal__label,
|
|
string hasDefaultVal, string isConst__label, string isConst, string hasName__label,
|
|
string hasName, string hasTypeRepr__label, string hasTypeRepr
|
|
) {
|
|
toBeTested(x) and
|
|
not x.isUnknown() and
|
|
getNumberOfAttrs__label = "getNumberOfAttrs:" and
|
|
getNumberOfAttrs = x.getNumberOfAttrs() and
|
|
hasDefaultVal__label = "hasDefaultVal:" and
|
|
(if x.hasDefaultVal() then hasDefaultVal = "yes" else hasDefaultVal = "no") and
|
|
isConst__label = "isConst:" and
|
|
(if x.isConst() then isConst = "yes" else isConst = "no") and
|
|
hasName__label = "hasName:" and
|
|
(if x.hasName() then hasName = "yes" else hasName = "no") and
|
|
hasTypeRepr__label = "hasTypeRepr:" and
|
|
if x.hasTypeRepr() then hasTypeRepr = "yes" else hasTypeRepr = "no"
|
|
}
|
|
|
|
query predicate getAttr(ConstParam x, int index, Attr getAttr) {
|
|
toBeTested(x) and not x.isUnknown() and getAttr = x.getAttr(index)
|
|
}
|
|
|
|
query predicate getDefaultVal(ConstParam x, ConstArg getDefaultVal) {
|
|
toBeTested(x) and not x.isUnknown() and getDefaultVal = x.getDefaultVal()
|
|
}
|
|
|
|
query predicate getName(ConstParam x, Name getName) {
|
|
toBeTested(x) and not x.isUnknown() and getName = x.getName()
|
|
}
|
|
|
|
query predicate getTypeRepr(ConstParam x, TypeRepr getTypeRepr) {
|
|
toBeTested(x) and not x.isUnknown() and getTypeRepr = x.getTypeRepr()
|
|
}
|