Skip to content

Commit b2ebece

Browse files
authored
[VSCode] Add Debugging targets for pw_fuzzer FuzzTests: (project-chip#36453)
Two Targets are added: 1- Unit Test Mode: which executes all FuzzTests in a single binary for a few seconds 2- Continous Fuzzing Mode: we choose a specific FuzzTest, it will only stop execution once a crash occurs or user explicitly Interrupts it
1 parent 9e0ab58 commit b2ebece

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.vscode/launch.json

+37
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,25 @@
3434
"args": [],
3535
"cwd": "${workspaceFolder}"
3636
},
37+
38+
{
39+
"name": "Run pw FuzzTest (Linux x64) UnitTest Mode",
40+
"type": "cppdbg",
41+
"request": "launch",
42+
"program": "${workspaceFolder}/out/${input:outPWFuzzTestLinux}",
43+
"cwd": "${workspaceFolder}"
44+
},
45+
46+
{
47+
"name": "Run pw FuzzTest (Linux x64) Continuous Fuzzing Mode",
48+
"type": "cppdbg",
49+
"request": "launch",
50+
"program": "${workspaceFolder}/out/${input:outPWFuzzTestLinux}",
51+
"args": ["-fuzz=${input:fuzzTestName}"],
52+
"cwd": "${workspaceFolder}",
53+
"preLaunchTask": ""
54+
},
55+
3756
{
3857
"name": "QRCode Tests",
3958
"type": "cppdbg",
@@ -528,6 +547,24 @@
528547
"description": "Select the test to run"
529548
}
530549
},
550+
{
551+
"type": "command",
552+
"id": "outPWFuzzTestLinux",
553+
"command": "shellCommand.execute",
554+
"args": {
555+
"command": "find ${workspaceFolder}/out/linux-x64-*/chip_pw_fuzztest/tests -type f -executable |sort |sed 's$${workspaceFolder}/out/$$'",
556+
"description": "Select the FuzzTest to run"
557+
}
558+
},
559+
{
560+
"id": "fuzzTestName",
561+
"type": "command",
562+
"command": "shellCommand.execute",
563+
"args": {
564+
"command": "./out/${input:outPWFuzzTestLinux} --list_fuzz_tests | grep 'Fuzz test:' | awk -F ': ' '{print $2}'",
565+
"description": "Select the specific FuzzTest to fuzz continuously"
566+
}
567+
},
531568
{
532569
"type": "pickString",
533570
"id": "mbedDebugProfile",

0 commit comments

Comments
 (0)