diff options
author | Jason Ekstrand <jason.ekstrand@intel.com> | 2015-08-31 20:34:37 -0700 |
---|---|---|
committer | Jason Ekstrand <jason.ekstrand@intel.com> | 2015-08-31 20:34:37 -0700 |
commit | b18a12afe144ac3305978048cc39486a9659b848 (patch) | |
tree | c213745e70c969010be33826d201471c1dcf595f /misc | |
parent | 00e482ba12bbc8d965b83c5aa3ea739890914fc9 (diff) |
crucible-report: Use a dictionary for status scores
Diffstat (limited to 'misc')
-rwxr-xr-x | misc/crucible-report | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/misc/crucible-report b/misc/crucible-report index 99b0c5f..f7532cf 100755 --- a/misc/crucible-report +++ b/misc/crucible-report @@ -43,17 +43,12 @@ def parse_results(fname): return results -def score_status(status): - if status == 'lost': - return -2 - elif status == 'fail': - return -1 - elif status == 'skip': - return 0 - elif status == 'pass': - return 1 - else: - assert False +status_score = { + 'lost': -2, + 'fail': -1, + 'skip': 0, + 'pass': 1, +} if len(sys.argv) < 3: print(usage) @@ -73,7 +68,7 @@ for name in status1.keys(): if status1[name] == status2[name]: continue - if score_status(status1[name]) < score_status(status2[name]): + if status_score[status1[name]] < status_score[status2[name]]: fixed += 1 else: regressions += 1 |