Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
bb03422
tree: rewrite TChain::ParseTreeFilename to fix ROOT-8452
gganis Nov 15, 2016
a2a2c20
tree: rewrite TChain::ParseTreeFilename to fix ROOT-8452
gganis Nov 15, 2016
9112aa1
Fix for ROOT-8732 (#517)
peremato Apr 20, 2017
52f292e
JSROOT 5.1.2
linev Apr 21, 2017
3627b96
Add #include needed for compilation
pcanal Apr 21, 2017
9d98ecd
[Testing] Increase timeout of stresstmva to 30m
dpiparo Apr 22, 2017
03fc030
[Testing] increase tolerance for ARM
dpiparo Apr 22, 2017
5b55eb7
Add clang-tidy support.
vgvassilev Apr 21, 2017
f331e33
Typo.
vgvassilev Apr 22, 2017
03ec99a
Improve printout.
vgvassilev Apr 24, 2017
07403d6
Configure with testing on.
vgvassilev Apr 24, 2017
cfb7159
Install cmake only if we are about to run clang-tidy.
vgvassilev Apr 24, 2017
15fc834
Bash operator precedence is always fun. Simplify.
vgvassilev Apr 24, 2017
af6164b
Go back to the build folder, where the compilation database is.
vgvassilev Apr 24, 2017
f89c1fc
clang-tidy needs to run in the build folder.
vgvassilev Apr 24, 2017
613a7f0
Do not switch folders, add link to the compilation database. Improve …
vgvassilev Apr 24, 2017
ac4c8fb
Fix for tutorial-multicore-imt001_parBranchProcessing.
etejedor Apr 24, 2017
2ea3cc5
Add an extra protection on fSelected.
couet Apr 21, 2017
66570cc
Treat clang-tidy warnings as errors. Fixes PR wrongly marked red status.
vgvassilev Apr 24, 2017
f353d83
Avoid memory leak in TClingCallFunc. (Coverity #89968)
pcanal Apr 24, 2017
f00a9b9
Downgrade to C++11
pcanal Apr 24, 2017
2cc691d
Downgrade to C++11
pcanal Apr 24, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add clang-tidy support.
Currently, we run only a very small subset of checks (the static analysis checks).

For PRs clang-tidy reports only if the regression is triggered by one of the
modified lines.

There is a cron-job mode which is unused and it could be enabled (through travis)
in future. If enabled now, it reports multitude of issues (reports stop at 10K
lines of log due to travis limit).
  • Loading branch information
vgvassilev authored and gganis committed Apr 25, 2017
commit 5b55eb7670da002f118a453a517de346a31d775a
109 changes: 93 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ addons: &addons
cache:
apt: true
ccache: true
# directories:
# - $BUILD_DEPS


# Do not build our sync branch.
branches:
Expand All @@ -22,38 +25,112 @@ matrix:
# Abort all builds on a single failing matrix entry.
fast_finish: true

exclude:
# Note: Workaround travis-ci/travis-ci#4681
# Exclude default job which lacks our included environment variables.
- os: linux

include:
# There seems to be a hard limit to how many machines a Travis build will
# across all platforms. By interleaving OS X, the hope is to get in the
# queue faster while not blocking Linux builds from occuring.
- os: linux
env: TOOL=clang-format
addons:
apt:
sources: *sources
packages: ['clang-format-3.9']
compiler: clang

- os: linux
env: TOOL=clang-tidy
addons:
apt:
sources: *sources
packages: ['clang-3.9', 'clang-tidy-3.9', 'libstdc++-6-dev']
compiler: clang

install:
- export BUILD_DEPS="${TRAVIS_BUILD_DIR}/deps"
- mkdir ${BUILD_DEPS} && cd ${BUILD_DEPS}
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
CMAKE_URL="https://cmake.org/files/v3.6/cmake-3.6.0-Linux-x86_64.tar.gz"
mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
export PATH=${BUILD_DEPS}/cmake/bin:${PATH}
fi


# Go to the Root directory
- cd ..

script:
- echo "Copying and generating header files." && echo -en travis_fold:start:install.headers"
- |
# We need to put in place all relevant headers before running clang-tidy.
if [[ $TOOL == 'clang-tidy' ]] && \
[[ "$TRAVIS_EVENT_TYPE" = "cron" ]] || [[ "$TRAVIS_PULL_REQUEST" != "false" ]] ; then

mkdir ../build
cd ../build
export CC=clang-3.9
export CXX=clang++-3.9
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -Dall=On -Dx11=Off ../root
# We need to prebuild a minimal set of targets which are responsible for header copy
# or generation.
make -j4 move_headers intrinsics_gen ClangCommentCommandList ClangCommentCommandInfo \
ClangCommentHTMLNamedCharacterReferences ClangCommentHTMLTagsProperties \
ClangCommentNodes ClangAttrImpl ClangStmtNodes ClangAttrClasses \
ClangAttrDump ClangCommentHTMLTags ClangDeclNodes ClangAttrVisitor \
ClangDiagnosticCommon ClangARMNeon ClangDiagnosticIndexName \
ClangDiagnosticParse ClangDiagnosticComment ClangDiagnosticFrontend \
ClangDiagnosticGroups ClangDiagnosticSerialization ClangDiagnosticLex \
ClangDiagnosticSema ClangAttrList ClangAttrHasAttributeImpl \
ClangDiagnosticAST ClangDiagnosticDriver ClangDiagnosticAnalysis \
ClangDriverOptions ClangAttrParserStringSwitches ClangAttrParsedAttrList \
ClangAttrTemplateInstantiate ClangAttrSpellingListIndex \
ClangAttrParsedAttrImpl ClangAttrParsedAttrKinds
fi
- echo -en 'travis_fold:end:install.headers\\r'

- |
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
BASE_COMMIT=$(git rev-parse $TRAVIS_BRANCH)
echo "Running clang-format-3.9 against branch $TRAVIS_BRANCH, with hash $BASE_COMMIT"
COMMIT_FILES=$(git diff --name-only $BASE_COMMIT | grep -i -v LinkDef)
RESULT_OUTPUT="$(git-clang-format-3.9 --commit $BASE_COMMIT --diff --binary `which clang-format-3.9` $COMMIT_FILES)"
if [[ $TOOL == 'clang-format' ]]; then
BASE_COMMIT=$(git rev-parse $TRAVIS_BRANCH)
echo "Running clang-format-3.9 against branch $TRAVIS_BRANCH, with hash $BASE_COMMIT"
COMMIT_FILES=$(git diff --name-only $BASE_COMMIT | grep -i -v LinkDef)
RESULT_OUTPUT="$(git-clang-format-3.9 --commit $BASE_COMMIT --diff --binary `which clang-format-3.9` $COMMIT_FILES)"

if [ "$RESULT_OUTPUT" == "no modified files to format" ] \
|| [ "$RESULT_OUTPUT" == "clang-format did not modify any files" ] ; then

echo "clang-format passed."
exit 0
else
echo "clang-format failed."
echo "To reproduce it locally please run"
echo -e "\tgit checkout $TRAVIS_BRANCH"
echo -e "\tgit-clang-format --commit $BASE_COMMIT --diff --binary $(which clang-format)"
echo "$RESULT_OUTPUT"
exit 1
if [ "$RESULT_OUTPUT" == "no modified files to format" ] \
|| [ "$RESULT_OUTPUT" == "clang-format did not modify any files" ] ; then

echo "clang-format passed."
exit 0
else
echo "clang-format failed."
echo "To reproduce it locally please run"
echo -e "\tgit checkout $TRAVIS_BRANCH"
echo -e "\tgit-clang-format --commit $BASE_COMMIT --diff --binary $(which clang-format)"
echo "$RESULT_OUTPUT"
exit 1
fi
elif [[ $TOOL == 'clang-tidy' ]]; then
echo "Running clang-tidy-3.9 only against the changes in branch $TRAVIS_BRANCH."
echo "Command: git diff -U0 $TRAVIS_BRANCH..master | clang-tidy-diff-3.9.py -p1 -clang-tidy-binary \$(which clang-tidy-3.9) -checks=-*,clang-analyzer-*"

cd ../root/
# Workaround for travis issue: travis-ci/travis-ci#6069
git remote set-branches --add origin master
git fetch
git diff -U0 origin/master | clang-tidy-diff-3.9.py -p1 -clang-tidy-binary $(which clang-tidy-3.9) -checks=-*,clang-analyzer-*
fi
elif [[ "$TRAVIS_EVENT_TYPE" = "cron" ]] && [[ $TOOL == 'clang-tidy' ]]; then
# We need to ignore our vendor drops.
FILES_REGEX='^.*root\/(?!interpreter\/|core\/clib)'

echo "Running clang-tidy-3.9 against branch $TRAVIS_BRANCH."
echo "run-clang-tidy-3.9.py -j4 -clang-tidy-binary $(which clang-tidy-3.9) -checks=-*,clang-analyzer-* $FILES_REGEX"
run-clang-tidy-3.9.py -j4 -clang-tidy-binary $(which clang-tidy-3.9) -checks=-*,clang-analyzer-* $FILES_REGEX
fi

on_failure:
Expand Down