Run scan-build during CI
This bumps the travis-ci container image to Trusty so that we have a version of clang that includes proper support for C++14.
This commit is contained in:
parent
cfca764d48
commit
97cdd8b738
4 changed files with 48 additions and 4 deletions
17
script/test
17
script/test
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
set -e
|
||||
|
||||
. script/lib.sh
|
||||
|
||||
function usage {
|
||||
cat <<-EOF
|
||||
USAGE
|
||||
|
|
@ -12,6 +14,8 @@ OPTIONS
|
|||
|
||||
-h print this message
|
||||
|
||||
-b run make under scan-build static analyzer
|
||||
|
||||
-d run tests in a debugger (either lldb or gdb)
|
||||
|
||||
-g run tests with valgrind's memcheck tool
|
||||
|
|
@ -26,6 +30,7 @@ OPTIONS
|
|||
|
||||
-z pipe tests' stderr to \`dot(1)\` to render an SVG log
|
||||
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
|
|
@ -37,8 +42,9 @@ args=()
|
|||
target=tests
|
||||
export BUILDTYPE=Test
|
||||
cmd="out/${BUILDTYPE}/${target}"
|
||||
run_scan_build=
|
||||
|
||||
while getopts "df:s:gGhpvS" option; do
|
||||
while getopts "bdf:s:gGhpvS" option; do
|
||||
case ${option} in
|
||||
h)
|
||||
usage
|
||||
|
|
@ -69,6 +75,9 @@ while getopts "df:s:gGhpvS" option; do
|
|||
S)
|
||||
mode=SVG
|
||||
;;
|
||||
b)
|
||||
run_scan_build=true
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
|
@ -78,7 +87,11 @@ else
|
|||
args+=("--reporter=singleline")
|
||||
fi
|
||||
|
||||
make $target
|
||||
if [[ ! -z "$run_scan_build" ]]; then
|
||||
scan_build make $target
|
||||
else
|
||||
make $target
|
||||
fi
|
||||
args=${args:-""}
|
||||
|
||||
if [[ -n $profile ]]; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue