changeset 59:52b9d58edb78

Ensure expected output (as well as test output) gets canonicalised before comparison. The test in question still fails -- I think now only because of plugin output ordering changes (prior to svcore rev f3fd2988fc9b it also had picked up some incorrect output feature types)
author Chris Cannam
date Mon, 09 Jan 2012 16:30:44 +0000
parents 350f61d5d9be
children 400e09d69b8f
files tests/expected/transforms-summaries-percussiononsets-from-rdf.n3 tests/test-summaries.sh tests/transforms/transforms-summaries-percussiononsets-detectionfunction.n3
diffstat 3 files changed, 13 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/tests/expected/transforms-summaries-percussiononsets-from-rdf.n3	Mon Jan 09 14:55:17 2012 +0000
+++ b/tests/expected/transforms-summaries-percussiononsets-from-rdf.n3	Mon Jan 09 16:30:44 2012 +0000
@@ -8,6 +8,7 @@
 @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
 @prefix tl: <http://purl.org/NET/c4dm/timeline.owl#> .
 @prefix vamp: <http://purl.org/ontology/vamp/> .
+@prefix : <> .
 
 :transform_0_onsets
     vamp:block_size "1024"^^xsd:int ;
--- a/tests/test-summaries.sh	Mon Jan 09 14:55:17 2012 +0000
+++ b/tests/test-summaries.sh	Mon Jan 09 16:30:44 2012 +0000
@@ -6,10 +6,11 @@
 infile=$mypath/audio/3clicks8.wav
 tmpfile=$mypath/tmp_1_$$
 tmpcanonical=$mypath/tmp_2_$$
+expcanonical=$mypath/tmp_exp_2_$$
 tmpcmp1=$mypath/tmp_3_$$
 tmpcmp2=$mypath/tmp_4_$$
 
-trap "rm -f $tmpfile $tmpcanonical $tmpcmp1 $tmpcmp2" 0
+trap "rm -f $tmpfile $tmpcanonical $expcanonical $tmpcmp1 $tmpcmp2" 0
 
 . test-include.sh
 
@@ -77,8 +78,11 @@
 rapper -i turtle $tmpfile -o turtle 2>/dev/null | grep -v '^@prefix :' | grep -v 'file:/' > $tmpcanonical ||
     fail "Fails to produce parseable RDF/TTL for transform $stransform"
 
-compare $tmpcanonical ${sexpected}.n3 || \
-    faildiff "Output mismatch for canonicalised version of transform $stransform" $tmpcanonical ${sexpected}.n3
+rapper -i turtle ${sexpected}.n3 -o turtle 2>/dev/null | grep -v '^@prefix :' | grep -v 'file:/' > $expcanonical ||
+    fail "Internal error: Failed to canonicalise expected output file $expected.n3"
+
+compare $tmpcanonical $expcanonical || \
+    faildiff "Output mismatch for canonicalised version of transform $stransform" $tmpcanonical $expcanonical
 
 exit 0
 
--- a/tests/transforms/transforms-summaries-percussiononsets-detectionfunction.n3	Mon Jan 09 14:55:17 2012 +0000
+++ b/tests/transforms/transforms-summaries-percussiononsets-detectionfunction.n3	Mon Jan 09 16:30:44 2012 +0000
@@ -3,26 +3,26 @@
 @prefix examples: <http://vamp-plugins.org/rdf/plugins/vamp-example-plugins#>.
 @prefix : <#>.
 
-:transform0 a vamp:Transform; # 8
+:transform0 a vamp:Transform;
 	vamp:plugin examples:percussiononsets ;
 	vamp:output examples:percussiononsets_output_detectionfunction ;
 	vamp:summary_type "mean" .
 
-:transform1 a vamp:Transform; # 11
+:transform1 a vamp:Transform;
 	vamp:plugin examples:percussiononsets ;
 	vamp:output examples:percussiononsets_output_detectionfunction ;
 	vamp:summary_type "median" .
 
-:transform2 a vamp:Transform; # 0
+:transform2 a vamp:Transform;
 	vamp:plugin examples:percussiononsets ;
 	vamp:output examples:percussiononsets_output_onsets .
 
-:transform3 a vamp:Transform; # 14
+:transform3 a vamp:Transform;
 	vamp:plugin examples:percussiononsets ;
 	vamp:output examples:percussiononsets_output_detectionfunction ;
 	vamp:summary_type "mode" .
 
-:transform4 a vamp:Transform; # 23
+:transform4 a vamp:Transform;
 	vamp:plugin examples:percussiononsets ;
 	vamp:output examples:percussiononsets_output_detectionfunction ;
 	vamp:step_size 2048 ;