Mercurial > hg > pyin
comparison test/regression/regression.sh @ 149:b83e6fbe22cc memory
Update regression tests
author | Chris Cannam |
---|---|
date | Wed, 17 May 2017 15:55:37 +0100 |
parents | 7d7d16654ad7 |
children | 4a97f7638ffd |
comparison
equal
deleted
inserted
replaced
148:e3f53fac06c3 | 149:b83e6fbe22cc |
---|---|
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 set -eu | 3 set -u |
4 | 4 |
5 testdir=$(dirname "$0") | 5 testdir=$(dirname "$0") |
6 rootdir="$testdir/../.." | 6 rootdir="$testdir/../.." |
7 | 7 |
8 if ! sonic-annotator -v >/dev/null ; then | 8 if ! sonic-annotator -v >/dev/null ; then |
11 fi | 11 fi |
12 | 12 |
13 echo "Running regression test..." | 13 echo "Running regression test..." |
14 | 14 |
15 for output in smoothedpitchtrack notes ; do | 15 for output in smoothedpitchtrack notes ; do |
16 for fixedlag in off on ; do | |
16 | 17 |
17 ( time ( VAMP_PATH="$rootdir" sonic-annotator \ | 18 flsuffix="" |
18 -d vamp:pyin:pyin:$output \ | 19 if [ "$fixedlag" = "on" ]; then |
19 -w csv --csv-stdout --csv-omit-filename \ | 20 flsuffix="-fixedlag" |
20 "$rootdir/testdata/bob_02.wav" \ | 21 fi |
21 > "$testdir/obtained-$output.csv" \ | |
22 2> "$testdir/log-$output.txt" ) ) 2>&1 | \ | |
23 grep -i real | \ | |
24 sed 's/^real/Elapsed time/' | |
25 | 22 |
26 if ! cmp -s "$testdir/expected-$output.csv" "$testdir/obtained-$output.csv" ; then | 23 echo |
27 echo "*** FAILED for output $output, diff follows:" | 24 echo "Testing output $output with fixed-lag $fixedlag..." |
28 sdiff -w78 "$testdir/expected-$output.csv" "$testdir/obtained-$output.csv" | 25 |
29 else | 26 ( time ( VAMP_PATH="$rootdir" sonic-annotator \ |
30 echo "Succeeded for output $output" | 27 -t "$testdir/transform-$output$flsuffix.ttl" \ |
31 fi | 28 -w csv --csv-stdout --csv-omit-filename \ |
29 "$rootdir/testdata/bob_02.wav" \ | |
30 > "$testdir/obtained-$output$flsuffix.csv" \ | |
31 2> "$testdir/log-$output$flsuffix.txt" ) ) 2>&1 | \ | |
32 grep -i real | \ | |
33 sed 's/^real/Elapsed time/' | |
34 | |
35 if ! cmp -s "$testdir/expected-$output$flsuffix.csv" "$testdir/obtained-$output$flsuffix.csv" ; then | |
36 echo "*** FAILED for output $output with fixed-lag $fixedlag, diff follows:" | |
37 echo " (expected on left, obtained on right)" | |
38 sdiff -w78 "$testdir/expected-$output$flsuffix.csv" "$testdir/obtained-$output$flsuffix.csv" | |
39 else | |
40 echo "Succeeded for output $output with fixed-lag $fixedlag" | |
41 fi | |
42 done | |
32 done | 43 done |
33 | 44 |
34 | 45 |