Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: timeout after 10 seconds #578

Merged
merged 1 commit into from
Oct 18, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions autoload/go/cmd.vim
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ function! go#cmd#autowrite()
endif
endfunction


" Build buils the source code without producting any output binary. We live in
" an editor so the best is to build it to catch errors and fix them. By
" default it tries to call simply 'go build', but it first tries to get all
Expand Down Expand Up @@ -133,6 +134,10 @@ function! go#cmd#Test(bang, compile, ...)

if a:0
let command .= go#util#Shelljoin(map(copy(a:000), "expand(v:val)"))
else
" only add this if no custom flags are passed
let timeout = get(g:, 'go_test_timeout', '10s')
let command .= "-timeout=" . timeout . " "
endif

call go#cmd#autowrite()
Expand Down
14 changes: 13 additions & 1 deletion doc/vim-go.txt
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,10 @@ COMMANDS *go-commands*
You may optionally pass any valid go test flags/options. For a full list
please see `go help test`.

GoTest timesout automatically after 10 seconds. To customize the timeout
use |g:go_test_timeout|. This feature is disabled if any arguments are
passed to the `:GoTest` command.

If [!] is not given the first error is jumped to.

*:GoTestFunc*
Expand Down Expand Up @@ -599,14 +603,22 @@ if "inside a function", select contents of a function,
===============================================================================
SETTINGS *go-settings*

*'g:go_test_timeout'*

Use this option to change the test timeout of |:GoTest|. By default it is
set to 10 seconds . >

let g:go_test_timeout= '10s'
<

*'g:go_play_browser_command'*

Use this option to change the browser that is used to open the snippet url
posted to play.golang.org with |:GoPlay| or for the relevant documentation
used with |:GoDocBrowser|. By default it tries to find it automatically for
the current OS. >

let g:play_browser_command = ''
let g:go_play_browser_command = ''
<
*'g:go_play_open_browser'*

Expand Down