File: run-all

package info (click to toggle)
qpdf 12.3.2-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 72,660 kB
  • sloc: cpp: 59,054; perl: 12,189; ansic: 6,809; sh: 1,231; python: 1,041; xml: 43; makefile: 42
file content (34 lines) | stat: -rwxr-xr-x 693 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/env bash
set -e

cd $(dirname $0)/..

CUR_TEMP=
function clean_temp() {
    if [[ $CUR_TEMP =~ .*\.qpdf-test$ && -d $CUR_TEMP ]]; then
        rm -rf $CUR_TEMP
    fi
}

trap clean_temp EXIT

declare -a any_failed
for i in pkg-test/test-*; do
    if [[ $i =~ .*~ ]]; then
        continue
    fi
    CUR_TEMP=$(mktemp --suffix=.qpdf-test -d)
    printf "\n\n\e[40m\e[1;35m*** RUNNING $i ***\e[0m\n\n\n"
    if ! $i $CUR_TEMP; then
        any_failed=(${any_failed[*]} $i)
    fi
    clean_temp
done

if [[ ${#any_failed} != 0 ]]; then
    for i in ${any_failed[*]}; do
        echo 1>&2 "FAILED: $i"
    done
    exit 2
fi
printf "\n\n\e[40m\e[1;35m*** ALL TESTS PASSED ***\e[0m\n"