X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=tests%2Fpdtest;fp=tests%2Fpdtest;h=088ad91cdf2b387ec8d0127da66f83fc9a1ae2a3;hb=d510f7b3d5d03c6fca5b6af4e184dc2f46da9a1a;hp=57a8b54caf0d73957ef45463e7a2cd49c275ca6e;hpb=4e891b94cae1b3e83155721476137a900fe242a6;p=libsigrokdecode.git diff --git a/tests/pdtest b/tests/pdtest index 57a8b54..088ad91 100755 --- a/tests/pdtest +++ b/tests/pdtest @@ -20,6 +20,7 @@ import os import sys +import re from getopt import getopt from tempfile import mkstemp from subprocess import Popen, PIPE @@ -376,6 +377,12 @@ def run_tests(tests, fix=False): if coverage: results[-1]['coverage_report'] = coverage os.unlink(outfile) + if op['type'] == 'exception' and 'error' in results[-1]: + # filter out the exception we were looking for + reg = "^Error: srd: Protocol decoder instance %s: %s:" % (op['pd'], op['match']) + if re.match(reg, results[-1]['error']): + # found it, not an error + results[-1].pop('error') if VERBOSE: if 'diff' in results[-1]: INFO("Output mismatch")