aboutsummaryrefslogtreecommitdiffstats
path: root/.travis
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2018-03-13 23:43:55 +0100
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2018-03-13 23:43:55 +0100
commitbddf3b851e19b448d0bafb7a3b43d320731ce296 (patch)
tree04ff3c95513abff866b15a4d27e6497554cf379c /.travis
parent28aff07a970c2f1915706435dcaf21d2da150a25 (diff)
downloadblogc-bddf3b851e19b448d0bafb7a3b43d320731ce296.tar.gz
blogc-bddf3b851e19b448d0bafb7a3b43d320731ce296.tar.bz2
blogc-bddf3b851e19b448d0bafb7a3b43d320731ce296.zip
travis: add clang-analyzer
Diffstat (limited to '.travis')
-rw-r--r--.travis/targets/clang-analyzer.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/.travis/targets/clang-analyzer.sh b/.travis/targets/clang-analyzer.sh
new file mode 100644
index 0000000..e0c172e
--- /dev/null
+++ b/.travis/targets/clang-analyzer.sh
@@ -0,0 +1,38 @@
+build() {
+ default_configure \
+ --enable-silent-rules
+
+ local pn="$(grep PACKAGE_TARNAME config.h | cut -d\" -f2)"
+ local pv="$(grep PACKAGE_VERSION config.h | cut -d\" -f2)"
+ local p="${pn}-clang-analyzer-${pv}"
+
+ set +e
+ scan-build \
+ --use-cc="${CC}" \
+ -o reports \
+ make
+ #src/blogc/libblogc_la-debug.lo
+ local rv=$?
+ set -e
+
+ local num_reports=$(ls -1 reports | wc -l)
+ [[ ${num_reports} -eq 0 ]] && return ${rv}
+ [[ ${num_reports} -eq 1 ]]
+
+ local reports="reports/$(ls -1 reports)"
+
+ if [[ -d "${reports}" ]]; then
+ mv "${reports}" clang-analyzer
+ tar \
+ -cvJf "${p}.tar.xz" \
+ clang-analyzer
+ rv=1
+ fi
+
+ return ${rv}
+}
+
+deploy() {
+ FILES=( *.tar.xz )
+ [[ ${RV} -ne 0 ]] && [[ "x${CC}" = "xclang" ]]
+}