Delve: debugging of tests

Created on 26 Nov 2014  路  5Comments  路  Source: go-delve/delve

$ dlv -run
[Could not start process: fork/exec ./debug: permission denied]
$ chmod +x ./debug
$ dlv -run
[Could not start process: fork/exec ./debug: permission denied]

Most helpful comment

@ajpen if you want to debug a non-main package (that has tests) you can use dlv test <pkg>. If that doesn't work please submit a new issue.

All 5 comments

Some more context around this would also be nice. What do you mean by "debugging of tests"? Are you in a test dir and trying to compile and run all of your tests? dlv -run will compile and run based off of the current dir. It's using go build under the hood, so anything that wouldn't normally be compiled, like tests, get ignored.

If you want to debug tests try go test -c; dlv ./foo.test.

Going to close this issue out. If the above suggestions do not solve this, please feel free to reopen with more context. Thanks.

I just came across this issue when trying to debug a 'non-main' package with dlv debug. That's likely the cause.

@ajpen if you want to debug a non-main package (that has tests) you can use dlv test <pkg>. If that doesn't work please submit a new issue.

@derekparker Good to hear from you Derek. I just placed that comment up to give some context for anyone else that might run into it and find themselves here. Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

christianwoehrle picture christianwoehrle  路  5Comments

kdeenanauth picture kdeenanauth  路  5Comments

luminacious picture luminacious  路  5Comments

itzg picture itzg  路  5Comments

aybabtme picture aybabtme  路  3Comments