提交 c4d37c49 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Improve cppcheck.sh

上级 7b26cacc
...@@ -19,10 +19,10 @@ fi ...@@ -19,10 +19,10 @@ fi
CPPCHECKS="warning,style,performance,portability,unusedFunction" CPPCHECKS="warning,style,performance,portability,unusedFunction"
XML_FILE="/tmp/mediasoup-worker-cppcheck.xml" XML_FILE="/tmp/mediasoup-worker-cppcheck.xml"
REPORT_DIR="/tmp/mediasoup-worker-cppcheck-report" HTML_REPORT_DIR="/tmp/mediasoup-worker-cppcheck-report"
echo ">>> [INFO] running cppcheck ..." echo ">>> [INFO] running cppcheck ..."
cppcheck --std=c++11 --enable=$CPPCHECKS -v --quiet --report-progress --inline-suppr --error-exitcode=69 -I include src --xml-version=2 2> $XML_FILE cppcheck --std=c++11 --enable=${CPPCHECKS} -v --quiet --report-progress --inline-suppr --error-exitcode=69 -I include src --xml-version=2 2> $XML_FILE
# If exit code is 1 it means that some cppcheck option is wrong, so abort. # If exit code is 1 it means that some cppcheck option is wrong, so abort.
if [ $? -eq 1 ] ; then if [ $? -eq 1 ] ; then
...@@ -30,10 +30,14 @@ if [ $? -eq 1 ] ; then ...@@ -30,10 +30,14 @@ if [ $? -eq 1 ] ; then
exit 1 exit 1
fi fi
echo ">>> [INFO] cppcheck XML report file generated in ${XML_FILE}"
echo ">>> [INFO] running cppcheck-htmlreport ..." echo ">>> [INFO] running cppcheck-htmlreport ..."
cppcheck-htmlreport --title="mediasoup-worker" --file=$XML_FILE --report-dir=$REPORT_DIR --source-dir=. > /dev/null cppcheck-htmlreport --title="mediasoup-worker" --file=${XML_FILE} --report-dir=${HTML_REPORT_DIR} --source-dir=. > /dev/null
echo ">>> [INFO] cppcheck HTML report generated in ${HTML_REPORT_DIR}"
echo ">>> [INFO] opening HTML report ..." if type "open" &> /dev/null; then
open $REPORT_DIR/index.html echo ">>> [INFO] opening HTML report ..."
ening HTML report ..." open ${HTML_REPORT_DIR}/index.html
open $REPORT_DIR/index.html fi
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论