Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ane/rats.el

Manage Go tests inside Emacs
https://github.com/ane/rats.el

emacs golang testing-tools

Last synced: 3 months ago
JSON representation

Manage Go tests inside Emacs

Awesome Lists containing this project

README

        

# rats.el
[![MELPA](http://melpa.org/packages/rats-badge.svg)](http://melpa.org/#/rats) [![MELPA Stable](http://stable.melpa.org/packages/rats-badge.svg)](http://stable.melpa.org/#/rats)

Rats lets you run Go tests inside emacs, so that you don't need to keep a shell open and run `go
test` yourself. You can either choose to run a single test or multiple, and the results will be
displayed in the echo area.

## Installation

Using the Emacs package manager, make sure that you have [MELPA](http://melpa.org) or MELPA stable
in the package sources. For information on how to get MELPA in your package sources, please see
[here](http://melpa.org/#/getting-started).

Once you have installed `rats`, add this to your initialization script:

``` emacs-lisp
(add-hook go-mode-hook #'rats-mode)
```

Once `go-mode` activates again, you can now access Rats from the menu, or run commands interactively
(see [Usage](#usage)).

## Usage

If you're in a test file and inside a test, you can use `rats-run-test-under-point` to run that
test. If you're editing a file inside a directory that has tests, `rats-run-tests-for-package` and
it will run all the tests in the directory.

If you want to run a specific test, use `rats-run-test-in-current-buffer` to run a test from the
current buffer. This will list all the tests in the current buffer and let you pick one. The same
can be done for the whole package with `rats-run-test-from-package`.

To view the test report buffer, you can run `rats-show-test-buffer`.

## Bindings

| Binding | Description |
|----------------------|---------------------------------------|
| C-c C-t t | Run test under point. |
| C-c C-t a | Run all tests in the current package. |
| C-c C-t c | Choose and run a test from the current buffer, with completion support. |
| C-c C-t p | Choose and run a test from the current package, with completion support. |
| C-c C-t b | Show the test report buffer. |