-
- Downloads
diagnostics: SARIF output: fix "executionSuccessful" §3.20.14 [PR116177]
Previously the invocation's "executionSuccessful" property (§3.20.14)
was only false if there was an ICE.
Update it so that it will also be false if we will exit with a non-zero
exit code (due to errors, Werror, and "sorry").
gcc/ChangeLog:
PR other/116177
* diagnostic-format-sarif.cc (sarif_invocation::prepare_to_flush):
If the diagnostics would lead to us exiting with a failure code,
then emit "executionSuccessful": False (SARIF v2.1.0 section
§3.20.14).
* diagnostic.cc (diagnostic_context::execution_failed_p): New.
* diagnostic.h (diagnostic_context::execution_failed_p): New decl.
* toplev.cc (toplev::main): Use it for determining returned value.
gcc/testsuite/ChangeLog:
PR other/116177
* gcc.dg/sarif-output/include-chain-2.c: Remove pruning of
"exit status is 1", as we expect this to exit with 0.
* gcc.dg/sarif-output/no-diagnostics.c: New test.
* gcc.dg/sarif-output/test-include-chain-1.py
(test_execution_unsuccessful): Add.
* gcc.dg/sarif-output/test-include-chain-2.py
(test_execution_successful): Add.
* gcc.dg/sarif-output/test-missing-semicolon.py
(test_execution_unsuccessful): Add.
* gcc.dg/sarif-output/test-no-diagnostics.py: New test.
* gcc.dg/sarif-output/test-werror.py: New test.
* gcc.dg/sarif-output/werror.c: New test.
Signed-off-by:
David Malcolm <dmalcolm@redhat.com>
Showing
- gcc/diagnostic-format-sarif.cc 2 additions, 0 deletionsgcc/diagnostic-format-sarif.cc
- gcc/diagnostic.cc 13 additions, 0 deletionsgcc/diagnostic.cc
- gcc/diagnostic.h 2 additions, 0 deletionsgcc/diagnostic.h
- gcc/testsuite/gcc.dg/sarif-output/include-chain-2.c 0 additions, 5 deletionsgcc/testsuite/gcc.dg/sarif-output/include-chain-2.c
- gcc/testsuite/gcc.dg/sarif-output/no-diagnostics.c 13 additions, 0 deletionsgcc/testsuite/gcc.dg/sarif-output/no-diagnostics.c
- gcc/testsuite/gcc.dg/sarif-output/test-include-chain-1.py 11 additions, 0 deletionsgcc/testsuite/gcc.dg/sarif-output/test-include-chain-1.py
- gcc/testsuite/gcc.dg/sarif-output/test-include-chain-2.py 11 additions, 0 deletionsgcc/testsuite/gcc.dg/sarif-output/test-include-chain-2.py
- gcc/testsuite/gcc.dg/sarif-output/test-missing-semicolon.py 11 additions, 0 deletionsgcc/testsuite/gcc.dg/sarif-output/test-missing-semicolon.py
- gcc/testsuite/gcc.dg/sarif-output/test-no-diagnostics.py 31 additions, 0 deletionsgcc/testsuite/gcc.dg/sarif-output/test-no-diagnostics.py
- gcc/testsuite/gcc.dg/sarif-output/test-werror.py 39 additions, 0 deletionsgcc/testsuite/gcc.dg/sarif-output/test-werror.py
- gcc/testsuite/gcc.dg/sarif-output/werror.c 18 additions, 0 deletionsgcc/testsuite/gcc.dg/sarif-output/werror.c
- gcc/toplev.cc 1 addition, 1 deletiongcc/toplev.cc
Loading
Please register or sign in to comment