Skip to content

Commit

Permalink
Merge pull request #4151 from amaslenn/topic/azp-csclng-v1.6
Browse files Browse the repository at this point in the history
AZP: enable csclng checks — v1.6
  • Loading branch information
yosefe authored Sep 6, 2019
2 parents 28fae00 + 02584b0 commit 9da016c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 38 deletions.
68 changes: 30 additions & 38 deletions buildlib/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

trigger:
- master
- v1.6.x
- v*.*.x
pr:
- master
- v1.6.x
- v*.*.x

resources:
containers:
Expand All @@ -19,60 +19,52 @@ resources:
stages:
- stage: Build
jobs:
- job: latest_cc
displayName: Latest CCs and CppCheck
- job: static_checks
displayName: Static checks
container: fedora
steps:
- bash: ./autogen.sh
displayName: Setup autotools

- bash: |
set -eE
mkdir build-gcc && cd build-gcc
mkdir build && cd build
clang --version
gcc --version
# cscppc wraps gcc to use its output for cppcheck
export PATH="`cscppc --print-path-to-wrap`:$PATH"
cppcheck --version
../contrib/configure-release
make -j`nproc` 2>&1 | tee cc.log
displayName: GCC
displayName: Configure
- bash: |
set -eE
cd build-gcc
cppcheck --version
cppcheck_err="cppcheck.err"
# use cs* tools to keep only UCX related issues
cslinker --quiet cc.log \
| csgrep --mode=json --path $(dirname $PWD) --strip-path-prefix $(dirname $PWD) \
| csgrep --mode=json --invert-match --path 'conftest.c' \
| csgrep --mode=grep --invert-match --event "internal warning" --prune-events=1 \
> $cppcheck_err
if [ -s $cppcheck_err ]; then
echo "CppCheck found errors:"
cat $cppcheck_err
exit 100
fi
echo "No errors reported by cppcheck"
cd build
displayName: CppCheck
export PATH="`csclng --print-path-to-wrap`:`cscppc --print-path-to-wrap`:`cswrap --print-path-to-wrap`:$PATH"
make -j`nproc` 2>&1 | tee compile.log
displayName: Build
- bash: |
set -eE
mkdir build-clang && cd build-clang
clang --version
../contrib/configure-release CC=clang CXX=clang++
displayName: Configure for Clang
- bash: |
set -eE
cd build-clang
make -j`nproc`
displayName: Clang
cd build
cs_errors="cs.err"
cslinker --quiet compile.log \
| csgrep --mode=json --path $(dirname $PWD) --strip-path-prefix $(dirname $PWD) \
| csgrep --mode=json --invert-match --path 'conftest.c' \
| csgrep --mode=grep --invert-match --event "internal warning" --prune-events=1 \
> $cs_errors
if [ -s $cs_errors ]; then
echo "static checkers found errors:"
cat $cs_errors
echo "##vso[task.logissue type=error]static checkers found errors"
echo "##vso[task.complete result=Failed;]"
else
echo "No errors reported by static checkers"
fi
displayName: cstools reports
# Perform test builds on relevant distributions.
- job: Distros
Expand Down
1 change: 1 addition & 0 deletions buildlib/fedora.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ RUN dnf install -y \
automake \
clang \
cppcheck \
csclng \
cscppc \
csmock-common \
doxygen \
Expand Down

0 comments on commit 9da016c

Please sign in to comment.