Supplement 'query-type: graph' with actual query metadata

A number of CPP library tests contain `// query-type: graph`
annotations that make the test driver compare the output
from the test query in a special mode. (This feature is
not used by other languages).

It's somewhat awkward in the implementation of `codeql test run`
that this annotation is not an ordinary item of query metadata --
essentially it means that _every_ test query has to be opened
and read an extra time to look for this annotation. I'd like
to move towards using ordinary query metadata for this, since
the QL compiler already parses it anyway.

For the time being, give the annotation in both old and new
syntaxes, until a CLI that recognizes both has been released.
This commit is contained in:
Henning Makholm
2024-10-22 19:56:15 +02:00
parent 16fe7a2fbe
commit 3d8d340f2a
19 changed files with 114 additions and 19 deletions

View File

@@ -1,4 +1,9 @@
// query-type: graph
/**
* query-type: graph
*
* @kind graph-equivalence-test
*/
import cpp
class DestructorCallEnhanced extends DestructorCall {

View File

@@ -1,4 +1,9 @@
// query-type: graph
/**
* query-type: graph
*
* @kind graph-equivalence-test
*/
import cpp
class DestructorCallEnhanced extends DestructorCall {

View File

@@ -1,4 +1,9 @@
// query-type: graph
/**
* query-type: graph
*
* @kind graph-equivalence-test
*/
import cpp
class DestructorCallEnhanced extends DestructorCall {

View File

@@ -1,4 +1,9 @@
// query-type: graph
/**
* query-type: graph
*
* @kind graph-equivalence-test
*/
import cpp
class DestructorCallEnhanced extends DestructorCall {

View File

@@ -1,4 +1,9 @@
// query-type: graph
/**
* query-type: graph
*
* @kind graph-equivalence-test
*/
import cpp
class DestructorCallEnhanced extends DestructorCall {

View File

@@ -1,4 +1,9 @@
// query-type: graph
/**
* query-type: graph
*
* @kind graph-equivalence-test
*/
import cpp
class DestructorCallEnhanced extends DestructorCall {

View File

@@ -1,4 +1,9 @@
// query-type: graph
/**
* query-type: graph
*
* @kind graph-equivalence-test
*/
import cpp
import semmle.code.cpp.pointsto.PointsTo

View File

@@ -1,4 +1,9 @@
// query-type: graph
/**
* query-type: graph
*
* @kind graph-equivalence-test
*/
import sbb_test
class CutCall extends SubBasicBlockCutNode {

View File

@@ -1,4 +1,9 @@
// query-type: graph
/**
* query-type: graph
*
* @kind graph-equivalence-test
*/
import sbb_test
// Note: no instance of `SubBasicBlockCutNode`

View File

@@ -1,4 +1,9 @@
// query-type: graph
/**
* query-type: graph
*
* @kind graph-equivalence-test
*/
import cpp
class DestructorCallEnhanced extends DestructorCall {

View File

@@ -1,4 +1,9 @@
// query-type: graph
/**
* query-type: graph
*
* @kind graph-equivalence-test
*/
import cpp
class DestructorCallEnhanced extends DestructorCall {

View File

@@ -1,4 +1,9 @@
// query-type: graph
/**
* query-type: graph
*
* @kind graph-equivalence-test
*/
import cpp
class DestructorCallEnhanced extends DestructorCall {

View File

@@ -1,4 +1,9 @@
// query-type: graph
/**
* query-type: graph
*
* @kind graph-equivalence-test
*/
import cpp
class DestructorCallEnhanced extends DestructorCall {

View File

@@ -1,4 +1,9 @@
// query-type: graph
/**
* query-type: graph
*
* @kind graph-equivalence-test
*/
import cpp
class DestructorCallEnhanced extends DestructorCall {

View File

@@ -1,4 +1,9 @@
// query-type: graph
/**
* query-type: graph
*
* @kind graph-equivalence-test
*/
import cpp
class DestructorCallEnhanced extends DestructorCall {

View File

@@ -1,4 +1,9 @@
// query-type: graph
/**
* query-type: graph
*
* @kind graph-equivalence-test
*/
import cpp
class DestructorCallEnhanced extends DestructorCall {

View File

@@ -1,4 +1,9 @@
// query-type: graph
/**
* query-type: graph
*
* @kind graph-equivalence-test
*/
import cpp
class DestructorCallEnhanced extends DestructorCall {

View File

@@ -1,4 +1,9 @@
// query-type: graph
/**
* query-type: graph
*
* @kind graph-equivalence-test
*/
import cpp
class DestructorCallEnhanced extends DestructorCall {

View File

@@ -1,4 +1,9 @@
// query-type: graph
/**
* query-type: graph
*
* @kind graph-equivalence-test
*/
import cpp
class DestructorCallEnhanced extends DestructorCall {