mirror of
https://github.com/github/codeql.git
synced 2026-04-26 01:05:15 +02:00
Go: Add support for provenance pretty-printing as a qltest post-process step
This commit is contained in:
committed by
Owen Mansel-Chan
parent
e1329dff72
commit
6960c5232b
18
go/ql/test/TestUtilities/PrettyPrintModels.ql
Normal file
18
go/ql/test/TestUtilities/PrettyPrintModels.ql
Normal file
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* @kind test-postprocess
|
||||
*/
|
||||
|
||||
import codeql.dataflow.test.ProvenancePathGraph
|
||||
import semmle.go.dataflow.ExternalFlow
|
||||
|
||||
external predicate queryResults(string relation, int row, int column, string data);
|
||||
|
||||
external predicate queryRelations(string relation);
|
||||
|
||||
query predicate resultRelations(string relation) { queryRelations(relation) }
|
||||
|
||||
module Res = TranslateProvenanceResults<interpretModelForTest/2, queryResults/4>;
|
||||
|
||||
from string relation, int row, int column, string data
|
||||
where Res::results(relation, row, column, data)
|
||||
select relation, row, column, data
|
||||
Reference in New Issue
Block a user