Mercurial > hg > piper-cpp
comparison vamp-server/test.sh @ 179:0e13b7b80464
Remove some whitespace.
author | Lucas Thompson <dev@lucas.im> |
---|---|
date | Fri, 03 Feb 2017 11:09:37 +0000 |
parents | 353f842ed73f |
children | 376f59073160 |
comparison
equal
deleted
inserted
replaced
178:353f842ed73f | 179:0e13b7b80464 |
---|---|
81 {"jsonrpc": "2.0", "method": "process", "result": {"features": {}, "handle": 1}} | 81 {"jsonrpc": "2.0", "method": "process", "result": {"features": {}, "handle": 1}} |
82 {"jsonrpc": "2.0", "method": "finish", "result": {"features": {"detectionfunction": [{"featureValues": [0], "timestamp": {"n": 11609977, "s": 0}}]}, "handle": 1}} | 82 {"jsonrpc": "2.0", "method": "finish", "result": {"features": {"detectionfunction": [{"featureValues": [0], "timestamp": {"n": 11609977, "s": 0}}]}, "handle": 1}} |
83 {"error": {"code": 0, "message": "error in finish request: unknown plugin handle supplied to finish"}, "id": "blah", "jsonrpc": "2.0", "method": "finish"} | 83 {"error": {"code": 0, "message": "error in finish request: unknown plugin handle supplied to finish"}, "id": "blah", "jsonrpc": "2.0", "method": "finish"} |
84 EOF | 84 EOF |
85 | 85 |
86 # We run the whole test three times, | 86 # We run the whole test three times, |
87 # to cover (de)serialisation of json and capnp requests and responses | 87 # to cover (de)serialisation of json and capnp requests and responses |
88 # as well as exercising both server modes (json and capnp) | 88 # as well as exercising both server modes (json and capnp) |
89 # converting / reading from capnp requests is currently not tested | 89 # converting / reading from capnp requests is currently not tested |
90 | 90 |
91 #debugflag=-d | 91 #debugflag=-d |
119 ) < "$input" | 119 ) < "$input" |
120 | 120 |
121 # Skip plugin lists | 121 # Skip plugin lists |
122 tail -n +4 "$allrespfile" > "$obtained" | 122 tail -n +4 "$allrespfile" > "$obtained" |
123 | 123 |
124 echo "Checking response contents against expected contents..." | 124 echo "Checking response contents against expected contents..." |
125 | 125 # the expected configuration response is fragile, capnp fills in optional fields, |
126 # the expected configuration response is fragile, capnp fills in optional fields, | 126 # json doesn't - which is fine behaviour, but causes the test to fail - remove empty binCount and binNames |
127 # json doesn't - which is fine behaviour, but causes the test to fail - remove empty binCount and binNames | |
128 expected_without_optional_fields=$( cat "$expected" | sed -E 's/\"(binCount|binNames)\": ?((\[\])|0),? ?//g') | 127 expected_without_optional_fields=$( cat "$expected" | sed -E 's/\"(binCount|binNames)\": ?((\[\])|0),? ?//g') |
129 echo "$expected_without_optional_fields" > "$expected_less_strict" | 128 echo "$expected_without_optional_fields" > "$expected_less_strict" |
130 | 129 |
131 if cmp "$obtained" "$expected" -s || cmp "$obtained" "$expected_less_strict" -s; then | 130 if cmp "$obtained" "$expected" -s || cmp "$obtained" "$expected_less_strict" -s; then |
132 echo "OK" | 131 echo "OK" |