aboutsummaryrefslogtreecommitdiffstats
path: root/dtc/tests/dtc-fails.sh
blob: 855b623a1732370b88baefacf1b36cb0498747e5 (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
#! /bin/sh

SRCDIR=`dirname "$0"`
. "$SRCDIR/testutils.sh"

if [ "$1" = "-n" ]; then
    NEG="$1"
    shift
fi

OUTPUT="$1"
shift

verbose_run $VALGRIND "$DTC" -o "$OUTPUT" "$@"
ret="$?"

FAIL_IF_SIGNAL $ret

if [ -n "$NEG" ]; then
    if [ ! -e "$OUTPUT" ]; then
	FAIL "Produced no output"
    fi
else
    if [ -e "$OUTPUT" ]; then
	FAIL "Incorrectly produced output"
    fi
fi

rm -f "$OUTPUT"

PASS