mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-13 09:50:36 +00:00
Meta: Make test_pdf.py not count regular "failed to open" as crash
Some files just aren't valid PDF files that e.g. Preview.app can't open either. Let's not count those (exit code 1) as crashes.
This commit is contained in:
parent
11bee7a075
commit
df0dd26ce2
Notes:
sideshowbarker
2024-07-17 05:41:34 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/df0dd26ce2 Pull-request: https://github.com/SerenityOS/serenity/pull/21556
1 changed files with 12 additions and 1 deletions
|
@ -59,12 +59,17 @@ def main():
|
|||
|
||||
results = multiprocessing.Pool().map(test_pdf, files)
|
||||
|
||||
failed_files = []
|
||||
num_crashes = 0
|
||||
stack_to_files = {}
|
||||
for r in results:
|
||||
print(r.filename)
|
||||
print(r.stdout.decode('utf-8'))
|
||||
if r.returncode != 0:
|
||||
if r.returncode == 0:
|
||||
continue
|
||||
if r.returncode == 1:
|
||||
failed_files.append(r.filename)
|
||||
else:
|
||||
num_crashes += 1
|
||||
stack_to_files.setdefault(r.stderr, []).append(r.filename)
|
||||
|
||||
|
@ -83,6 +88,12 @@ def main():
|
|||
print(f'{num_crashes} crashes ({percent:.1f}%)')
|
||||
print(f'{len(keys)} distinct crash stacks')
|
||||
|
||||
percent = 100 * len(failed_files) / len(results)
|
||||
print()
|
||||
print(f'{len(failed_files)} failed to open ({percent:.1f}%)')
|
||||
for f in failed_files:
|
||||
print(f' {f}')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
Loading…
Reference in a new issue