# HG changeset patch # User Chris Cannam # Date 1367338341 -3600 # Node ID 2633976fbef5e1e637adfcb70d593e5299f7965b # Parent d78c80be335f09d10ab94c3c18dd0d47c77c43c8 Tests (currently failing) for vamp-test-plugin diff -r d78c80be335f -r 2633976fbef5 tests/audio/20sec-silence.wav Binary file tests/audio/20sec-silence.wav has changed diff -r d78c80be335f -r 2633976fbef5 tests/expected/vamp-test-plugin-curve-fsr-timed.csv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/expected/vamp-test-plugin-curve-fsr-timed.csv Tue Apr 30 17:12:21 2013 +0100 @@ -0,0 +1,10 @@ +,0.000000000,0,"1 of 10: 0 at 0 snap to 0" +,0.000000000,0.1,"2 of 10: 0.1 at 0 snap to 0" +,0.000000000,0.2,"3 of 10: 0.2 at 0.166 snap to 0" +,0.400000000,0.3,"4 of 10: 0.3 at 0.333 snap to 0.4" +,2.000000000,0.4,"5 of 10: 0.4 at 2 snap to 2" +,2.000000000,0.5,"6 of 10: 0.5 at 2 snap to 2" +,2.000000000,0.6,"7 of 10: 0.6 at 2.166 snap to 2" +,2.400000000,0.7,"8 of 10: 0.7 at 2.333 snap to 2.4" +,4.000000000,0.8,"9 of 10: 0.8 at 4 snap to 4" +,4.000000000,0.9,"10 of 10: 0.9 at 4 snap to 4" diff -r d78c80be335f -r 2633976fbef5 tests/expected/vamp-test-plugin-curve-fsr.csv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/expected/vamp-test-plugin-curve-fsr.csv Tue Apr 30 17:12:21 2013 +0100 @@ -0,0 +1,10 @@ +,0.000000000,0,"1 of 10: 0 at 0" +,0.400000000,0.1,"2 of 10: 0.1 at 0.4" +,0.800000000,0.2,"3 of 10: 0.2 at 0.8" +,1.200000000,0.3,"4 of 10: 0.3 at 1.2" +,1.600000000,0.4,"5 of 10: 0.4 at 1.6" +,2.000000000,0.5,"6 of 10: 0.5 at 2" +,2.400000000,0.6,"7 of 10: 0.6 at 2.4" +,2.800000000,0.7,"8 of 10: 0.7 at 2.8" +,3.200000000,0.8,"9 of 10: 0.8 at 3.2" +,3.600000000,0.9,"10 of 10: 0.9 at 3.6" diff -r d78c80be335f -r 2633976fbef5 tests/expected/vamp-test-plugin-curve-oss.csv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/expected/vamp-test-plugin-curve-oss.csv Tue Apr 30 17:12:21 2013 +0100 @@ -0,0 +1,20 @@ +,0.000000000,0,"1 of 20: 0 at 0" +,0.023219954,0.05,"2 of 20: 0.05 at 0.023" +,0.046439909,0.1,"3 of 20: 0.1 at 0.046" +,0.069659863,0.15,"4 of 20: 0.15 at 0.069" +,0.092879818,0.2,"5 of 20: 0.2 at 0.092" +,0.116099773,0.25,"6 of 20: 0.25 at 0.116" +,0.139319727,0.3,"7 of 20: 0.3 at 0.139" +,0.162539682,0.35,"8 of 20: 0.35 at 0.162" +,0.185759637,0.4,"9 of 20: 0.4 at 0.185" +,0.208979591,0.45,"10 of 20: 0.45 at 0.208" +,0.232199546,0.5,"11 of 20: 0.5 at 0.232" +,0.255419501,0.55,"12 of 20: 0.55 at 0.255" +,0.278639455,0.6,"13 of 20: 0.6 at 0.278" +,0.301859410,0.65,"14 of 20: 0.65 at 0.301" +,0.325079365,0.7,"15 of 20: 0.7 at 0.325" +,0.348299319,0.75,"16 of 20: 0.75 at 0.348" +,0.371519274,0.8,"17 of 20: 0.8 at 0.371" +,0.394739229,0.85,"18 of 20: 0.85 at 0.394" +,0.417959183,0.9,"19 of 20: 0.9 at 0.417" +,0.441179138,0.95,"20 of 20: 0.95 at 0.441" diff -r d78c80be335f -r 2633976fbef5 tests/expected/vamp-test-plugin-curve-vsr.csv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/expected/vamp-test-plugin-curve-vsr.csv Tue Apr 30 17:12:21 2013 +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" diff -r d78c80be335f -r 2633976fbef5 tests/expected/vamp-test-plugin-grid-fsr.csv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/expected/vamp-test-plugin-grid-fsr.csv Tue Apr 30 17:12:21 2013 +0100 @@ -0,0 +1,10 @@ +,0.000000000,0.1,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55,"1 of 10 at 0" +,0.400000000,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55,0.6,"2 of 10 at 0.4" +,0.800000000,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.65,"3 of 10 at 0.8" +,1.200000000,0.25,0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7,"4 of 10 at 1.2" +,1.600000000,0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7,0.75,"5 of 10 at 1.6" +,2.000000000,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7,0.75,0.8,"6 of 10 at 2" +,2.400000000,0.4,0.45,0.5,0.55,0.6,0.65,0.7,0.75,0.8,0.85,"7 of 10 at 2.4" +,2.800000000,0.45,0.5,0.55,0.6,0.65,0.7,0.75,0.8,0.85,0.9,"8 of 10 at 2.8" +,3.200000000,0.5,0.55,0.6,0.65,0.7,0.75,0.8,0.85,0.9,0.95,"9 of 10 at 3.2" +,3.600000000,0.55,0.6,0.65,0.7,0.75,0.8,0.85,0.9,0.95,1,"10 of 10 at 3.6" diff -r d78c80be335f -r 2633976fbef5 tests/expected/vamp-test-plugin-grid-oss.csv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/expected/vamp-test-plugin-grid-oss.csv Tue Apr 30 17:12:21 2013 +0100 @@ -0,0 +1,20 @@ +,0.000000000,0.0666667,0.1,0.133333,0.166667,0.2,0.233333,0.266667,0.3,0.333333,0.366667,"1 of 20 at 0" +,0.023219954,0.1,0.133333,0.166667,0.2,0.233333,0.266667,0.3,0.333333,0.366667,0.4,"2 of 20 at 0.023" +,0.046439909,0.133333,0.166667,0.2,0.233333,0.266667,0.3,0.333333,0.366667,0.4,0.433333,"3 of 20 at 0.046" +,0.069659863,0.166667,0.2,0.233333,0.266667,0.3,0.333333,0.366667,0.4,0.433333,0.466667,"4 of 20 at 0.069" +,0.092879818,0.2,0.233333,0.266667,0.3,0.333333,0.366667,0.4,0.433333,0.466667,0.5,"5 of 20 at 0.092" +,0.116099773,0.233333,0.266667,0.3,0.333333,0.366667,0.4,0.433333,0.466667,0.5,0.533333,"6 of 20 at 0.116" +,0.139319727,0.266667,0.3,0.333333,0.366667,0.4,0.433333,0.466667,0.5,0.533333,0.566667,"7 of 20 at 0.139" +,0.162539682,0.3,0.333333,0.366667,0.4,0.433333,0.466667,0.5,0.533333,0.566667,0.6,"8 of 20 at 0.162" +,0.185759637,0.333333,0.366667,0.4,0.433333,0.466667,0.5,0.533333,0.566667,0.6,0.633333,"9 of 20 at 0.185" +,0.208979591,0.366667,0.4,0.433333,0.466667,0.5,0.533333,0.566667,0.6,0.633333,0.666667,"10 of 20 at 0.208" +,0.232199546,0.4,0.433333,0.466667,0.5,0.533333,0.566667,0.6,0.633333,0.666667,0.7,"11 of 20 at 0.232" +,0.255419501,0.433333,0.466667,0.5,0.533333,0.566667,0.6,0.633333,0.666667,0.7,0.733333,"12 of 20 at 0.255" +,0.278639455,0.466667,0.5,0.533333,0.566667,0.6,0.633333,0.666667,0.7,0.733333,0.766667,"13 of 20 at 0.278" +,0.301859410,0.5,0.533333,0.566667,0.6,0.633333,0.666667,0.7,0.733333,0.766667,0.8,"14 of 20 at 0.301" +,0.325079365,0.533333,0.566667,0.6,0.633333,0.666667,0.7,0.733333,0.766667,0.8,0.833333,"15 of 20 at 0.325" +,0.348299319,0.566667,0.6,0.633333,0.666667,0.7,0.733333,0.766667,0.8,0.833333,0.866667,"16 of 20 at 0.348" +,0.371519274,0.6,0.633333,0.666667,0.7,0.733333,0.766667,0.8,0.833333,0.866667,0.9,"17 of 20 at 0.371" +,0.394739229,0.633333,0.666667,0.7,0.733333,0.766667,0.8,0.833333,0.866667,0.9,0.933333,"18 of 20 at 0.394" +,0.417959183,0.666667,0.7,0.733333,0.766667,0.8,0.833333,0.866667,0.9,0.933333,0.966667,"19 of 20 at 0.417" +,0.441179138,0.7,0.733333,0.766667,0.8,0.833333,0.866667,0.9,0.933333,0.966667,1,"20 of 20 at 0.441" diff -r d78c80be335f -r 2633976fbef5 tests/expected/vamp-test-plugin-instants.csv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/expected/vamp-test-plugin-instants.csv Tue Apr 30 17:12:21 2013 +0100 @@ -0,0 +1,10 @@ +,0.000000000,"1 of 10 at 0" +,1.500000000,"2 of 10 at 1.5" +,3.000000000,"3 of 10 at 3" +,4.500000000,"4 of 10 at 4.5" +,6.000000000,"5 of 10 at 6" +,7.500000000,"6 of 10 at 7.5" +,9.000000000,"7 of 10 at 9" +,10.500000000,"8 of 10 at 10.5" +,12.000000000,"9 of 10 at 12" +,13.500000000,"10 of 10 at 13.5" diff -r d78c80be335f -r 2633976fbef5 tests/expected/vamp-test-plugin-notes-regions.csv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/expected/vamp-test-plugin-notes-regions.csv Tue Apr 30 17:12:21 2013 +0100 @@ -0,0 +1,10 @@ +,0.000000000,1.750000000,0,"1 of 10: 0 at 0 dur. 1.75" +,1.000000000,0.500000000,0.1,"2 of 10: 0.1 at 1 dur. 0.5" +,2.000000000,1.750000000,0.2,"3 of 10: 0.2 at 2 dur. 1.75" +,3.000000000,0.500000000,0.3,"4 of 10: 0.3 at 3 dur. 0.5" +,4.000000000,1.750000000,0.4,"5 of 10: 0.4 at 4 dur. 1.75" +,5.000000000,0.500000000,0.5,"6 of 10: 0.5 at 5 dur. 0.5" +,6.000000000,1.750000000,0.6,"7 of 10: 0.6 at 6 dur. 1.75" +,7.000000000,0.500000000,0.7,"8 of 10: 0.7 at 7 dur. 0.5" +,8.000000000,1.750000000,0.8,"9 of 10: 0.8 at 8 dur. 1.75" +,9.000000000,0.500000000,0.9,"10 of 10: 0.9 at 9 dur. 0.5" diff -r d78c80be335f -r 2633976fbef5 tests/test-helpfulflags.sh --- a/tests/test-helpfulflags.sh Tue Apr 30 16:13:56 2013 +0100 +++ b/tests/test-helpfulflags.sh Tue Apr 30 17:12:21 2013 +0100 @@ -4,6 +4,7 @@ r=$mypath/../sonic-annotator testplug=vamp:vamp-example-plugins:percussiononsets +testplug2=vamp:vamp-test-plugin:vamp-test-plugin fail() { echo "Test failed: $1" @@ -25,6 +26,9 @@ $r --list 2>/dev/null | grep -q $testplug || \ fail "Fails to print $testplug in plugin list (if you haven't got it, install it -- it's needed for other tests)" +$r --list 2>/dev/null | grep -q $testplug2 || \ + fail "Fails to print $testplug2 in plugin list (if you haven't got it, install it -- it's needed for other tests)" + $r --skeleton $testplug >/dev/null || \ fail "Fails to run with --skeleton $testplug" diff -r d78c80be335f -r 2633976fbef5 tests/test-include.sh --- a/tests/test-include.sh Tue Apr 30 16:13:56 2013 +0100 +++ b/tests/test-include.sh Tue Apr 30 17:12:21 2013 +0100 @@ -16,3 +16,10 @@ return $rv } +csvcompare_ignorefirst() { + # a bit like the above, but ignoring first column (and without temp files) + out=`cat "$1" "$2" | cut -d, -f2- | perl -p -e 's/(\d+\.\d{6})\d+/$1/' | sort | uniq -c | grep -v ' 2 '` + return `[ -z "$out" ]` +} + + diff -r d78c80be335f -r 2633976fbef5 tests/test-vamp-test-plugin.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-vamp-test-plugin.sh Tue Apr 30 17:12:21 2013 +0100 @@ -0,0 +1,30 @@ +#!/bin/bash + +mypath=`dirname $0` +r=$mypath/../sonic-annotator + +infile=$mypath/audio/20sec-silence.wav +testplug=vamp:vamp-test-plugin:vamp-test-plugin +tmpcsv=$mypath/tmp_1_$$.csv + +trap "rm -f $tmpcsv" 0 + +. test-include.sh + +fail() { + echo "Test failed: $1" + exit 1 +} + +for output in instants curve-oss curve-fsr curve-fsr-timed curve-vsr grid-oss grid-fsr notes-regions; do + + $r -d "$testplug:$output" -w csv --csv-one-file "$tmpcsv" --csv-force "$infile" 2>/dev/null || \ + fail "Failed to run for plugin $testplug with output $output" + + csvcompare_ignorefirst "$tmpcsv" "$mypath/expected/vamp-test-plugin-$output.csv" || \ + fail "Output differs from expected for $output" + +done + +exit 0 + diff -r d78c80be335f -r 2633976fbef5 tests/test.sh --- a/tests/test.sh Tue Apr 30 16:13:56 2013 +0100 +++ b/tests/test.sh Tue Apr 30 17:12:21 2013 +0100 @@ -9,6 +9,7 @@ helpfulflags \ transforms-basic \ audioformat \ + vamp-test-plugin \ as-advertised \ rdf-writer \ rdf-destinations \