aboutsummaryrefslogtreecommitdiffstats
path: root/.travis/targets/clang-analyzer.sh
blob: eb78f47b3357f6dbbcd5668df0295c06555190fe (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 -std=c99" \
        --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 )
}