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

Created on 16 Feb 2016  路  1Comment  路  Source: go-delve/delve

How should the command to run a single test via delve be like? I've tried both:

  • dlv --build-flags="-run ^TestHello$" test github.com/dlsniper/u/tmp/mypack --
  • dlv test github.com/dlsniper/u/tmp/mypack -- -run ^TestHello$
    but without luck (all the tests in the package run for both of them).

I can upload the test example if needed.
Thank you!

Most helpful comment

Nevermind, I've finally figured it out, I need to run something like this:

dlv test --build-flags='github.com/dlsniper/u/tmp/mypack' -- -test.run ^TestHello$

Sorry for noise

>All comments

Nevermind, I've finally figured it out, I need to run something like this:

dlv test --build-flags='github.com/dlsniper/u/tmp/mypack' -- -test.run ^TestHello$

Sorry for noise

Was this page helpful?
0 / 5 - 0 ratings