File: run

package info (click to toggle)
mapnik 4.2.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,548 kB
  • sloc: cpp: 163,861; python: 1,190; sh: 690; xml: 161; makefile: 123; perl: 28; lisp: 13
file content (66 lines) | stat: -rwxr-xr-x 1,930 bytes parent folder | download | duplicates (7)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env bash

set -o pipefail
set -eu

failures=0

cd "$( dirname "${BASH_SOURCE[0]}" )"
cd ../
source ./localize.sh

function run_step    { >&2 echo -e "\033[1m\033[34m* $1\033[0m"; }
function run_substep { >&2 echo -e "\033[1m\033[36m* $1\033[0m"; }
function run_success { >&2 echo -e "\033[1m\033[32m* $1\033[0m"; }
function run_warn    { >&2 echo -e "\033[1m\033[31m* $1\033[0m"; }

run_step "Starting Mapnik tests"

ran_a_test=false
if [ -d "test/data" ]; then

    run_substep "Running C++ Unit tests..."
    if [[ -f ./test/unit/run ]]; then
        ran_a_test=true
        ./test/unit/run || failures=$((failures+$?))
    else
        run_warn "Skipping unit tests since they were not built"
    fi

    run_substep "Running standalone C++ tests..."
    found_test=false
    if [ -n "$(find test/standalone/ -maxdepth 1 -name '*-bin' -print -quit)" ]; then
        for FILE in test/standalone/*-bin; do
          found_test=true
          ran_a_test=true
          ${FILE} || failures=$((failures+$?))
        done
    fi
    if [[ $found_test == false ]]; then
        run_warn "Skipping standalone tests since they were not built"
    fi

    if [ -d "test/data-visual/styles" ]; then
        run_substep "Running visual tests..."
        if [ -z "${JOBS:-}" ]; then
            JOBS=1
        fi
        if [[ -f ./test/visual/run ]]; then
            ran_a_test=true
            ./test/visual/run -j $JOBS || failures=$((failures+$?))
        else
            run_warn "Skipping visual tests since they were not built"
        fi
    else
        echo "Notice: Skipping visual tests, the visual tests data are not present under the standard directory \"test/data-visual\"."
    fi

else
    echo "Notice: Skipping all tests, the test data are not present under the standard directory \"test/data\"."
fi

if [[ $ran_a_test == false ]]; then
    run_warn "**** WARNING: no tests were run ****"
fi

exit $failures