Cool! What's the performance like, compared to usual? I have to admit that I've been quietly hoping that cov would be fixed for quite some time now.
On a side note:I think you mean to check for `key + "="` instead of "GOPATH="?
(peter) ~/tmp ~/go/bin/gocov test github.com/pebbe/go-proj-4/proj
failed to instrument package(.): no Go source files in /home/peter/
tmp
(peter) ~/tmp
proj_api.h is part of PROJ.4. There is no pkg-config with PROJ.4 you
can use, so if it's installed in a non-standard location, you need to
set CPATH and LIBRARY_PATH for compiling and linking, and
LD_LIBRARY_PATH for running go-proj-4.
I get this with new version of gocov:
panic: runtime error: invalid memory address or nil pointer
dereference
[signal 0xb code=0x1 addr=0x20 pc=0x405ea6]
I can reproduce this now - I missed the cgo files when parsing packages.There's a few other things too, like retaining comments (for import "C")I'll take a look at fixing this when I get home from work.
I'm having some trouble with this now: it was working a few days ago.
I was testing biogo.llrb and previously this was fine, now it returns:
failed to parse gocov output: stat /tmp/gocov842622250/gocov.out: no such file or directory
after the tests complete (successfully).
It also fails on a new package (step) I'm working on which depends on llrb, but in this case it completes, warning that llrb is out of date (it isn't and go test does not give the same warning). It the proceeds to give me a detailed (though out of date) coverage report for llrb rather than a report for step.
I will attempt to create a self-contained minimal test-case in the next few days.One thing to note is that we use vagrant for our development environment. I don't know if that matters at all.
--
Thanks,
Rob Kinyon
Hi,
just to let you know that I have published gocov-html, a simple tool for generating HTML reports from the output of gocov.
Documentation and source code can be found at https://github.com/matm/gocov-html.
Cheers,
Mathias
On 26 January 2013, matm said:Nice! Thank you for that; it'll definitely make using gocov more fun.
> just to let you know that I have published gocov-html, a simple tool for
> generating HTML reports from the output of gocov.
Have you thought about turning gocov-html into a pull request against
gocov? It would be nice to have all that functionality in one
convenient place.
This is happening to me, and I pinpointed some of the "why", but I don't have a fix.
The problem seems to be that if there is an installed version of the being-tested package in my current workspace (which is the only entry in my GOPATH), somehow this version is run instead of the instrumented version in the newly created temporary workspace.Looking at the source code I see that GOROOT is modified to point at the newly created temporary workspace, and looking at it (by using the --work flag) I see the instrumented package was successfully created there. And yet, the package is taken still taken from the original workspace - that is, from my GOPATH.The error is, as one would expect:ok my/package/name 0.013sfailed to parse gocov output: stat /tmp/gocov072425766/gocov.out: no such file or directorySo, I added a line (next to setting the GOROOT) that sets GOPATH to be the newly created tempDir + ":" + the old value of GOPATH. I figured this will force finding the instrumented package, but this didn't make a difference(!?!?). Just for kicks I changed GOPATH to be only tempDir, and I got the expected warning that GOPATH has no effect, and of course running the tests failed due to missing dependencies - it did find the instrumented package itself though.I am stumped at this point. My workaround is to simply remove the pkg directory before I run gocov, but that's a brutal workaround. Any ideas of a better solution would be welcome.Thanks,Oren Ben-Kiki