diff test/test-layer-exports.sh @ 2444:1b6a9c0484a3 spectrogram-export

Test export of zoomed 3d plot
author Chris Cannam
date Fri, 10 Jan 2020 10:53:22 +0000
parents 935107f64e5f
children 048d9eed0a1f
line wrap: on
line diff
--- a/test/test-layer-exports.sh	Thu Jan 09 14:38:40 2020 +0000
+++ b/test/test-layer-exports.sh	Fri Jan 10 10:53:22 2020 +0000
@@ -123,6 +123,12 @@
 /setcurrent 4 3
 /exportlayer "$tmpdir/selected-notes.mid"
 
+# If we also zoom in vertically in the 3d plot, our export should
+# include only the zoomed area - check this
+/setcurrent 5 2
+/zoomvertical 0 12
+/exportlayer "$tmpdir/selected-zoomed-3dplot.csv"
+
 /quit
 EOF
 
@@ -152,6 +158,24 @@
     done
 done
 
+for csv in selected-zoomed-3dplot.csv ; do
+    actual="$tmpdir/$csv"
+    expected="layers-expected/$csv"
+    if ! cmp -s "$actual" "$expected" ; then
+        echo
+        echo "Test failed for \"$csv\"!"
+        echo
+        echo "Actual:"
+        ls -l "$actual"
+        echo "Expected:"
+        ls -l "$expected"
+        echo
+        echo "Diff begins:"
+        diff -u1 "$actual" "$expected" | head 
+        echo
+    fi
+done
+
 for other in notes.mid selected-notes.mid ; do
     actual="$tmpdir/$other"
     expected="layers-expected/$other"