-l List test(s)
-s Show test(s)
-r Run test(s)
- -f Fix failed test(s)
+ -f Fix failed test(s) / create initial output for new test(s)
-c Report decoder code coverage
-R <directory> Save test reports to <directory>
<test> Protocol decoder name ("i2c") and optionally test name ("i2c/rtc")""")
for label, channel in pd['channels']:
print(" Channel %s=%d" % (label, channel))
for option, value in pd['options']:
- print(" Option %s=%d" % (option, value))
+ print(" Option %s=%s" % (option, value))
if 'stack' in tc:
print(" Stack: %s" % ' '.join(tc['stack']))
print(" Input: %s" % tc['input'])
try:
if args:
testlist = get_tests(args)
- elif opt_all:
+ elif opt_all or opt_list:
testlist = get_tests(os.listdir(tests_dir))
else:
usage("Specify either -a or tests.")
ERR("Could not find sigrok-dumps repository at %s" % dumps_dir)
sys.exit(1)
results, errors = run_tests(testlist, fix=opt_fix)
+ ret = 0
errs, diffs = get_run_tests_error_diff_counts(results)
- ret = errs or diffs or 0
+ if errs:
+ ret = 1
+ elif diffs:
+ ret = 2
elif opt_show:
show_tests(testlist)
elif opt_list:
raise
sys.exit(ret)
-