changeset 105:76d9d86ae6cd

Add summary test with segments
author Chris Cannam
date Wed, 01 Oct 2014 17:50:58 +0100
parents 4852625eb62b
children de76b2df518f 8b4924a9a072
files tests/expected/transforms-summaries-percussiononsets-segments.csv tests/test-summaries.sh
diffstat 2 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/expected/transforms-summaries-percussiononsets-segments.csv	Wed Oct 01 17:50:58 2014 +0100
@@ -0,0 +1,2 @@
+"./audio/6clicks8.wav",0.000000000,9.900000000,median,169,"(median value, continuous-time average)"
+,9.900000000,0.131020407,median,75,"(median value, continuous-time average)"
--- a/tests/test-summaries.sh	Wed Oct 01 15:19:45 2014 +0100
+++ b/tests/test-summaries.sh	Wed Oct 01 17:50:58 2014 +0100
@@ -4,6 +4,7 @@
 r=$mypath/../sonic-annotator
 
 infile=$mypath/audio/3clicks8.wav
+infile2=$mypath/audio/6clicks8.wav
 tmpfile=$mypath/tmp_1_$$
 tmpcanonical=$mypath/tmp_2_$$
 expcanonical=$mypath/tmp_exp_2_$$
@@ -78,6 +79,12 @@
 compare $tmpfile ${expected}-from-rdf-summaries-only.csv || \
     faildiff "Output mismatch for transform $stransform with summary-only" $tmpfile ${expected}-from-rdf-summaries-only.csv
 
+$r -t $transform -w csv --csv-stdout --summary-only -S median --segments 0,9.9 $infile2 > $tmpfile 2>/dev/null || \
+    fail "Fails to run transform $stransform with CSV output and segments"
+
+compare $tmpfile ${expected}-segments.csv || \
+    faildiff "Output mismatch for transform $stransform with segments" $tmpfile ${expected}-segments.csv
+
 $r -t $stransform -w rdf --rdf-stdout $infile > $tmpfile 2>/dev/null || \
     fail "Fails to run transform $stransform with RDF output"