annotate tests/test-transforms-basic/test-transforms-basic.sh @ 120:dcecd6997214 test-reorg

Abandon if we fail to add a transform; don't continue with the remaining transforms (that's very confusing behaviour)
author Chris Cannam
date Wed, 08 Oct 2014 15:26:48 +0100
parents 7a31201dc42d
children 5200446bbc6b
rev   line source
Chris@0 1 #!/bin/bash
Chris@0 2
Chris@119 3 . ../include.sh
Chris@0 4
Chris@119 5 infile=$audiopath/3clicks8.wav
Chris@0 6 tmpfile1=$mypath/tmp_1_$$
Chris@0 7 tmpfile2=$mypath/tmp_2_$$
Chris@0 8
Chris@0 9 trap "rm -f $tmpfile1 $tmpfile2" 0
Chris@0 10
Chris@118 11 $r --skeleton $percplug > $tmpfile1 2>/dev/null || \
Chris@118 12 fail "Fails to run with --skeleton $percplug"
Chris@0 13
Chris@0 14 $r -t $tmpfile1 -w csv --csv-stdout $infile > $tmpfile2 2>/dev/null || \
Chris@119 15 fail "Fails to run with -t $tmpfile1 -w csv --csv-stdout $infile"
Chris@0 16
Chris@119 17 csvcompare $tmpfile2 $mypath/expected/skeleton-1.csv || \
Chris@119 18 faildiff "Output mismatch for skeleton-1.csv" $tmpfile2 $mypath/expected/skeleton-1.csv
Chris@0 19
Chris@0 20 for suffix in \
Chris@0 21 -no-parameters-default-output \
Chris@0 22 -no-parameters \
Chris@0 23 "" \
Chris@96 24 -start-and-duration \
Chris@0 25 -set-parameters \
Chris@0 26 -set-step-and-block-size \
Chris@0 27 -set-sample-rate \
Chris@51 28 -df-windowtype-default \
Chris@51 29 -df-windowtype-hanning \
Chris@51 30 -df-windowtype-hamming \
Chris@96 31 -df-start-and-duration \
Chris@55 32 -multiple-outputs \
Chris@99 33 -multiple-outputs-start-and-duration \
Chris@0 34 ; do
Chris@0 35
Chris@0 36 for type in xml n3 ; do
Chris@0 37
Chris@119 38 transform=$mypath/transforms/percussiononsets$suffix.$type
Chris@119 39 expected=$mypath/expected/percussiononsets$suffix.csv
Chris@0 40
Chris@55 41 if [ ! -f $transform ]; then
Chris@55 42 if [ $type = "xml" ]; then
Chris@55 43 continue # not everything can be expressed in the XML
Chris@55 44 # format, e.g. the multiple output test can't
Chris@55 45 fi
Chris@55 46 fi
Chris@55 47
Chris@0 48 test -f $transform || \
Chris@51 49 fail "Internal error: no transforms file for suffix $suffix (looking for $transform)"
Chris@0 50
Chris@0 51 test -f $expected || \
Chris@51 52 fail "Internal error: no expected output file for suffix $suffix (looking for $expected)"
Chris@0 53
Chris@0 54 $r -t $transform -w csv --csv-stdout $infile > $tmpfile2 2>/dev/null || \
Chris@0 55 fail "Fails to run transform $transform"
Chris@0 56
Chris@28 57 csvcompare $tmpfile2 $expected || \
Chris@108 58 faildiff "Output mismatch for transform $transform" $tmpfile2 $expected
Chris@0 59 done
Chris@0 60 done
Chris@0 61
Chris@0 62 exit 0
Chris@0 63