diff tests/test-json-destinations/test-json-destinations.sh @ 169:859d8ec60e06 jams

Add setNofM logic which the JSON writer can use to write a list when sending multiple files' worth to a single target
author Chris Cannam
date Wed, 15 Oct 2014 16:05:15 +0100
parents db83ea0e102d
children 4ef452f5fefc
line wrap: on
line diff
--- a/tests/test-json-destinations/test-json-destinations.sh	Wed Oct 15 15:20:16 2014 +0100
+++ b/tests/test-json-destinations/test-json-destinations.sh	Wed Oct 15 16:05:15 2014 +0100
@@ -23,11 +23,22 @@
 
 transformdir=$mypath/transforms
 
+failshow() {
+    echo "Test failed: $1"
+    if [ -n "$2" ]; then
+	echo "Output follows:"
+	echo "--"
+	cat $2
+	echo "--"
+    fi
+    exit 1
+}	
+
 check_json() {
     test -f $1 || \
 	fail "Fails to write output to expected location $1 for $2"
-    cat $1 | json_verify || \
-	fail "Writes invalid JSON to location $1 for $2"
+    cat $1 | json_verify -q || \
+	failshow "Writes invalid JSON to location $1 for $2" $1
     rm -f $1
 }