mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01: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.
31 lines
1.0 KiB
Plaintext
31 lines
1.0 KiB
Plaintext
// generated by {{generator}}, do not edit
|
|
|
|
import {{elements_module}}
|
|
import TestUtils
|
|
|
|
query predicate instances({{class_name}} x{{#show_ql_class}}, string primaryQlClasses{{/show_ql_class}}{{#properties}}{{#is_total}}, string {{getter}}__label, {{#type}}{{.}}{{/type}}{{^type}}string{{/type}} {{getter}}{{/is_total}}{{/properties}}) {
|
|
toBeTested(x) and not x.isUnknown()
|
|
{{#show_ql_class}}
|
|
and primaryQlClasses = x.getPrimaryQlClasses()
|
|
{{/show_ql_class}}
|
|
{{#properties}}
|
|
{{#is_total}}
|
|
and {{getter}}__label = "{{getter}}:"
|
|
{{#type}}
|
|
and {{getter}} = x.{{getter}}()
|
|
{{/type}}
|
|
{{^type}}
|
|
and if x.{{getter}}() then {{getter}} = "yes" else {{getter}} = "no"
|
|
{{/type}}
|
|
{{/is_total}}
|
|
{{/properties}}
|
|
}
|
|
|
|
{{#properties}}
|
|
{{^is_total}}
|
|
query predicate {{getter}}({{class_name}} x{{#is_indexed}}, int index{{/is_indexed}}, {{type}} {{getter}}) {
|
|
toBeTested(x) and not x.isUnknown() and {{getter}} = x.{{getter}}({{#is_indexed}}index{{/is_indexed}})
|
|
}
|
|
{{/is_total}}
|
|
{{/properties}}
|