qur / withmock

Automatic Go package mock generation tool
Other
71 stars 9 forks source link

Gocov doesn't report code coverage properly with runtime_control branch #15

Closed imosquera closed 10 years ago

imosquera commented 10 years ago

When using the runtime_control branch it doesn't cover code properly.

go get https://github.com/imosquera/withmock-examples

./run.sh -n ./run.sh tests to see that the code is not covered although it does call code paths.

qur commented 10 years ago

Um ... have you forgotten to push?

imosquera commented 10 years ago

sorry about that, try now.

qur commented 10 years ago

Your tests aren't actually running. You need to call your test methods TestXXX, not XXXTest.

What this does show is that mocktest needs a method to add arguments to the command line, as I had to use withmock to be able to add -gocheck.vv

qur commented 10 years ago

You are also missing a call to baz.MOCK().SetController in foo_test - which I really need to handle better ...

imosquera commented 10 years ago

wow, thanks for catching a lot of mistakes. I hastily made that project. I'll make fixes and get back to you.

imosquera commented 10 years ago

Yeah, that all works now. I'll check the fixed code back in.