Mercurial > hg
comparison tests/run-tests.py @ 32853:3139a7a1e7d4
tests: try and fail more gracefully with broken unicode escapes
author | Augie Fackler <augie@google.com> |
---|---|
date | Thu, 15 Jun 2017 13:13:36 -0400 |
parents | 0cd641bfbf57 |
children | bd77ac2bd23a |
comparison
equal
deleted
inserted
replaced
32852:3a64ac39b893 | 32853:3139a7a1e7d4 |
---|---|
2091 ('skip', result.skipped)] | 2091 ('skip', result.skipped)] |
2092 for res, testcases in groups: | 2092 for res, testcases in groups: |
2093 for tc, __ in testcases: | 2093 for tc, __ in testcases: |
2094 if tc.name in timesd: | 2094 if tc.name in timesd: |
2095 diff = result.faildata.get(tc.name, b'') | 2095 diff = result.faildata.get(tc.name, b'') |
2096 try: | |
2097 diff = diff.decode('unicode_escape') | |
2098 except UnicodeDecodeError as e: | |
2099 diff = '%r decoding diff, sorry' % e | |
2096 tres = {'result': res, | 2100 tres = {'result': res, |
2097 'time': ('%0.3f' % timesd[tc.name][2]), | 2101 'time': ('%0.3f' % timesd[tc.name][2]), |
2098 'cuser': ('%0.3f' % timesd[tc.name][0]), | 2102 'cuser': ('%0.3f' % timesd[tc.name][0]), |
2099 'csys': ('%0.3f' % timesd[tc.name][1]), | 2103 'csys': ('%0.3f' % timesd[tc.name][1]), |
2100 'start': ('%0.3f' % timesd[tc.name][3]), | 2104 'start': ('%0.3f' % timesd[tc.name][3]), |
2101 'end': ('%0.3f' % timesd[tc.name][4]), | 2105 'end': ('%0.3f' % timesd[tc.name][4]), |
2102 'diff': diff.decode('unicode_escape'), | 2106 'diff': diff, |
2103 } | 2107 } |
2104 else: | 2108 else: |
2105 # blacklisted test | 2109 # blacklisted test |
2106 tres = {'result': res} | 2110 tres = {'result': res} |
2107 | 2111 |