Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
4d3516f6
Commit
4d3516f6
authored
May 16, 2018
by
Simon Giesecke
Committed by
Simon Giesecke
May 24, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: no static analysis under Linux
Solution: activate clang-tidy, scan-build and sonar-scanner
parent
2b31e50b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
5 deletions
+73
-5
.travis.yml
.travis.yml
+20
-0
ci_build.sh
builds/cmake/ci_build.sh
+53
-5
No files found.
.travis.yml
View file @
4d3516f6
...
...
@@ -93,6 +93,18 @@ matrix:
-
llvm-toolchain-trusty-5.0
packages
:
-
clang-5.0
-
env
:
BUILD_TYPE=cmake CLANG_TIDY=/usr/bin/clang-tidy-6.0 CC=clang-6.0 CXX=clang++-6.0
os
:
linux
compiler
:
clang
addons
:
apt
:
sources
:
-
ubuntu-toolchain-r-test
-
llvm-toolchain-trusty-6.0
packages
:
-
clang-6.0
-
clang-tools-6.0
-
clang-tidy-6.0
-
env
:
BUILD_TYPE=default POLLER=poll
os
:
linux
-
env
:
BUILD_TYPE=default POLLER=select
...
...
@@ -103,6 +115,14 @@ sudo: false
before_install
:
-
if [ $TRAVIS_OS_NAME == "osx" -a $BUILD_TYPE == "android" ] ; then brew update; brew install binutils ; fi
-
if [ $TRAVIS_OS_NAME == "osx" -a $CURVE == "libsodium" ] ; then brew update; brew install libsodium ; fi
-
if [ -n "$CLANG_TIDY" ] ; then
curl -L https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip -o build-wrapper-linux-x86.zip ;
unzip build-wrapper-linux-x86.zip ;
export SONARCLOUD_BUILD_WRAPPER_PATH="$(pwd)/build-wrapper-linux-x86/" ;
curl -L https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-3.1.0.1141-linux.zip -o sonar-scanner-cli.zip ;
unzip sonar-scanner-cli.zip ;
export SONAR_SCANNER_CLI_PATH="$(pwd)/sonar-scanner-3.1.0.1141-linux/bin/" ;
fi
before_script
:
# ZMQ stress tests need more open socket (files) than the usual default
...
...
builds/cmake/ci_build.sh
View file @
4d3516f6
#!/usr/bin/env bash
set
-x
set
-x
-e
cd
../..
# always install custom builds from dist
# to make sure that `make dist` doesn't omit any files required to build & test
if
[
-z
$DO_CLANG_FORMAT_CHECK
]
;
then
if
[
-z
$DO_CLANG_FORMAT_CHECK
-a
-z
$CLANG_TIDY
]
;
then
./autogen.sh
./configure
make
-j5
dist-gzip
...
...
@@ -15,7 +15,7 @@ if [ -z $DO_CLANG_FORMAT_CHECK ]; then
cd
zeromq-
$V
fi
mkdir
tmp
mkdir
tmp
||
true
BUILD_PREFIX
=
$PWD
/tmp
CONFIG_OPTS
=()
...
...
@@ -47,15 +47,63 @@ elif [ $CURVE == "libsodium" ]; then
fi
fi
CMAKE_PREFIXES
=()
MAKE_PREFIXES
=()
PARALLEL_MAKE_OPT
=
"-j5"
if
[
-n
"
$CLANG_TIDY
"
]
;
then
CMAKE_OPTS+
=(
"-DCMAKE_CXX_CLANG_TIDY:STRING=
${
CLANG_TIDY
}
"
)
if
[
-n
${
SONARCLOUD_BUILD_WRAPPER_PATH
}
]
;
then
MAKE_PREFIXES+
=(
"
${
SONARCLOUD_BUILD_WRAPPER_PATH
}
build-wrapper-linux-x86-64"
)
MAKE_PREFIXES+
=(
"--out-dir"
)
MAKE_PREFIXES+
=(
"
${
TRAVIS_BUILD_DIR
}
/bw-output"
)
fi
CMAKE_PREFIXES+
=(
"scan-build-6.0"
)
MAKE_PREFIXES+
=(
"scan-build-6.0"
)
MAKE_PREFIXES+
=(
"-plist-html"
)
SCAN_BUILD_OUTPUT
=
"
$(
pwd
)
/scan-build-report"
MAKE_PREFIXES+
=(
"-o
${
SCAN_BUILD_OUTPUT
}
"
)
# TODO this does not work with sonarcloud.io as it misses the sonar-cxx plugin
#MAKE_PREFIXES+=("-plist")
IFS
=
"/"
read
-ra
GITHUB_USER
<<<
"
${
TRAVIS_REPO_SLUG
}
"
PARALLEL_MAKE_OPT
=
""
fi
# Build, check, and install from local source
mkdir
build_cmake
cd
build_cmake
if
[
"
$DO_CLANG_FORMAT_CHECK
"
-eq
"1"
]
;
then
if
[
"
$DO_CLANG_FORMAT_CHECK
"
=
"1"
]
;
then
if
!
(
PKG_CONFIG_PATH
=
${
BUILD_PREFIX
}
/lib/pkgconfig cmake
"
${
CMAKE_OPTS
[@]
}
"
..
&&
make clang-format-check
)
;
then
make clang-format-diff
exit
1
fi
else
if
[
-n
"
$CLANG_TIDY
"
]
;
then
${
CLANG_TIDY
}
-explain-config
fi
export
CTEST_OUTPUT_ON_FAILURE
=
1
(
PKG_CONFIG_PATH
=
${
BUILD_PREFIX
}
/lib/pkgconfig cmake
"
${
CMAKE_OPTS
[@]
}
"
..
&&
make
-j5
all
VERBOSE
=
1
&&
make
install
&&
make
-j5
test
ARGS
=
"-V"
)
||
exit
1
PKG_CONFIG_PATH
=
${
BUILD_PREFIX
}
/lib/pkgconfig
${
CMAKE_PREFIXES
[@]
}
cmake
"
${
CMAKE_OPTS
[@]
}
"
..
${
MAKE_PREFIXES
[@]
}
make
${
PARALLEL_MAKE_OPT
}
all
VERBOSE
=
1 |
tee
clang-tidy-report
if
[
-n
"
${
SONAR_SCANNER_CLI_PATH
}
"
]
;
then
find
${
SCAN_BUILD_OUTPUT
}
||
echo
"WARNING:
${
SCAN_BUILD_OUTPUT
}
does not exist"
${
SONAR_SCANNER_CLI_PATH
}
sonar-scanner
\
-Dsonar
.projectKey
=
libzmq-clang
\
-Dsonar
.organization
=
${
GITHUB_USER
}
-github
\
-Dsonar
.projectBaseDir
=
..
\
-Dsonar
.sources
=
${
TRAVIS_BUILD_DIR
}
/include,
${
TRAVIS_BUILD_DIR
}
/src,
${
TRAVIS_BUILD_DIR
}
/tests,
${
TRAVIS_BUILD_DIR
}
/unittests
\
-Dsonar
.cfamily.build-wrapper-output
=
${
TRAVIS_BUILD_DIR
}
/bw-output
\
-Dsonar
.host.url
=
https://sonarcloud.io
\
-Dsonar
.login
=
${
SONARQUBE_TOKEN
}
# TODO this does not work with sonarcloud.io as it misses the sonar-cxx plugin
# -Dsonar.cxx.clangtidy.reportPath=clang-tidy-report \
# -Dsonar.cxx.clangsa.reportPath=*.plist \
fi
make
install
make
${
PARALLEL_MAKE_OPT
}
test
ARGS
=
"-V"
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment