comparison tests/test-summaries.sh @ 105:76d9d86ae6cd

Add summary test with segments
author Chris Cannam
date Wed, 01 Oct 2014 17:50:58 +0100
parents fae326c22df5
children 8b4924a9a072
comparison
equal deleted inserted replaced
104:4852625eb62b 105:76d9d86ae6cd
2 2
3 mypath=`dirname $0` 3 mypath=`dirname $0`
4 r=$mypath/../sonic-annotator 4 r=$mypath/../sonic-annotator
5 5
6 infile=$mypath/audio/3clicks8.wav 6 infile=$mypath/audio/3clicks8.wav
7 infile2=$mypath/audio/6clicks8.wav
7 tmpfile=$mypath/tmp_1_$$ 8 tmpfile=$mypath/tmp_1_$$
8 tmpcanonical=$mypath/tmp_2_$$ 9 tmpcanonical=$mypath/tmp_2_$$
9 expcanonical=$mypath/tmp_exp_2_$$ 10 expcanonical=$mypath/tmp_exp_2_$$
10 tmpcmp1=$mypath/tmp_3_$$ 11 tmpcmp1=$mypath/tmp_3_$$
11 tmpcmp2=$mypath/tmp_4_$$ 12 tmpcmp2=$mypath/tmp_4_$$
76 fail "Fails to run transform $stransform with CSV output and summary-only" 77 fail "Fails to run transform $stransform with CSV output and summary-only"
77 78
78 compare $tmpfile ${expected}-from-rdf-summaries-only.csv || \ 79 compare $tmpfile ${expected}-from-rdf-summaries-only.csv || \
79 faildiff "Output mismatch for transform $stransform with summary-only" $tmpfile ${expected}-from-rdf-summaries-only.csv 80 faildiff "Output mismatch for transform $stransform with summary-only" $tmpfile ${expected}-from-rdf-summaries-only.csv
80 81
82 $r -t $transform -w csv --csv-stdout --summary-only -S median --segments 0,9.9 $infile2 > $tmpfile 2>/dev/null || \
83 fail "Fails to run transform $stransform with CSV output and segments"
84
85 compare $tmpfile ${expected}-segments.csv || \
86 faildiff "Output mismatch for transform $stransform with segments" $tmpfile ${expected}-segments.csv
87
81 $r -t $stransform -w rdf --rdf-stdout $infile > $tmpfile 2>/dev/null || \ 88 $r -t $stransform -w rdf --rdf-stdout $infile > $tmpfile 2>/dev/null || \
82 fail "Fails to run transform $stransform with RDF output" 89 fail "Fails to run transform $stransform with RDF output"
83 90
84 rapper -i turtle $tmpfile -o turtle 2>/dev/null | grep -v '^@prefix :' | grep -v 'file:/' > $tmpcanonical || 91 rapper -i turtle $tmpfile -o turtle 2>/dev/null | grep -v '^@prefix :' | grep -v 'file:/' > $tmpcanonical ||
85 fail "Fails to produce parseable RDF/TTL for transform $stransform" 92 fail "Fails to produce parseable RDF/TTL for transform $stransform"