summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBert Vermeulen <bert@biot.com>2014-03-14 01:00:25 +0100
committerBert Vermeulen <bert@biot.com>2014-03-14 01:00:25 +0100
commitea1fc7b1a9d857c7ad147c1b81c6e4b3aa1cd3b6 (patch)
tree1c7e9a9fb2c21f3ebdcc49ae151fe18d6b3cf4a2
parentb0918d40e285e7782f4e86356c41648dc748e477 (diff)
downloadlibsigrokdecode-ea1fc7b1a9d857c7ad147c1b81c6e4b3aa1cd3b6.tar.gz
libsigrokdecode-ea1fc7b1a9d857c7ad147c1b81c6e4b3aa1cd3b6.zip
pdtest: Small fix.
-rwxr-xr-xtests/pdtest13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/pdtest b/tests/pdtest
index 8a760f2..158b3e0 100755
--- a/tests/pdtest
+++ b/tests/pdtest
@@ -293,21 +293,22 @@ def run_tests(tests, fix=False):
# message on stderr about it
results[-1]['error'] = "Unknown error: runtc %d" % p.returncode
if 'error' not in results[-1]:
- match = os.path.join(decoders_dir, op['pd'], 'test', op['match'])
+ matchfile = os.path.join(decoders_dir, op['pd'], 'test', op['match'])
+ DBG("Comparing with %s" % matchfile)
try:
diff = diff_error = None
if op['type'] in ('annotation', 'python'):
- diff = diff_text(match, outfile)
+ diff = diff_text(matchfile, outfile)
elif op['type'] == 'binary':
- diff = compare_binary(match, outfile)
+ diff = compare_binary(matchfile, outfile)
else:
diff = ["Unsupported output type '%s'." % op['type']]
except Exception as e:
diff_error = e
if fix:
if diff or diff_error:
- copy(outfile, match)
- DBG("Wrote %s" % match)
+ copy(outfile, matchfile)
+ DBG("Wrote %s" % matchfile)
else:
if diff:
results[-1]['diff'] = diff
@@ -447,7 +448,7 @@ try:
if not os.path.isdir(dumps_dir):
ERR("Could not find sigrok-dumps repository at %s" % dumps_dir)
sys.exit(1)
- results, errors = run_tests(testlist)
+ results, errors = run_tests(testlist, fix=opt_fix)
ret = errors
elif opt_show:
show_tests(testlist)