comparison tests/test-rdf-writer/test-rdf-writer.sh @ 119:7a31201dc42d test-reorg

Split out tests into individual directories, with simpler naming therein
author Chris Cannam
date Wed, 08 Oct 2014 15:08:57 +0100
parents tests/test-rdf-writer.sh@0fe5abb56a6e
children cbbf8a838b47
comparison
equal deleted inserted replaced
118:0fe5abb56a6e 119:7a31201dc42d
1 #!/bin/bash
2
3 . ../include.sh
4
5 infile=$audiopath/3clicks8.wav
6 tmpttl=$mypath/tmp_1_$$.ttl
7
8 trap "rm -f $tmpttl" 0
9
10 transformdir=$mypath/transforms
11
12 for rdfarg in "" "--rdf-plain" ; do
13
14 note=""
15 [ -n "$rdfarg" ] && note=" with $rdfarg"
16
17 rm -f $tmpttl
18
19 $r -t $transformdir/onsets.n3 -w rdf $infile $rdfarg --rdf-one-file $tmpttl 2>/dev/null || \
20 fail "Fails to run with onsets transform and RDF writer$note"
21
22 rapper -i turtle $tmpttl >/dev/null 2>&1 || \
23 fail "Fails to produce parseable RDF/TTL for onsets transform$note"
24
25 rapper -i turtle -c $tmpttl 2>&1 | egrep -q 'Parsing returned [1-9][0-9]+ triples' ||
26 fail "RDF output contains no triples (?) for onsets transform$note"
27
28 rm -f $tmpttl
29
30 $r -t $transformdir/detectionfunction.n3 -w rdf $infile $rdfarg --rdf-one-file $tmpttl 2>/dev/null || \
31 fail "Fails to run with detectionfunction transform and RDF writer$note"
32
33 rapper -i turtle $tmpttl >/dev/null 2>&1 || \
34 fail "Fails to produce parseable RDF/TTL for detectionfunction transform$note"
35
36 rapper -i turtle -c $tmpttl 2>&1 | egrep -q 'Parsing returned [1-9][0-9]+ triples' ||
37 fail "RDF output contains no triples (?) for detectionfunction transform$note"
38
39 rm -f $tmpttl
40
41 $r -t $transformdir/onsets.n3 -t $transformdir/detectionfunction.n3 -w rdf $infile $rdfarg --rdf-one-file $tmpttl 2>/dev/null || \
42 fail "Fails to run with detectionfunction and onsets transforms together and RDF writer$note"
43
44 rapper -i turtle $tmpttl >/dev/null 2>&1 || \
45 fail "Fails to produce parseable RDF/TTL for detectionfunction and onsets transforms together$note"
46
47 rapper -i turtle -c $tmpttl 2>&1 | egrep -q 'Parsing returned [1-9][0-9]+ triples' ||
48 fail "RDF output contains no triples (?) for detectionfunction and onsets transforms together$note"
49
50 done
51
52 exit 0