Skip to content

Commit

Permalink
Add test for gcc checker disable
Browse files Browse the repository at this point in the history
  • Loading branch information
Szelethus committed Oct 12, 2023
1 parent 3093ec6 commit 16a76a6
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 7 deletions.
3 changes: 2 additions & 1 deletion analyzer/codechecker_analyzer/analyzers/gcc/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ def get_analyzer_checkers(self):
# support cppcheck)
renamed_checker_name = \
actual_name_to_codechecker_name(warning_name)
checker_list.append((renamed_checker_name, description))
checker_list.append(
(renamed_checker_name, description.strip()))
return checker_list
except (subprocess.CalledProcessError) as e:
LOG.error(e.stderr)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ CHECK#CodeChecker check --build "make gcc_simple" --output $OUTPUT$ --quiet --an
[] - To store results use the "CodeChecker store" command.
[] - See --help and the user guide for further options about parsing and storing the reports.
[] - ----=================----
[LOW] gcc_simple.cpp:5:3: double-‘free’ of ‘i’ [-Wanalyzer-double-free]
[LOW] gcc_simple.cpp:5:3: double-‘free’ of ‘i’ [gcc-double-free]
free(i);
^

Expand All @@ -34,11 +34,11 @@ LOW | 1
----=================----

----==== Checker Statistics ====----
-----------------------------------------------------
Checker name | Severity | Number of reports
-----------------------------------------------------
-Wanalyzer-double-free | LOW | 1
-----------------------------------------------------
----------------------------------------------
Checker name | Severity | Number of reports
----------------------------------------------
gcc-double-free | LOW | 1
----------------------------------------------
----=================----

----==== File Statistics ====----
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
NORMAL#CodeChecker log --output $LOGFILE$ --build "make gcc_simple" --quiet
NORMAL#CodeChecker analyze $LOGFILE$ --output $OUTPUT$ --analyzers gcc --enable=sensitive -d gcc-double-free
NORMAL#CodeChecker parse $OUTPUT$
CHECK#CodeChecker check --build "make gcc_simple" --output $OUTPUT$ --quiet --analyzers gcc --enable=sensitive -d gcc-double-free
-----------------------------------------------
[] - Starting build...
[] - Using CodeChecker ld-logger.
[] - Build finished successfully.
[] - Starting static analysis ...
[] - [1/1] gcc analyzed gcc_simple.cpp successfully.
[] - ----==== Summary ====----
[] - Successfully analyzed
[] - gcc: 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 gcc_simple.cpp

----======== Summary ========----
---------------------------------------------
Number of processed analyzer result files | 1
Number of analyzer reports | 0
---------------------------------------------
----=================----

0 comments on commit 16a76a6

Please sign in to comment.