]> sigrok.org Git - sigrok-test.git/blobdiff - decoder/pdtest
pdtest: say that '-f' creates initial output for new tests
[sigrok-test.git] / decoder / pdtest
index 591ad1d5106a6b86544042816dfa99c9791749ed..da548e3c73ecd2bf4857bf7d6836b0dad5781bcc 100755 (executable)
@@ -62,7 +62,7 @@ def usage(msg=None):
   -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")""")
@@ -571,8 +571,12 @@ try:
             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:
@@ -587,4 +591,3 @@ except Exception as e:
         raise
 
 sys.exit(ret)
-