Repository: trafficserver Updated Branches: refs/heads/master 42271ef64 -> 23fc7ea83
Update clang analyzer for jenkins Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/23fc7ea8 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/23fc7ea8 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/23fc7ea8 Branch: refs/heads/master Commit: 23fc7ea833e28c766cd48ee9f370788d6a05bd25 Parents: 42271ef Author: Leif Hedstrom <zw...@apache.org> Authored: Thu Sep 25 12:56:27 2014 -0600 Committer: Leif Hedstrom <zw...@apache.org> Committed: Thu Sep 25 12:56:27 2014 -0600 ---------------------------------------------------------------------- ci/jenkins/bin/clang-analyzer.sh | 53 +++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/23fc7ea8/ci/jenkins/bin/clang-analyzer.sh ---------------------------------------------------------------------- diff --git a/ci/jenkins/bin/clang-analyzer.sh b/ci/jenkins/bin/clang-analyzer.sh index 0a5cc1b..eb7bd36 100755 --- a/ci/jenkins/bin/clang-analyzer.sh +++ b/ci/jenkins/bin/clang-analyzer.sh @@ -17,36 +17,53 @@ # limitations under the License. +# This disables LuaJIT for now, to avoid all the warnings from it. Maybe we need +# to talk to the author of it, or ideally, figure out how to get clang-analyzer to +# ignore them ? + +# Options +options="--status-bugs --keep-empty" +configure="--enable-experimental-plugins --enable-cppapi --disable-luajit" + +# Additional checkers +# Phil says these are all FP's: -enable-checker alpha.security.ArrayBoundV2 checkers="-enable-checker alpha.unix.cstring.BufferOverlap \ - -enable-checker alpha.unix.PthreadLock\ - -enable-checker alpha.security.ArrayBoundV2 \ - -enable-checker alpha.core.BoolAssignment \ - -enable-checker alpha.core.CastSize \ - -enable-checker alpha.core.SizeofPtr" + -enable-checker alpha.unix.PthreadLock\ + -enable-checker alpha.core.BoolAssignment \ + -enable-checker alpha.core.CastSize \ + -enable-checker alpha.core.SizeofPtr" + # These shenanigans are here to allow it to run both manually, and via Jenkins test -z "${ATS_MAKE}" && ATS_MAKE="make" test ! -z "${WORKSPACE}" && cd "${WORKSPACE}/src" -# This disables LuaJIT for now, to avoid all the warnings from it. Maybe we need -# to talk to the author of it, or ideally, figure out how to get clang-analyzer to -# ignore them ? +# Where to store the results, special case for the CI +output="/tmp" +test -d "/home/jenkins/clang-analyzer" && output="/home/jenkins/clang-analyzer" + autoreconf -fi -./configure --enable-experimental-plugins --enable-cppapi --disable-luajit -scan-build ${checkers} --status-bugs -o /home/jenkins/clang-analyzer --html-title="ATS master branch" ${ATS_MAKE} -j5 +#scan-build ./configure ${configure} +./configure ${configure} +scan-build ${checkers} ${options} -o ${output} --html-title="ATS master branch" ${ATS_MAKE} -j4 status=$? ${ATS_MAKE} distclean -# Cleanup old reports (save the last 10 reports) -cd /home/jenkins/clang-analyzer || exit -1 -for old in $(\ls -1t | tail -n +11); do - rm -rf $old -done +# Cleanup old reports (save the last 10 reports), but only for the CI +if [ "/tmp" != "$output" ]; then + cd ${output} || exit -1 + for old in $(/usr/bin/ls -1t | tail -n +11); do + rm -rf $old + done + + # Setup the symlink to the latest report + rm -f latest + ln -s $(/usr/bin/ls -1t | head -1) latest -# Setup the symlink to the latest report -rm -f latest -ln -s $(\ls -1t | head -1) latest + # Purge the cached URL + curl -o /dev/null -s -X PURGE https://ci.trafficserver.apache.org/files/clang-analyzer/latest/ +fi # Exit with the scan-build exit code (thanks to --status-bugs) exit $status