]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/date_time/ci/cppcheck.sh
Add patch for failing prerm scripts
[ceph.git] / ceph / src / boost / libs / date_time / ci / cppcheck.sh
1 #! /bin/bash
2 #
3 # Copyright 2018 James E. King III
4 # Distributed under the Boost Software License, Version 1.0.
5 # (See accompanying file LICENSE_1_0.txt or copy at
6 # http://www.boost.org/LICENSE_1_0.txt)
7 #
8 # Bash script to run in travis to perform a cppcheck
9 # cwd should be $BOOST_ROOT before running
10 #
11
12 set -ex
13
14 # default language level: c++03
15 if [[ -z "$CXXSTD" ]]; then
16 CXXSTD=03
17 fi
18
19 # Travis' ubuntu-trusty comes with cppcheck 1.62 which is pretty old
20 # default cppcheck version: 1.82
21 if [[ -z "$CPPCHKVER" ]]; then
22 CPPCHKVER=1.82
23 fi
24
25 pushd ~
26 wget https://github.com/danmar/cppcheck/archive/$CPPCHKVER.tar.gz
27 tar xzf $CPPCHKVER.tar.gz
28 mkdir cppcheck-build
29 cd cppcheck-build
30 cmake ../cppcheck-$CPPCHKVER -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=~/cppcheck
31 make -j3 install
32 popd
33
34 ~/cppcheck/bin/cppcheck -I. --std=c++$CXXSTD --enable=all --error-exitcode=1 \
35 --force --check-config --suppress=*:boost/preprocessor/tuple/size.hpp \
36 -UBOOST_USER_CONFIG -UBOOST_COMPILER_CONFIG -UBOOST_STDLIB_CONFIG -UBOOST_PLATFORM_CONFIG \
37 libs/$SELF 2>&1 | grep -v 'Cppcheck does not need standard library headers'
38