~ubuntu-branches/debian/stretch/device-tree-compiler/stretch

« back to all changes in this revision

Viewing changes to tests/dtc-checkfails.sh

  • Committer: Package Import Robot
  • Author(s): Riku Voipio
  • Date: 2014-01-03 16:22:27 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20140103162227-plcrvw6dmbyfznsb
Tags: 1.4.0+dfsg-1
REALLY update to upstream version 1.4.0, closes: #725745

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 
5
5
for x; do
6
6
    shift
 
7
    if [ "$x" = "-n" ]; then
 
8
        for x; do
 
9
            shift
 
10
            if [ "$x" = "--" ]; then
 
11
                break;
 
12
            fi
 
13
            NOCHECKS="$NOCHECKS $x"
 
14
        done
 
15
        break;
 
16
    fi
7
17
    if [ "$x" = "--" ]; then
8
18
        break;
9
19
    fi
10
 
    CHECKS="$CHECKS $x"
 
20
    YESCHECKS="$YESCHECKS $x"
11
21
done
12
22
 
13
 
LOG="tmp.log.$$"
14
 
 
15
 
rm -f $TMPFILE $LOG
 
23
LOG=tmp.log.$$
 
24
rm -f $LOG
 
25
trap "rm -f $LOG" 0
16
26
 
17
27
verbose_run_log "$LOG" $VALGRIND "$DTC" -o /dev/null "$@"
18
28
ret="$?"
19
29
 
20
 
if [ "$ret" -gt 127 ]; then
21
 
    signame=$(kill -l $[ret - 128])
22
 
    FAIL "Killed by SIG$signame"
23
 
fi
 
30
FAIL_IF_SIGNAL $ret
24
31
 
25
 
for c in $CHECKS; do
 
32
for c in $YESCHECKS; do
26
33
    if ! grep -E "^(ERROR)|(Warning) \($c\):" $LOG > /dev/null; then
27
34
        FAIL "Failed to trigger check \"$c\""
28
35
    fi
29
36
done
30
37
 
31
 
rm -f $LOG
 
38
for c in $NOCHECKS; do
 
39
    if grep -E "^(ERROR)|(Warning) \($c\):" $LOG > /dev/null; then
 
40
        FAIL "Incorrectly triggered check \"$c\""
 
41
    fi
 
42
done
32
43
 
33
44
PASS