summaryrefslogtreecommitdiffstats
path: root/src/dtc/tests/dtc-fails.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/dtc/tests/dtc-fails.sh')
-rwxr-xr-xsrc/dtc/tests/dtc-fails.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/dtc/tests/dtc-fails.sh b/src/dtc/tests/dtc-fails.sh
new file mode 100755
index 0000000..4ddcb27
--- /dev/null
+++ b/src/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
OpenPOWER on IntegriCloud