I have eclipse and goclipse installed, all is well, I can run a console app in the IDE. It is possible to execute the unit tests in the IDE too?
The latest release of goclipse (0.7.6) does provide a means of doing testing using the "testing" package assuming you have followed the project structure recommended in C:/Go/doc/code.html
in the installed file structure created when installing Go.
Using the Eclipse "run external tools" button create a new external tool configuration as follows:
C:/Go/bin/go.exe
test
${workspace_loc:/goProject/src/pnp}
, where pnp
is the name of the package NOT the name of the go file that contains the test).You can now run the test by pressing the Run button in the usual manner, having given the configuration a sensible name eg: go test pnp. You can now add further tests to the package in different go files (or the same one) and all the tests will be carried out in a manner that is expected.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With