Mercurial > hg > sonic-annotator
comparison tests/test-as-advertised/test-as-advertised.sh @ 197:3b7ec45abd1c
Add mandatory option --json-format to JSON feature writer, in preparation for supporting multiple JSON formats (perhaps) in future
author | Chris Cannam |
---|---|
date | Tue, 01 Sep 2015 17:05:32 +0100 |
parents | b3d73c08b6ce |
children | f35bbb3e4d41 |
comparison
equal
deleted
inserted
replaced
196:082c3f21f49e | 197:3b7ec45abd1c |
---|---|
29 # | 29 # |
30 # * The "audiodb" writer will not print any output for features | 30 # * The "audiodb" writer will not print any output for features |
31 # that have no values (but are only point events). I don't know | 31 # that have no values (but are only point events). I don't know |
32 # how reasonable that is, but it's clearly intentional. It also | 32 # how reasonable that is, but it's clearly intentional. It also |
33 # writes to a subdirectory $basedir/$catid/$trackid.$output | 33 # writes to a subdirectory $basedir/$catid/$trackid.$output |
34 # | |
35 # * The "json" reader has a mandatory --json-format parameter that | |
36 # currently only accepts one argument ("jams"). It should fail if | |
37 # run with any other value or without this parameter. | |
34 | 38 |
35 case $type in | 39 case $type in |
36 audiodb) | 40 audiodb) |
37 mkdir -p $adbdir | 41 mkdir -p $adbdir |
38 $r -t $df -w $type $tmpwav --audiodb-basedir $tmpdir --audiodb-catid `basename $adbdir` 2>/dev/null || \ | 42 $r -t $df -w $type $tmpwav --audiodb-basedir $tmpdir --audiodb-catid `basename $adbdir` 2>/dev/null || \ |
39 fail "Fails to run with reader type \"$type\" and default options" | 43 fail "Fails to run with reader type \"$type\" and default options" |
40 ;; | 44 ;; |
41 default) | 45 default) |
42 $r -t $onsets -w $type $tmpwav > $tmpdir/test.out 2>/dev/null || \ | 46 $r -t $onsets -w $type $tmpwav > $tmpdir/test.out 2>/dev/null || \ |
43 fail "Fails to run with reader type \"$type\" and default options" | 47 fail "Fails to run with reader type \"$type\" and default options" |
48 ;; | |
49 json) | |
50 $r -t $onsets -w $type $tmpwav 2>/dev/null && \ | |
51 fail "Wrongly succeeds in running with reader type \"$type\" and default options" | |
52 $r -t $onsets -w $type $tmpwav --json-format blah 2>/dev/null && \ | |
53 fail "Wrongly succeeds in running with reader type \"$type\" and unknown json-format option" | |
54 $r -t $onsets -w $type $tmpwav --json-format 2>/dev/null && \ | |
55 fail "Wrongly succeeds in running with reader type \"$type\" and empty json-format option" | |
56 $r -t $onsets -w $type $tmpwav --json-format jams 2>/dev/null || \ | |
57 fail "Fails to run with reader type \"$type\" and correct json-format option" | |
44 ;; | 58 ;; |
45 *) | 59 *) |
46 $r -t $onsets -w $type $tmpwav 2>/dev/null || \ | 60 $r -t $onsets -w $type $tmpwav 2>/dev/null || \ |
47 fail "Fails to run with reader type \"$type\" and default options" | 61 fail "Fails to run with reader type \"$type\" and default options" |
48 ;; | 62 ;; |