debug go fuzz test

List all package

go list ./...

Run testcase

dlv test --build-flags='api/tests/fuzz' -- -test.run ^FuzzGetNodes$

dlv test api/tests/fuzz -- -test.run FuzzGetNodes -test.v

 dlv debug

REF: 

Use Delve to Run and Debug a Single Unit Test in Go 

More: golang dlv test -fuzz   

How to run a single test from a package / file?  

More: dlv test run specific test  

funcs

b api/tests/fuzz.FuzzGetNodes

c

bt

 filter a function

dlv test --allow-non-terminal-interactive=true --build-flags='api/tests/fuzz' -- -test.run ^FuzzGetNodes$ <<< funcs | grep Connect

 

dlv 使用手册: golang debugging with delve

Debugging with Delve: execute function  dlv is a debugger, its not an interpreter 

Add ability to safely call functions  

Debugging tools for the Go programming language 

Allow users to list methods of struct/interface

 

Go: Debugging with Delve & Core Dumps

posted @ 2023-07-19 19:15  lvmxh  阅读(9)  评论(0编辑  收藏  举报