| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-Werror=unused-variable -fdiagnostics-format=sarif-file" } */ |
| 3 |
|
| 4 |
/* Verify our SARIF output for a translation unit with -Werror. */ |
| 5 |
|
| 6 |
static int ununsed; |
| 7 |
|
| 8 |
/* We expect a failing compile due to the Werror, but the use of |
| 9 |
-fdiagnostics-format=sarif-file means there should be no output to stderr. |
| 10 |
DejaGnu injects this message; ignore it: |
| 11 |
{ dg-prune-output "exit status is 1" } */ |
| 12 |
|
| 13 |
/* Verify that some JSON was written to a file with the expected name: |
| 14 |
{ dg-final { verify-sarif-file } } */ |
| 15 |
|
| 16 |
/* Use a Python script to verify various properties about the generated |
| 17 |
.sarif file: |
| 18 |
{ dg-final { run-sarif-pytest werror.c "werror.py" } } */ |