summaryrefslogtreecommitdiffstats
path: root/qemu/dtc/tests/dtc-fails.sh
diff options
context:
space:
mode:
Diffstat (limited to 'qemu/dtc/tests/dtc-fails.sh')
-rwxr-xr-xqemu/dtc/tests/dtc-fails.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/qemu/dtc/tests/dtc-fails.sh b/qemu/dtc/tests/dtc-fails.sh
new file mode 100755
index 000000000..4ddcb2732
--- /dev/null
+++ b/qemu/dtc/tests/dtc-fails.sh
@@ -0,0 +1,30 @@
+#! /bin/sh
+
+. ./tests.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