Commit aedf0e3c authored by Claudio André's avatar Claudio André Committed by Philip Chimento

maint: add a static code analysis 'make target'

It uses cppcheck static code analysis tool. It is harmless, and can be useful.

https://bugzilla.gnome.org/show_bug.cgi?id=783214
parent 0963b42d
......@@ -206,4 +206,11 @@ upload-release: $(DISTNAME) Makefile
scp $(DISTNAME) master.gnome.org:
ssh master.gnome.org install-module $(DISTNAME)
CPPCHECK=cppcheck
### cppcheck static code analysis
#
cppcheck:
$(CPPCHECK) --enable=warning,performance,portability,information,missingInclude --force -q $(top_srcdir) -I $(top_builddir)
-include $(top_srcdir)/git.mk
......@@ -90,6 +90,16 @@ G_DEBUG=gc-friendly G_SLICE=always-malloc ./libtool --mode=execute valgrind --le
(And a similar command to run each `minijasmine` test.)
### Static Code Analysis ###
To execute cppcheck, a static code analysis tool for the C and C++, run:
```sh
jhbuild make cppcheck
```
It is a versatile tool that can check non-standard code, including: variable
checking, bounds checking, leaks, etc. It can detect the types of bugs that
the compilers normally fail to detect.
### Test Coverage ###
To generate a test coverage report, put this in your JHBuild
......@@ -108,4 +118,4 @@ xdg-open ~/.cache/jhbuild/build/gjs/gjs-X.Y.Z-coverage/index.html
(replace `X.Y.Z` with the version number, e.g. `1.48.0`)
[jhbuild] https://wiki.gnome.org/HowDoI/Jhbuild
\ No newline at end of file
[jhbuild] https://wiki.gnome.org/HowDoI/Jhbuild
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment