forked from Ericsson/codechecker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[test] Add an analyze_and_parse test for review status cfg files
- Loading branch information
Showing
2 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
analyzer/tests/functional/analyze_and_parse/test_files/simple1_review_status1.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
$version: 1 | ||
rules: | ||
- filters: | ||
filepath: simple1.cpp | ||
checker_name: core.DivideZero | ||
actions: | ||
review_status: false_positive | ||
reason: Division by zero in test files is automatically intentional. |
69 changes: 69 additions & 0 deletions
69
analyzer/tests/functional/analyze_and_parse/test_files/simple1_review_status_file.output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
NORMAL#CodeChecker log --output $LOGFILE$ --build "make simple1" --quiet | ||
NORMAL#CodeChecker analyze $LOGFILE$ --output $OUTPUT$ --analyzers clangsa --review-status-config simple1_review_status1.yaml | ||
|
||
# The review status config file should've set the report to false_positive. | ||
# We expect to see the first parse to return with 'no defects', and the second | ||
# with one defect. | ||
NORMAL#CodeChecker parse $OUTPUT$ --review-status=confirmed | ||
NORMAL#CodeChecker parse $OUTPUT$ --review-status | ||
-------------------------------------------------------------------------------- | ||
[] - Starting build... | ||
[] - Using CodeChecker ld-logger. | ||
[] - Build finished successfully. | ||
[] - Starting static analysis ... | ||
[] - [1/1] clangsa analyzed simple1.cpp successfully. | ||
[] - ----==== Summary ====---- | ||
[] - Successfully analyzed | ||
[] - clangsa: 1 | ||
[] - Total analyzed compilation commands: 1 | ||
[] - ----=================---- | ||
[] - Analysis finished. | ||
[] - To view results in the terminal use the "CodeChecker parse" command. | ||
[] - To store results use the "CodeChecker store" command. | ||
[] - See --help and the user guide for further options about parsing and storing the reports. | ||
[] - ----=================---- | ||
Found no defects in simple1.cpp | ||
|
||
----======== Summary ========---- | ||
--------------------------------------------- | ||
Number of processed analyzer result files | 1 | ||
Number of analyzer reports | 0 | ||
--------------------------------------------- | ||
----=================---- | ||
[HIGH] simple1.cpp:18:15: Division by zero [core.DivideZero] | ||
return 2015 / x; | ||
^ | ||
|
||
Found 1 defect(s) in simple1.cpp | ||
|
||
|
||
----==== Severity Statistics ====---- | ||
---------------------------- | ||
Severity | Number of reports | ||
---------------------------- | ||
HIGH | 1 | ||
---------------------------- | ||
----=================---- | ||
|
||
----==== Checker Statistics ====---- | ||
---------------------------------------------- | ||
Checker name | Severity | Number of reports | ||
---------------------------------------------- | ||
core.DivideZero | HIGH | 1 | ||
---------------------------------------------- | ||
----=================---- | ||
|
||
----==== File Statistics ====---- | ||
------------------------------- | ||
File name | Number of reports | ||
------------------------------- | ||
simple1.cpp | 1 | ||
------------------------------- | ||
----=================---- | ||
|
||
----======== Summary ========---- | ||
--------------------------------------------- | ||
Number of processed analyzer result files | 1 | ||
Number of analyzer reports | 1 | ||
--------------------------------------------- | ||
----=================---- |