# HG changeset patch # User Lucas Thompson # Date 1485901311 0 # Node ID 492970caa62b2398adf07b76c31fb04c046c3a39 # Parent 8d2b124429035e4cb0ee2f86b883e76ef839dfe8# Parent cfa115746cb3135d87bd593a80835cfcaefa1b00 Merge branch 'master' of https://github.com/piper-audio/piper-cpp diff -r cfa115746cb3 -r 492970caa62b vamp-server/test.sh --- a/vamp-server/test.sh Tue Jan 31 18:05:11 2017 +0000 +++ b/vamp-server/test.sh Tue Jan 31 22:21:51 2017 +0000 @@ -89,16 +89,23 @@ #debugflag=-d debugflag= -for format in json capnp ; do # nb must be json first: see comment at end of loop +for request_response_conversion in none json_to_json json_to_capnp ; do ( export VAMP_PATH="$vampsdkdir"/examples ; while read request ; do validate_request "$request" echo "$request" done | - if [ "$format" = "json" ]; then + if [ "$request_response_conversion" = "none" ]; then "$bindir"/piper-vamp-simple-server $debugflag json + elif [ "$request_response_conversion" = "json_to_json" ]; then + "$bindir"/piper-convert request -i json -o json | + "$bindir"/piper-vamp-simple-server $debugflag json | + "$bindir"/piper-convert response -i json -o json else + # The capnp output doesn't preserve the method name in error + # responses, so replace those now that we've done the json tests + perl -i -p -e 's/(error.*"method": )"[^"]*"/$1"invalid"/' "$expected" "$bindir"/piper-convert request -i json -o capnp | "$bindir"/piper-vamp-simple-server $debugflag capnp | "$bindir"/piper-convert response -i capnp -o json @@ -153,10 +160,6 @@ echo OK rm "$allrespfile" - - # The capnp output doesn't preserve the method name in error - # responses, so replace those now that we've done the json test - perl -i -p -e 's/(error.*"method": )"[^"]*"/$1"invalid"/' "$expected" done echo "Tests succeeded" # set -e at top should ensure we don't get here otherwise