aboutsummaryrefslogtreecommitdiffstats
path: root/.travis/targets/clang-analyzer.sh
blob: bd2d61daa6558c93831925d5b57e3a6d0a81ca2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
build() {
    pushd build > /dev/null
    ../configure \
        CFLAGS="-Wall -g -O0" \
        --enable-silent-rules \
        --enable-ronn \
        --enable-tests \
        --disable-valgrind \
        --enable-git-receiver \
        --enable-make \
        --enable-runserver
    popd > /dev/null

    PN="$(grep PACKAGE_TARNAME build/config.h | cut -d\" -f2)"
    PV="$(grep PACKAGE_VERSION build/config.h | cut -d\" -f2)"
    P="${PN}-clang-analyzer-${PV}"

    set +e
    scan-build \
        --status-bugs \
        -o "build/${P}" \
        make -C build
    RV=$?
    set -e

    if [[ ${RV} -ne 0 ]]; then
        tar \
            -cvJf "build/${P}.tar.xz" \
            -C build/${P}/ \
            .
    fi

    echo ${RV} > build/.test_result
}

deploy_cond() {
    [[ "x${CC}" = "xclang" ]] && [[ -f build/*.tar.xz ]]
}

deploy() {
    FILES=( build/*.tar.xz )
}