aboutsummaryrefslogtreecommitdiff
path: root/gcc/diagnostic-format-json.cc
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2024-08-26 12:24:21 -0400
committerDavid Malcolm <dmalcolm@redhat.com>2024-08-26 12:24:21 -0400
commitaa3b950291119a2b107e3a82bb4ad35a2baa2105 (patch)
treef1f50628e004ce520fb5a812a5952f3c8026f8e5 /gcc/diagnostic-format-json.cc
parent276cc4324b9e8d97fb1018d7b78cc0ed7e77f902 (diff)
downloadgcc-aa3b950291119a2b107e3a82bb4ad35a2baa2105.zip
gcc-aa3b950291119a2b107e3a82bb4ad35a2baa2105.tar.gz
gcc-aa3b950291119a2b107e3a82bb4ad35a2baa2105.tar.bz2
testsuite: generalize support for Python tests for SARIF output
In r15-2354-g4d1f71d49e396c I added the ability to use Python to write tests of SARIF output via a new "run-sarif-pytest" based on "run-gcov-pytest", with a sarif.py support script in testsuite/gcc.dg/sarif-output. This followup patch: (a) removes the limitation of such tests needing to be in testsuite/gcc.dg/sarif-output by moving sarif.py to testsuite/lib and adding logic to add that directory to PYTHONPATH when invoking pytest. (b) uses this to replace fragile regexp-based tests in gcc.dg/plugin/diagnostic-test-paths-multithreaded-sarif.c with Python logic that verifies the structure within the generated JSON, and to add test coverage for SARIF output relating to GCC plugins. gcc/ChangeLog: * diagnostic-format-sarif.cc: Add comments noting that we don't yet capture any diagnostic_metadata::rules associated with a diagnostic. gcc/testsuite/ChangeLog: * gcc.dg/plugin/diagnostic-test-metadata-sarif.c: New test, based on diagnostic-test-metadata.c. * gcc.dg/plugin/diagnostic-test-metadata-sarif.py: New script. * gcc.dg/plugin/diagnostic-test-paths-multithreaded-sarif.c: Replace scan-sarif-file directives with run-sarif-pytest, to run... * gcc.dg/plugin/diagnostic-test-paths-multithreaded-sarif.py: ...this new test. * gcc.dg/plugin/plugin.exp (plugin_test_list): Add diagnostic-test-metadata-sarif.c. * gcc.dg/sarif-output/sarif.py: Move to... * lib/sarif.py: ...here. * lib/scansarif.exp (run-sarif-pytest): Prepend "lib" to PYTHONPATH before running python scripts. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc/diagnostic-format-json.cc')
0 files changed, 0 insertions, 0 deletions