diff options
author | Bert Vermeulen <bert@biot.com> | 2013-12-13 18:11:52 +0100 |
---|---|---|
committer | Bert Vermeulen <bert@biot.com> | 2013-12-13 18:11:52 +0100 |
commit | b7e15e0e2c1fef3a938c84d79022098f8482920a (patch) | |
tree | 336013c9ad8327a9e0202759c5989b0424d711b6 /tests/pdtest | |
parent | 3d14e7c9ac0155c0438b46dee267e3e16a6b8e3a (diff) | |
download | libsigrokdecode-b7e15e0e2c1fef3a938c84d79022098f8482920a.tar.gz libsigrokdecode-b7e15e0e2c1fef3a938c84d79022098f8482920a.zip |
pdtest/runtc: Add support for Python output types.
Diffstat (limited to 'tests/pdtest')
-rwxr-xr-x | tests/pdtest | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/pdtest b/tests/pdtest index 2a90f2c..e88317a 100755 --- a/tests/pdtest +++ b/tests/pdtest @@ -205,7 +205,7 @@ def get_tests(testnames): return tests -def diff_textfiles(f1, f2): +def diff_text(f1, f2): t1 = open(f1).readlines() t2 = open(f2).readlines() diff = [] @@ -217,7 +217,7 @@ def diff_textfiles(f1, f2): return diff -def compare_binfiles(f1, f2): +def compare_binary(f1, f2): h1 = md5() h1.update(open(f1, 'rb').read()) h2 = md5() @@ -278,10 +278,10 @@ def run_tests(tests, fix=False): match = os.path.join(decoders_dir, op['pd'], 'test', op['match']) try: diff = diff_error = None - if op['type'] == 'annotation': - diff = diff_textfiles(match, outfile) + if op['type'] in ('annotation', 'python'): + diff = diff_text(match, outfile) elif op['type'] == 'binary': - diff = compare_binfiles(match, outfile) + diff = compare_binary(match, outfile) else: diff = ["Unsupported output type '%s'." % op['type']] except Exception as e: |