From 133862491d054644cf08b7e6b6d5798d301a533a Mon Sep 17 00:00:00 2001 From: Alami-Amine Date: Mon, 11 Nov 2024 10:05:58 +0100 Subject: [PATCH] [VSCode] Add Debugging targets for pw_fuzzer FuzzTests: 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 --- .vscode/launch.json | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/.vscode/launch.json b/.vscode/launch.json index fc821c76eb802c..97ba95d77f0bad 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -34,6 +34,25 @@ "args": [], "cwd": "${workspaceFolder}" }, + + { + "name": "Run pw FuzzTest (Linux x64) UnitTest Mode", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/out/${input:outPWFuzzTestLinux}", + "cwd": "${workspaceFolder}" + }, + + { + "name": "Run pw FuzzTest (Linux x64) Continuous Fuzzing Mode", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/out/${input:outPWFuzzTestLinux}", + "args": ["-fuzz=${input:fuzzTestName}"], + "cwd": "${workspaceFolder}", + "preLaunchTask": "" + }, + { "name": "QRCode Tests", "type": "cppdbg", @@ -528,6 +547,24 @@ "description": "Select the test to run" } }, + { + "type": "command", + "id": "outPWFuzzTestLinux", + "command": "shellCommand.execute", + "args": { + "command": "find ${workspaceFolder}/out/linux-x64-*/chip_pw_fuzztest/tests -type f -executable |sort |sed 's$${workspaceFolder}/out/$$'", + "description": "Select the FuzzTest to run" + } + }, + { + "id": "fuzzTestName", + "type": "command", + "command": "shellCommand.execute", + "args": { + "command": "./out/${input:outPWFuzzTestLinux} --list_fuzz_tests | grep 'Fuzz test:' | awk -F ': ' '{print $2}'", + "description": "Select the specific FuzzTest to fuzz continuously" + } + }, { "type": "pickString", "id": "mbedDebugProfile",