Skip to content

Commit 94d7c78

Browse files
dmcppcheckclaude
andcommitted
gui manual tests: add test for unused exclude paths
Add the scenario "Unused exclude paths are reported" with the test project unused-exclude: one exclude path that matches a file and one that matches nothing. Only the unused path is reported. Regenerate the script of "Other Help menu entries" against a build that has online-help.qhc. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent f411009 commit 94d7c78

6 files changed

Lines changed: 145 additions & 79 deletions

File tree

‎gui/manualtest/tests/analysis.feature‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,11 @@ Feature: Analysis and recheck
5353
| latin1 |
5454
| long_line |
5555
| unclosed_nesting |
56+
57+
@id:t1508ae01 @ticket:15081 @project:unused-exclude
58+
Scenario: Unused exclude paths are reported
59+
When I open the project file {project:unused-exclude}/p.cppcheck
60+
Then a warning message box says that there are unused exclude paths
61+
And the message lists src/missing/
62+
And the message does not list src/skip/, that exclude path is used
63+
And the message says that suppressions should be used to hide warnings in certain files

‎gui/manualtest/tests/analysis.scripts.json‎

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,5 +395,78 @@
395395
}
396396
],
397397
"script_for": "3090dfe1cf47"
398+
},
399+
"t1508ae01": {
400+
"script": [
401+
{
402+
"do": "click",
403+
"name": "File",
404+
"role": "menu item",
405+
"label": "Open the File menu to open the project file"
406+
},
407+
{
408+
"do": "click",
409+
"name": "Open Project File...",
410+
"role": "menu item",
411+
"label": "Choose Open Project File"
412+
},
413+
{
414+
"do": "wait",
415+
"name": "Select Project File",
416+
"role": "dialog",
417+
"label": "Wait for the project file dialog"
418+
},
419+
{
420+
"do": "settext",
421+
"name": "File name:",
422+
"role": "text",
423+
"value": "{project:unused-exclude}/p.cppcheck",
424+
"label": "Enter the project file {project:unused-exclude}/p.cppcheck"
425+
},
426+
{
427+
"do": "key",
428+
"keys": [
429+
"Return"
430+
],
431+
"label": "Open the project file"
432+
},
433+
{
434+
"expect": "visible",
435+
"name": "Project: p.cppcheck",
436+
"role": "frame",
437+
"timeout": 10,
438+
"label": "The project p.cppcheck is loaded"
439+
},
440+
{
441+
"expect": "visible",
442+
"name": "Cppcheck",
443+
"role": "alert",
444+
"timeout": 10,
445+
"label": "A warning message box is shown"
446+
},
447+
{
448+
"expect": "visible",
449+
"name": "Unused exclude paths",
450+
"role": "label",
451+
"label": "The message says that there are unused exclude paths"
452+
},
453+
{
454+
"expect": "text",
455+
"contains": "src/missing/",
456+
"label": "The message lists src/missing/"
457+
},
458+
{
459+
"expect": "text",
460+
"not_contains": "src/skip/",
461+
"label": "The message does not list src/skip/, that exclude path is used"
462+
},
463+
{
464+
"expect": "visible",
465+
"name": "to hide warnings in certain files use suppressions instead",
466+
"role": "label",
467+
"label": "The message says that suppressions should be used to hide warnings in certain files"
468+
}
469+
],
470+
"script_for": "8e3fa82eb6c0"
398471
}
399472
}

‎gui/manualtest/tests/application.scripts.json‎

Lines changed: 44 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -265,159 +265,124 @@
265265
"tc059b730": {
266266
"script": [
267267
{
268+
"label": "Open the Help menu",
268269
"do": "click",
269270
"name": "Help",
270-
"role": "menu item",
271-
"label": "Open the Help menu"
271+
"role": "menu item"
272272
},
273273
{
274+
"label": "Open the License entry of the Help menu",
274275
"do": "click",
275276
"name": "License...",
276-
"role": "menu item",
277-
"label": "Open License"
277+
"role": "menu item"
278278
},
279279
{
280+
"label": "The License entry opens a dialog",
280281
"expect": "visible",
281282
"name": "License",
282283
"role": "dialog",
283-
"label": "License dialog opens"
284+
"timeout": 5
284285
},
285286
{
287+
"label": "The License dialog has text in it (not empty)",
286288
"expect": "text",
287-
"contains": "GNU GENERAL PUBLIC LICENSE",
288-
"label": "License dialog has text"
289+
"contains": "Copyright"
289290
},
290291
{
292+
"label": "Close the License dialog with Escape",
291293
"do": "key",
292294
"keys": [
293295
"Escape"
294-
],
295-
"label": "Close License with Escape"
296+
]
296297
},
297298
{
299+
"label": "The License dialog is closed",
298300
"expect": "gone",
299301
"name": "License",
300-
"label": "License dialog is closed"
302+
"role": "dialog"
301303
},
302304
{
305+
"label": "Open the Help menu again",
303306
"do": "click",
304307
"name": "Help",
305-
"role": "menu item",
306-
"label": "Open the Help menu"
308+
"role": "menu item"
307309
},
308310
{
311+
"label": "Open the Authors entry of the Help menu",
309312
"do": "click",
310313
"name": "Authors...",
311-
"role": "menu item",
312-
"label": "Open Authors"
314+
"role": "menu item"
313315
},
314316
{
317+
"label": "The Authors entry opens a dialog",
315318
"expect": "visible",
316319
"name": "Authors",
317320
"role": "dialog",
318-
"label": "Authors dialog opens"
321+
"timeout": 5
319322
},
320323
{
324+
"label": "The Authors dialog has text in it (not empty)",
321325
"expect": "text",
322-
"contains": "The cppcheck team",
323-
"label": "Authors dialog has text"
326+
"contains": "The cppcheck team"
324327
},
325328
{
329+
"label": "Close the Authors dialog with its Close button",
326330
"do": "click",
327331
"name": "Close",
328-
"role": "button",
329-
"label": "Close Authors with its Close button"
332+
"role": "button"
330333
},
331334
{
335+
"label": "The Authors dialog is closed",
332336
"expect": "gone",
333337
"name": "Authors",
334-
"role": "dialog",
335-
"label": "Authors dialog is closed"
338+
"role": "dialog"
336339
},
337340
{
341+
"label": "Open the Help menu again",
338342
"do": "click",
339343
"name": "Help",
340-
"role": "menu item",
341-
"label": "Open the Help menu"
344+
"role": "menu item"
342345
},
343346
{
347+
"label": "Open the About entry of the Help menu",
344348
"do": "click",
345349
"name": "About...",
346-
"role": "menu item",
347-
"label": "Open About"
350+
"role": "menu item"
348351
},
349352
{
353+
"label": "The About entry opens a dialog",
350354
"expect": "visible",
351-
"name": "About Cppcheck",
355+
"name": "About",
352356
"role": "dialog",
353-
"label": "About dialog opens"
354-
},
355-
{
356-
"expect": "text",
357-
"contains": "Cppcheck - A tool for static C/C++ code analysis.",
358-
"label": "About dialog has text"
359-
},
360-
{
361-
"do": "key",
362-
"keys": [
363-
"Escape"
364-
],
365-
"label": "Close About with Escape"
366-
},
367-
{
368-
"expect": "gone",
369-
"name": "About Cppcheck",
370-
"role": "dialog",
371-
"label": "About dialog is closed"
372-
},
373-
{
374-
"do": "click",
375-
"name": "Help",
376-
"role": "menu item",
377-
"label": "Open the Help menu"
378-
},
379-
{
380-
"do": "click",
381-
"name": "Contents",
382-
"role": "menu item",
383-
"label": "Open Contents"
357+
"timeout": 5
384358
},
385359
{
360+
"label": "The About dialog has text in it: the version",
386361
"expect": "visible",
387-
"name": "Cppcheck",
388-
"role": "alert",
389-
"label": "Contents shows a message"
362+
"name": "Version",
363+
"role": "label"
390364
},
391365
{
366+
"label": "The About dialog is not empty: copyright text",
392367
"expect": "text",
393-
"contains": "Helpfile",
394-
"label": "Message has text"
368+
"contains": "Copyright"
395369
},
396370
{
371+
"label": "Close the About dialog with Escape",
397372
"do": "key",
398373
"keys": [
399374
"Escape"
400-
],
401-
"label": "Close the message with Escape"
402-
},
403-
{
404-
"expect": "visible",
405-
"name": "Cppcheck GUI help",
406-
"role": "dialog",
407-
"label": "Help window opens"
375+
]
408376
},
409377
{
410-
"expect": "text",
411-
"contains": "Introduction",
412-
"observed_fail": true,
413-
"label": "Help window has text in it, not empty"
378+
"label": "The About dialog is closed",
379+
"expect": "gone",
380+
"name": "About",
381+
"role": "dialog"
414382
},
415383
{
416-
"do": "key",
417-
"keys": [
418-
"Escape"
419-
],
420-
"label": "Close the help window with Escape"
384+
"label": "The application is still running after closing every window",
385+
"expect": "alive"
421386
}
422387
],
423388
"script_for": "97511d2313db"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project version="1">
3+
<paths>
4+
<dir name="src/"/>
5+
</paths>
6+
<exclude>
7+
<path name="src/skip/"/>
8+
<path name="src/missing/"/>
9+
</exclude>
10+
</project>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
int main(void)
2+
{
3+
int *p = 0;
4+
return *p;
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
int f(void)
2+
{
3+
int a[10];
4+
return a[10];
5+
}

0 commit comments

Comments
 (0)