Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/ci/jenkins/bin/clang-analyzer.sh b/ci/jenkins/bin/clang-analyzer.sh
- index 81e6ba4d8..6c7abdc19 100755
- --- a/ci/jenkins/bin/clang-analyzer.sh
- +++ b/ci/jenkins/bin/clang-analyzer.sh
- @@ -25,6 +25,7 @@
- LLVM_BASE=${LLVM:-/opt/llvm}
- NPROCS=${NPROCS:-$(getconf _NPROCESSORS_ONLN)}
- NOCLEAN=${NOCLEAN:-}
- +OUTPUT_BASE=${OUTPUT_BASE:-/home/jenkins/clang-analyzer}
- # Options
- options="--status-bugs --keep-empty"
- @@ -43,12 +44,23 @@ checkers="-enable-checker alpha.unix.cstring.BufferOverlap \
- test -z "${ATS_MAKE}" && ATS_MAKE="make"
- test ! -z "${WORKSPACE}" && cd "${WORKSPACE}/src"
- -# Check to see if this is a Github PR build (so not a github branch per-se)
- -test "${JOB_NAME#*-github}" != "${JOB_NAME}" && ATS_BRANCH="github"
- -
- # Where to store the results, special case for the CI
- output="/tmp"
- -test -w "/home/jenkins/clang-analyzer/${ATS_BRANCH}" && output="/home/jenkins/clang-analyzer/${ATS_BRANCH}"
- +
- +# Find a Jenkins output tree if possible
- +if [ "${JOB_NAME#*-github}" != "${JOB_NAME}" ]; then
- + # This is a Github PR build, override the branch name accordingly
- + ATS_BRANCH="github"
- + if [ -w "${OUTPUT_BASE}/${ATS_BRANCH}" ]; then
- + output="${OUTPUT_BASE}/${ATS_BRANCH}/${ghprbPullId}"
- + [ ! -d "${output}}"] && mkdir "${output}"
- + fi
- + github_pr=" PR #${ghprbPullId}"
- +else
- + test -w "${OUTPUT_BASE}/${ATS_BRANCH}" && output="${OUTPUT_BASE}/${ATS_BRANCH}"
- + github_pr=""
- +fi
- +
- # Tell scan-build to use clang as the underlying compiler to actually build
- # source. If you don't do this, it will default to GCC.
- @@ -62,7 +74,9 @@ ${LLVM_BASE}/bin/scan-build ./configure ${configure}
- # without scan-build. The subsequent make will then skip it.
- ${ATS_MAKE} -j $NPROCS -C lib all-local V=1 Q=
- -${LLVM_BASE}/bin/scan-build ${checkers} ${options} -o ${output} --html-title="clang-analyzer: ${ATS_BRANCH}" ${ATS_MAKE} -j $NPROCS V=1 Q=
- +${LLVM_BASE}/bin/scan-build ${checkers} ${options} -o ${output} \
- + --html-title="clang-analyzer: ${ATS_BRANCH}${github_pr}"\
- + ${ATS_MAKE} -j $NPROCS V=1 Q=
- status=$?
- # Clean the work area unless NOCLEAN is set. This is jsut for debugging when you
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement