DisposaBoy/GoSublime — pull request #414 by duskhacker (2013-11-26 22:52:56+00:00)
Title: Testing enhancement

This is my stab at providing the workflow I mentioned in issue #412.

* Optionally clear the quick panel on a new test run ( set `"clear_quick_panel_on_test_run": 1` in User settings)
* Provide support for [Gocheck](http://labix.org/gocheck)
* Provide support for quickly re-running a test or benchmark
* The last test or benchmark is saved in the aux settings, and is inserted into the UI picker as the first entry, so it just takes calling up the UI and pressing enter. Additionally, the test's working directory is also saved, the tests are run in that context to allow running the same test from other parts of a project, or different projects under GOPATH.
* Provide the ability to pass extra arguments to tests, benchmarks and `gocheck` tests and benchmarks. (set `"extra_gocheck_args"` and `"extra_test_args"` to an list of strings that are the options)

Notes:

I feel like this is kind of hacky, especially when I added the gocheck support. The `GsTestCommand`#`cb` and `gstest#handle_action` could be more well-factored from the get-go, and I just made it worse adding to it. However, this is about the best I can do for right now, and it has the virtue of working :).

It would be nice to figure out how to use the `mg9.declaration` method in `handle_action` so that the package and file declarations are available to discriminate gocheck tests/benchmarks, but that's more than I can do at the moment.

Lastly, there is a for-loop I commented out that doesn't seem to do anything, removing that code hasn't affected me, and I can't figure out how it could work in the current context.