Advertisement
Guest User

Untitled

a guest
Apr 18th, 2017
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
LDIF 2.15 KB | None | 0 0
  1. diff --git a/ci/jenkins/bin/clang-analyzer.sh b/ci/jenkins/bin/clang-analyzer.sh
  2. index 81e6ba4d8..6c7abdc19 100755
  3. --- a/ci/jenkins/bin/clang-analyzer.sh
  4. +++ b/ci/jenkins/bin/clang-analyzer.sh
  5. @@ -25,6 +25,7 @@
  6.  LLVM_BASE=${LLVM:-/opt/llvm}
  7.  NPROCS=${NPROCS:-$(getconf _NPROCESSORS_ONLN)}
  8.  NOCLEAN=${NOCLEAN:-}
  9. +OUTPUT_BASE=${OUTPUT_BASE:-/home/jenkins/clang-analyzer}
  10.  
  11.  # Options
  12.  options="--status-bugs --keep-empty"
  13. @@ -43,12 +44,23 @@ checkers="-enable-checker alpha.unix.cstring.BufferOverlap \
  14.  test -z "${ATS_MAKE}" && ATS_MAKE="make"
  15.  test ! -z "${WORKSPACE}" && cd "${WORKSPACE}/src"
  16.  
  17. -# Check to see if this is a Github PR build (so not a github branch per-se)
  18. -test "${JOB_NAME#*-github}" != "${JOB_NAME}" && ATS_BRANCH="github"
  19. -
  20.  # Where to store the results, special case for the CI
  21.  output="/tmp"
  22. -test -w "/home/jenkins/clang-analyzer/${ATS_BRANCH}" && output="/home/jenkins/clang-analyzer/${ATS_BRANCH}"
  23. +
  24. +# Find a Jenkins output tree if possible
  25. +if [ "${JOB_NAME#*-github}" != "${JOB_NAME}" ]; then
  26. +    # This is a Github PR build, override the branch name accordingly
  27. +    ATS_BRANCH="github"
  28. +    if [ -w "${OUTPUT_BASE}/${ATS_BRANCH}" ]; then
  29. +   output="${OUTPUT_BASE}/${ATS_BRANCH}/${ghprbPullId}"
  30. +   [ ! -d "${output}}"] && mkdir "${output}"
  31. +    fi
  32. +    github_pr=" PR #${ghprbPullId}"
  33. +else
  34. +    test -w "${OUTPUT_BASE}/${ATS_BRANCH}" && output="${OUTPUT_BASE}/${ATS_BRANCH}"
  35. +    github_pr=""
  36. +fi
  37. +
  38.  
  39.  # Tell scan-build to use clang as the underlying compiler to actually build
  40.  # source. If you don't do this, it will default to GCC.
  41. @@ -62,7 +74,9 @@ ${LLVM_BASE}/bin/scan-build ./configure ${configure}
  42.  # without scan-build. The subsequent make will then skip it.
  43.  ${ATS_MAKE} -j $NPROCS -C lib all-local V=1 Q=
  44.  
  45. -${LLVM_BASE}/bin/scan-build ${checkers} ${options} -o ${output} --html-title="clang-analyzer: ${ATS_BRANCH}" ${ATS_MAKE} -j $NPROCS V=1 Q=
  46. +${LLVM_BASE}/bin/scan-build ${checkers} ${options} -o ${output} \
  47. +       --html-title="clang-analyzer: ${ATS_BRANCH}${github_pr}"\
  48. +       ${ATS_MAKE} -j $NPROCS V=1 Q=
  49.  status=$?
  50.  
  51.  # 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