Configurable extra arguments to go test

ADD:
  - layers/+lang/go/config.el Added new variable `go-use-test-args` to allow
    specifying additional arguments being passed to `go test.

CHANGE:
  - layers/+lang/go/packages.el Updated `go-run-tests` to automatically concat
    the new variable `go-use-test-args` to args passed to `go test`.
This commit is contained in:
Ian Clark 2017-01-06 13:06:30 -06:00 committed by Eivind Fonn
parent 5bacb13a75
commit 249c3b87b0
3 changed files with 10 additions and 1 deletions

View File

@ -103,6 +103,11 @@ Tests are run in a compilation buffer displayed in a popup window that can be
closed by pressing ~C-g~ from any other window. The variable
=go-test-buffer-name= can be customized to set the output buffer name.
To provide additional arguments to go test, specify =go-use-test-args=.
#+begin_src emacs-lisp
(go :variables go-use-test-args "-race -timeout 10s"
#+end_src
** Guru
Go Oracle has been deprecated as of October 1, 2016, it's replacement is =go-guru=.

View File

@ -24,3 +24,6 @@
(defvar go-test-buffer-name "*go test*"
"Name of the buffer for go test output. Default is *go test*.")
(defvar go-use-test-args ""
"Additional arguments to be supplied to `go test` during runtime.")

View File

@ -65,7 +65,8 @@
(defun spacemacs/go-run-tests (args)
(interactive)
(compilation-start (concat "go test " args) nil (lambda (n) go-test-buffer-name) nil))
(compilation-start (concat "go test " args " " go-use-test-args)
nil (lambda (n) go-test-buffer-name) nil))
(defun spacemacs/go-run-package-tests ()
(interactive)