disable consistency checks in QL tests that does not hold with the current parameterized modules implementation

This commit is contained in:
Erik Krogh Kristensen
2022-06-16 23:10:09 +02:00
parent e557f233d7
commit 96eacd0ea6
3 changed files with 31 additions and 22 deletions

View File

@@ -326,11 +326,14 @@ module ModConsistency {
.regexpMatch(".*/(test|examples|ql-training|recorded-call-graph-metrics)/.*")
}
query predicate multipleResolveModuleRef(ModuleExpr me, int c, ContainerOrModule m) {
c = strictcount(ContainerOrModule m0 | resolveModuleRef(me, m0)) and
c > 1 and
resolveModuleRef(me, m)
}
// This can happen with parameterized modules.
/*
* query predicate multipleResolveModuleRef(ModuleExpr me, int c, ContainerOrModule m) {
* c = strictcount(ContainerOrModule m0 | resolveModuleRef(me, m0)) and
* c > 1 and
* resolveModuleRef(me, m)
* }
*/
query predicate noName(Module mod) { not exists(mod.getName()) }

View File

@@ -174,17 +174,20 @@ module PredConsistency {
c > 1 and
resolvePredicateExpr(pe, p)
}
// This can happen with parametarized modules
/*
* query predicate multipleResolveCall(Call call, int c, PredicateOrBuiltin p) {
* c =
* strictcount(PredicateOrBuiltin p0 |
* resolveCall(call, p0) and
* // aliases are expected to resolve to multiple.
* not exists(p0.(ClasslessPredicate).getAlias()) and
* // overridden predicates may have multiple targets
* not p0.(ClassPredicate).isOverride()
* ) and
* c > 1 and
* resolveCall(call, p)
* }
*/
query predicate multipleResolveCall(Call call, int c, PredicateOrBuiltin p) {
c =
strictcount(PredicateOrBuiltin p0 |
resolveCall(call, p0) and
// aliases are expected to resolve to multiple.
not exists(p0.(ClasslessPredicate).getAlias()) and
// overridden predicates may have multiple targets
not p0.(ClassPredicate).isOverride()
) and
c > 1 and
resolveCall(call, p)
}
}

View File

@@ -355,11 +355,14 @@ module TyConsistency {
)
}
query predicate multipleResolve(TypeExpr te, int c, Type t) {
c = strictcount(Type t0 | resolveTypeExpr(te, t0)) and
c > 1 and
resolveTypeExpr(te, t)
}
// This can happen with parameterized modules.
/*
* query predicate multipleResolve(TypeExpr te, int c, Type t) {
* c = strictcount(Type t0 | resolveTypeExpr(te, t0)) and
* c > 1 and
* resolveTypeExpr(te, t)
* }
*/
query predicate multiplePrimitives(TypeExpr te, int c, PrimitiveType t) {
c = strictcount(PrimitiveType t0 | resolveTypeExpr(te, t0)) and