comparison tests/test-summaries/test-summaries.sh @ 182:11a9ce2fa331

Add ability to read segment boundaries from a file; test for it; bump version no; make test script bail out if path has spaces (can't cope with that, sheesh)
author Chris Cannam
date Fri, 09 Jan 2015 11:48:12 +0000
parents 7a31201dc42d
children 382d49862393
comparison
equal deleted inserted replaced
181:c5619f2a63b1 182:11a9ce2fa331
24 transform=$mypath/transforms/detectionfunction-nosummaries.n3 24 transform=$mypath/transforms/detectionfunction-nosummaries.n3
25 expected=$mypath/expected/summaries 25 expected=$mypath/expected/summaries
26 26
27 stransform=$mypath/transforms/detectionfunction.n3 27 stransform=$mypath/transforms/detectionfunction.n3
28 sexpected=$mypath/expected/summaries-from-rdf 28 sexpected=$mypath/expected/summaries-from-rdf
29
30 seglist=$mypath/transforms/segmentlist
29 31
30 $r -t $transform -w csv --csv-stdout $infile > $tmpfile 2>/dev/null || \ 32 $r -t $transform -w csv --csv-stdout $infile > $tmpfile 2>/dev/null || \
31 fail "Fails to run transform $transform" 33 fail "Fails to run transform $transform"
32 34
33 compare $tmpfile ${expected}.csv || \ 35 compare $tmpfile ${expected}.csv || \
61 fail "Fails to run transform $stransform with CSV output and segments" 63 fail "Fails to run transform $stransform with CSV output and segments"
62 64
63 compare $tmpfile ${expected}-segments.csv || \ 65 compare $tmpfile ${expected}-segments.csv || \
64 faildiff "Output mismatch for transform $stransform with segments" $tmpfile ${expected}-segments.csv 66 faildiff "Output mismatch for transform $stransform with segments" $tmpfile ${expected}-segments.csv
65 67
68 $r -t $transform -w csv --csv-stdout --summary-only -S median --segments-from $seglist $infile2 > $tmpfile 2>/dev/null || \
69 fail "Fails to run transform $stransform with CSV output and segments from segment list"
70
71 compare $tmpfile ${expected}-segments.csv || \
72 faildiff "Output mismatch for transform $stransform with segments from segment list" $tmpfile ${expected}-segments.csv
73
66 $r -t $stransform -w rdf --rdf-stdout $infile > $tmpfile 2>/dev/null || \ 74 $r -t $stransform -w rdf --rdf-stdout $infile > $tmpfile 2>/dev/null || \
67 fail "Fails to run transform $stransform with RDF output" 75 fail "Fails to run transform $stransform with RDF output"
68 76
69 rapper -i turtle $tmpfile -o turtle 2>/dev/null | grep -v '^@prefix :' | grep -v 'file:/' > $tmpcanonical || 77 rapper -i turtle $tmpfile -o turtle 2>/dev/null | grep -v '^@prefix :' | grep -v 'file:/' > $tmpcanonical ||
70 fail "Fails to produce parseable RDF/TTL for transform $stransform" 78 fail "Fails to produce parseable RDF/TTL for transform $stransform"