ci: Run clang scan-build test as part of CI

This commit is contained in:
Benjamin Berg 2020-05-04 14:16:06 +02:00 committed by Benjamin Berg
parent 9db89e00d0
commit 0a08a6a7c0
3 changed files with 22 additions and 0 deletions

View file

@ -75,6 +75,23 @@ test_valgrind:
- ninja -C _build - ninja -C _build
- meson test -C _build --verbose --no-stdsplit --setup=valgrind - meson test -C _build --verbose --no-stdsplit --setup=valgrind
test_scan_build:
stage: test
except:
variables:
- $CI_PIPELINE_SOURCE == "schedule"
allow_failure: true
script:
- meson -Ddrivers=all . _build
# This is ugly, the wrapper disables the malloc checker
- SCANBUILD=$CI_PROJECT_DIR/.gitlab-ci/scan-build ninja -C _build scan-build
# Check that the directory is empty
- "! ls -A _build/meson-logs/scanbuild | grep -q ."
artifacts:
paths:
- _build/meson-logs
expire_in: 1 week
test_indent: test_indent:
stage: check-source stage: check-source
except: except:

View file

@ -24,3 +24,4 @@
umockdev umockdev
uncrustify uncrustify
valgrind valgrind
clang-analyzer

4
.gitlab-ci/scan-build Executable file
View file

@ -0,0 +1,4 @@
#!/bin/sh
# This wrapper just disables the malloc checker
exec /usr/bin/scan-build -disable-checker unix.Malloc "$@"