|
32 | 32 | File "", line 1 in testfunc |
33 | 33 | """ |
34 | 34 |
|
| 35 | +VALID_CRASH_TEXT_PY314=""" |
| 36 | +Fatal Python error: Segmentation fault |
| 37 | +_ |
| 38 | +Current thread 0x00000001fe53e140 [CrBrowserMain] (most recent call first): |
| 39 | + File "qutebrowser/app.py", line 126 in qt_mainloop |
| 40 | + File "qutebrowser/app.py", line 116 in run |
| 41 | + File "qutebrowser/qutebrowser.py", line 234 in main |
| 42 | + File "__main__.py", line 15 in <module> |
| 43 | +_ |
| 44 | +Current thread's C stack trace (most recent call first): |
| 45 | + Binary file "...", at _Py_DumpStack+0x48 [0x10227cc9c] |
| 46 | + <truncated rest of calls> |
| 47 | +""" |
| 48 | + |
| 49 | +VALID_CRASH_TEXT_PY314_NO_PY=""" |
| 50 | +Fatal Python error: Segmentation fault |
| 51 | +_ |
| 52 | +Current thread 0x00007f0dc805cbc0 [qutebrowser] (most recent call first): |
| 53 | + <no Python frame> |
| 54 | +_ |
| 55 | +Current thread's C stack trace (most recent call first): |
| 56 | + Binary file "/lib64/libpython3.14.so.1.0", at _Py_DumpStack+0x4c [0x7f0dc7b2127b] |
| 57 | + <truncated rest of calls> |
| 58 | +""" |
| 59 | + |
35 | 60 | WINDOWS_CRASH_TEXT=r""" |
36 | 61 | Windows fatal exception: access violation |
37 | 62 | _ |
|
45 | 70 | """ |
46 | 71 |
|
47 | 72 |
|
48 | | -@pytest.mark.parametrize('text, typ, func', [ |
49 | | - (VALID_CRASH_TEXT,'Segmentation fault','testfunc'), |
50 | | - (VALID_CRASH_TEXT_THREAD,'Segmentation fault','testfunc'), |
51 | | - (VALID_CRASH_TEXT_EMPTY,'Aborted',''), |
52 | | - (WINDOWS_CRASH_TEXT,'Windows access violation','tabopen'), |
53 | | - (INVALID_CRASH_TEXT,'',''), |
54 | | -]) |
| 73 | +@pytest.mark.parametrize( |
| 74 | +"text, typ, func", |
| 75 | + [ |
| 76 | +pytest.param(VALID_CRASH_TEXT,"Segmentation fault","testfunc",id="valid"), |
| 77 | +pytest.param( |
| 78 | +VALID_CRASH_TEXT_THREAD,"Segmentation fault","testfunc",id="valid-thread" |
| 79 | + ), |
| 80 | +pytest.param( |
| 81 | +VALID_CRASH_TEXT_PY314, |
| 82 | +"Segmentation fault", |
| 83 | +"qt mainloop", |
| 84 | +id="valid-py314", |
| 85 | + ), |
| 86 | +pytest.param( |
| 87 | +VALID_CRASH_TEXT_PY314_NO_PY, |
| 88 | +"Segmentation fault", |
| 89 | +"", |
| 90 | +id="valid-py314-no-py", |
| 91 | + ), |
| 92 | +pytest.param(VALID_CRASH_TEXT_EMPTY,"Aborted","",id="valid-empty"), |
| 93 | +pytest.param( |
| 94 | +WINDOWS_CRASH_TEXT,"Windows access violation","tabopen",id="windows" |
| 95 | + ), |
| 96 | +pytest.param(INVALID_CRASH_TEXT,"","",id="invalid"), |
| 97 | + ], |
| 98 | +) |
55 | 99 | deftest_parse_fatal_stacktrace(text,typ,func): |
56 | 100 | text=text.strip().replace('_',' ') |
57 | 101 | assertcrashdialog.parse_fatal_stacktrace(text)== (typ,func) |
|