Skip to content

Commit

Permalink
added new scripts for running clang tests for PR
Browse files Browse the repository at this point in the history
  • Loading branch information
smuzaffar committed Aug 8, 2017
1 parent 2733a2f commit 4ebf638
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions get-pr-changed-files
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
curl -s -L https://patch-diff.githubusercontent.com/raw/cms-sw/$1/pull/$2.patch | grep '^diff --git ' | sed 's|.* a/||;s| *b/.*||' | sort | uniq
25 changes: 25 additions & 0 deletions run-pr-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash -ex
PULL_REQUEST=$1
CMS_BOT_DIR=$(dirname $0)
case $CMS_BOT_DIR in /*) ;; *) CMS_BOT_DIR=$(pwd)/${CMS_BOT_DIR} ;; esac
if [ "X${WORKSPACE}" = "X" ] ; then WORKSPACE=$(pwd) ; fi

NUM_PROC=$(getconf _NPROCESSORS_ONLN)
cd $CMSSW_BASE/src
git cms-merge-topic -u ${PULL_REQUEST}
scram build -j ${NUM_PROC} llvm-ccdb
rm -rf ${CMSSW_BASE}/pr-changed-files-all.log ${CMSSW_BASE}/pr-changed-files-selected.log
${CMS_BOT_DIR}/get-pr-changed-files cmssw ${PULL_REQUEST} > ${CMSSW_BASE}/pr-changed-files-all.log
touch ${CMSSW_BASE}/pr-changed-files-selected.log
for f in $(cat ${CMSSW_BASE}/pr-changed-files-all.log | grep -v '/test/') ; do
if [ $(grep "/src/$f\"" $CMSSW_BASE/compile_commands.json | wc -l) -gt 0 ] ; then
echo $f >> ${CMSSW_BASE}/pr-changed-files-selected.log
fi
done
USER_CODE_CHECK_FILES=$(cat ${CMSSW_BASE}/pr-changed-files-selected.log | tr '\n' ' ')
if [ "${USER_CODE_CHECK_FILES}" != "" ] ; then
export USER_STYLE_CHECKS='boost-use-to-string,misc-string-compare,misc-uniqueptr-reset-release,modernize-deprecated-headers,modernize-make-shared,modernize-use-bool-literals,modernize-use-equals-delete,modernize-use-nullptr,modernize-use-override,performance-unnecessary-copy-initialization,readability-container-size-empty,readability-redundant-string-cstr,readability-static-definition-in-anonymous-namespace,readability-uniqueptr-delete-release'
export USER_CODE_CHECK_FILES
scram build -j ${NUM_PROC} style > ${WORKSPACE}/clang-tidy.log 2>&1
git diff > ${WORKSPACE}/${PULL_REQUEST}.diff
fi

0 comments on commit 4ebf638

Please sign in to comment.