changeset 155:6dc824c3f5e1 labfile

Add lab writer tests (currently failing)
author Chris Cannam
date Tue, 14 Oct 2014 18:39:16 +0100
parents 6ff4da31db8b
children 0fd5c3c28814
files tests/test-lab-writer/expected/curve-vsr-fill-ends.lab tests/test-lab-writer/expected/curve-vsr-no-flags.lab tests/test-lab-writer/expected/notes-regions-fill-ends.lab tests/test-lab-writer/expected/notes-regions-no-flags.lab tests/test-lab-writer/test-lab-writer.sh tests/test.sh
diffstat 6 files changed, 71 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-lab-writer/expected/curve-vsr-fill-ends.lab	Tue Oct 14 18:39:16 2014 +0100
@@ -0,0 +1,10 @@
+0.000000000	0.750000000	0	"1 of 10: 0 at 0"
+0.750000000	1.500000000	0.1	"2 of 10: 0.1 at 0.75"
+1.500000000	2.250000000	0.2	"3 of 10: 0.2 at 1.5"
+2.250000000	3.000000000	0.3	"4 of 10: 0.3 at 2.25"
+3.000000000	3.7500000000	0.4	"5 of 10: 0.4 at 3"
+3.750000000	4.500000000	0.5	"6 of 10: 0.5 at 3.75"
+4.500000000	5.250000000	0.6	"7 of 10: 0.6 at 4.5"
+5.250000000	6.000000000	0.7	"8 of 10: 0.7 at 5.25"
+6.000000000	6.750000000	0.8	"9 of 10: 0.8 at 6"
+6.750000000	6.750000000	0.9	"10 of 10: 0.9 at 6.75"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-lab-writer/expected/curve-vsr-no-flags.lab	Tue Oct 14 18:39:16 2014 +0100
@@ -0,0 +1,10 @@
+0.000000000	0	"1 of 10: 0 at 0"
+0.750000000	0.1	"2 of 10: 0.1 at 0.75"
+1.500000000	0.2	"3 of 10: 0.2 at 1.5"
+2.250000000	0.3	"4 of 10: 0.3 at 2.25"
+3.000000000	0.4	"5 of 10: 0.4 at 3"
+3.750000000	0.5	"6 of 10: 0.5 at 3.75"
+4.500000000	0.6	"7 of 10: 0.6 at 4.5"
+5.250000000	0.7	"8 of 10: 0.7 at 5.25"
+6.000000000	0.8	"9 of 10: 0.8 at 6"
+6.750000000	0.9	"10 of 10: 0.9 at 6.75"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-lab-writer/expected/notes-regions-fill-ends.lab	Tue Oct 14 18:39:16 2014 +0100
@@ -0,0 +1,10 @@
+0.000000000	1.750000000	0	"1 of 10: 0 at 0 dur. 1.75"
+1.000000000	1.500000000	0.1	"2 of 10: 0.1 at 1 dur. 0.5"
+2.000000000	3.750000000	0.2	"3 of 10: 0.2 at 2 dur. 1.75"
+3.000000000	3.500000000	0.3	"4 of 10: 0.3 at 3 dur. 0.5"
+4.000000000	5.750000000	0.4	"5 of 10: 0.4 at 4 dur. 1.75"
+5.000000000	5.500000000	0.5	"6 of 10: 0.5 at 5 dur. 0.5"
+6.000000000	7.750000000	0.6	"7 of 10: 0.6 at 6 dur. 1.75"
+7.000000000	7.500000000	0.7	"8 of 10: 0.7 at 7 dur. 0.5"
+8.000000000	9.750000000	0.8	"9 of 10: 0.8 at 8 dur. 1.75"
+9.000000000	9.500000000	0.9	"10 of 10: 0.9 at 9 dur. 0.5"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-lab-writer/expected/notes-regions-no-flags.lab	Tue Oct 14 18:39:16 2014 +0100
@@ -0,0 +1,10 @@
+0.000000000	1.750000000	0	"1 of 10: 0 at 0 dur. 1.75"
+1.000000000	1.500000000	0.1	"2 of 10: 0.1 at 1 dur. 0.5"
+2.000000000	3.750000000	0.2	"3 of 10: 0.2 at 2 dur. 1.75"
+3.000000000	3.500000000	0.3	"4 of 10: 0.3 at 3 dur. 0.5"
+4.000000000	5.750000000	0.4	"5 of 10: 0.4 at 4 dur. 1.75"
+5.000000000	5.500000000	0.5	"6 of 10: 0.5 at 5 dur. 0.5"
+6.000000000	7.750000000	0.6	"7 of 10: 0.6 at 6 dur. 1.75"
+7.000000000	7.500000000	0.7	"8 of 10: 0.7 at 7 dur. 0.5"
+8.000000000	9.750000000	0.8	"9 of 10: 0.8 at 8 dur. 1.75"
+9.000000000	9.500000000	0.9	"10 of 10: 0.9 at 9 dur. 0.5"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-lab-writer/test-lab-writer.sh	Tue Oct 14 18:39:16 2014 +0100
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+. ../include.sh
+
+infile=$audiopath/20sec-silence.wav
+tmplab=$mypath/tmp_1_$$.lab
+
+trap "rm -f $tmplab" 0
+
+for output in notes-regions curve-vsr; do
+
+    flag=""
+
+    $r -d "$testplug:$output" -w lab --lab-stdout "$infile" 2>/dev/null > "$tmplab" || \
+	fail "Failed to run for plugin $testplug with output $output and no additional flags"
+
+    csvcompare "$tmplab" "$mypath/expected/$output-no-flags.lab" || \
+	faildiff "Output differs from expected for output $output and no additional flags" "$tmplab" "$mypath/expected/$output-no-flags.lab"
+
+    flag=fill-ends
+
+    $r -d "$testplug:$output" -w lab --lab-$flag --lab-stdout "$infile" 2>/dev/null > "$tmplab" || \
+	fail "Failed to run for plugin $testplug with output $output and $flag flag"
+
+    csvcompare "$tmplab" "$mypath/expected/$output-$flag.lab" || \
+	faildiff "Output differs from expected for output $output and $flag flag" "$tmplab" "$mypath/expected/$output-$flag.lab"
+done
+
+exit 0
+
--- a/tests/test.sh	Tue Oct 14 17:30:44 2014 +0100
+++ b/tests/test.sh	Tue Oct 14 18:39:16 2014 +0100
@@ -12,6 +12,7 @@
     rdf-writer \
     rdf-destinations \
     csv-destinations \
+    lab-writer \
     lab-destinations \
     midi-destinations \
     summaries \