[S] Change in openvpn[master]: run-cppcheck.sh: Make it more configurable

"flichtenheld \(Code Review\) via Openvpn-devel" <[email protected]>
Newsgroups gmane.network.openvpn.devel
Message-ID <d22c57fe72647d0dabd6c1a60ff27c08226f3539-EmailReplacePatchSet-HTML@gerrit.openvpn.net>
Attention is currently required from: plaisthos, razvanc.

Hello plaisthos, 

I'd like you to reexamine a change. Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1868?usp=email

to look at the new patch set (#3).


Change subject: run-cppcheck.sh: Make it more configurable
......................................................................

run-cppcheck.sh: Make it more configurable

- Allow to easily control verbosity and automatically
  adjust to the verbosity of the Make run
- Allow to easily control check level. With exhaustive the
  check can take hours (due to options.c), so we couldn't
  use that in CI

v3:
- Use AM_V_P instead of V to correctly reflect
  AM_DEFAULT_VERBOSITY

Change-Id: I65beb37a2d822333aa888de1baf11dfcb8490e90
Signed-off-by: Frank Lichtenheld <[email protected]>
---
M Makefile.am
M dev-tools/run-cppcheck.sh
2 files changed, 19 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/68/1868/3

diff --git a/Makefile.am b/Makefile.am
index feeaabb..dd6cee6 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -96,4 +96,5 @@
 	BUILD_DIR="$(abs_top_builddir)" \
 	SOURCE_DIR="$(abs_top_srcdir)" \
 	INCLUDE_FLAGS="$(LIBNL_GENL_CFLAGS)" \
+	CPPCHECK_VERBOSE="$(AM_V_P)" \
 		"$(top_srcdir)/dev-tools/run-cppcheck.sh"
diff --git a/dev-tools/run-cppcheck.sh b/dev-tools/run-cppcheck.sh
index a7aa3c4..fc14405 100755
--- a/dev-tools/run-cppcheck.sh
+++ b/dev-tools/run-cppcheck.sh
@@ -2,22 +2,37 @@
 
 set -eu
 
+: ${CPPCHECK_VERBOSE:=false}
+: ${CPPCHECK_CHECK_LEVEL:=exhaustive}
+
+if "${CPPCHECK_VERBOSE}"; then
+    verbosity_arg="-v"
+else
+    verbosity_arg="-q"
+fi
+
+disable_arg=
+if [ "${CPPCHECK_CHECK_LEVEL}" != exhaustive ]; then
+    # suppress all the information that we should use exhaustive
+    disable_arg="--disable=information"
+fi
+
 SCRIPT_DIR=$(dirname $(readlink -e "${BASH_SOURCE[0]}"))
 : ${SOURCE_DIR:=$SCRIPT_DIR/..}
 : ${BUILD_DIR:=$PWD}
 : ${INCLUDE_FLAGS:=}
 CPPCHECK_DIR="${BUILD_DIR}/cppcheck_build_dir"
-COMMON_ARGS="-j$(nproc) -q \
+COMMON_ARGS="-j$(nproc) ${verbosity_arg} \
  -DMBEDTLS_SSL_PROTO_TLS1_3 -DMBEDTLS_SSL_KEYING_MATERIAL_EXPORT \
  -I./include/ -I./tests/unit_tests/openvpn/ \
  -I./src/compat/ -I./src/openvpn/ -I./src/openvpnserv/ -I./src/plugins/auth-pam/ \
  -I${BUILD_DIR} -I${BUILD_DIR}/include/ \
- --enable=all \
+ --enable=all ${disable_arg} \
  --library=${SCRIPT_DIR}/openvpn-cppcheck-library.cfg \
  --library=openssl.cfg \
  --suppressions-list=${SCRIPT_DIR}/cppcheck-suppression \
  --cppcheck-build-dir=${CPPCHECK_DIR} \
- --check-level=exhaustive --max-configs=10 \
+ --check-level=${CPPCHECK_CHECK_LEVEL} --max-configs=10 \
  --error-exitcode=1"
 
 set -x

-- 
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1868?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I65beb37a2d822333aa888de1baf11dfcb8490e90
Gerrit-Change-Number: 1868
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <[email protected]>
Gerrit-Reviewer: plaisthos <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-CC: razvanc <[email protected]>
Gerrit-Attention: plaisthos <[email protected]>
Gerrit-Attention: razvanc <[email protected]>

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.