diff options
author | David Malcolm <dmalcolm@redhat.com> | 2024-06-21 08:46:14 -0400 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2024-06-21 08:46:14 -0400 |
commit | a84fe222029ff21903283cc8ee4bc760ebf80ec2 (patch) | |
tree | 9e4d62c61f193cfb1714b1fdb35a187a523e0126 /gcc/doc | |
parent | 9f4fdc3acebcf6b045edea1361570658da4bc0ab (diff) | |
download | gcc-a84fe222029ff21903283cc8ee4bc760ebf80ec2.zip gcc-a84fe222029ff21903283cc8ee4bc760ebf80ec2.tar.gz gcc-a84fe222029ff21903283cc8ee4bc760ebf80ec2.tar.bz2 |
testsuite: check that generated .sarif files validate against the SARIF schema [PR109360]
This patch extends the dg directive verify-sarif-file so that if
the "jsonschema" tool is available, it will be used to validate the
generated .sarif file.
Tested with jsonschema 3.2 with Python 3.8
gcc/ChangeLog:
PR testsuite/109360
* doc/install.texi: Mention optional usage of "jsonschema" tool.
gcc/testsuite/ChangeLog:
PR testsuite/109360
* lib/sarif-schema-2.1.0.json: New file, downloaded from
https://docs.oasis-open.org/sarif/sarif/v2.1.0/os/schemas/sarif-schema-2.1.0.json
Licensing information can be seen at
https://github.com/oasis-tcs/sarif-spec/issues/583
which states "They are free to incorporate it into their
implementation. No need for special permission or paperwork from
OASIS."
* lib/scansarif.exp (verify-sarif-file): If "jsonschema" is
available, use it to verify that the .sarif file complies with the
SARIF schema.
* lib/target-supports.exp (check_effective_target_jsonschema):
New.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/install.texi | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index 1774a01..0c76916 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi @@ -460,6 +460,11 @@ is shown below: @item g++ testsuite @code{gcov}, @code{gzip}, @code{json}, @code{os} and @code{pytest}. +@item SARIF testsuite +Tests of SARIF output will use the @code{jsonschema} program from the +@code{jsonschema} module (if available) to validate generated .sarif files. +If this tool is not found, the validation parts of those tests are skipped. + @item c++ cxx api generation @code{csv}, @code{os}, @code{sys} and @code{time}. |