GoUnit-Emacs
is a package for Emacs for automatically generating table driven tests. It uses gounit
to generate missing tests based on its target source files' function and method signatures. Any new dependencies in the test files are automatically imported.
Prequisite: Use go get
to install and update the gounit
tool:
$ go get -u github.com/hexdigest/gounit/...
Next, copy GoUnit-Emacs in your .emacs directory
cd ~/.emacs.d
wget https://raw.githubusercontent.com/hexdigest/GoUnit-Emacs/master/gounit.el
In your .emacs add the following:
;; gounit
(add-to-list 'load-path "~/.emacs.d/")
(require 'gounit)
Select some functions and run M-x gounit-region
. This appends missing tests to an existing test file, or creates a new test file with them. To generate all missing tests use M-x gounit
GoUnit-Emacs
is released under the Apache 2.0 License.