How do you run unit tests from Emacs?

blov · · 587 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>Ideally I hit something like C-c C-t and my current project will be tested and results presented. Does anyone know of a good package that does this?</p> <hr/>**评论:**<br/><br/>nickcw: <pre><pre><code>M-x compile go test -v </code></pre> <p>Is what I do. Once you&#39;ve typed it the first time it is just M-x up return return </p></pre>zbobet2012: <pre><p>I would add you should totally do: <code>go test -v &amp;&amp; go vet &amp;&amp; golint</code> </p></pre>cfsalguero: <pre><p>M-x shell and then run vim having vim-go installed</p></pre>codemac: <pre><p>porjectile: <code>C-c p c</code> is running compile at the top level of the project.</p> <p>I also bind <code>C-c c</code> to compile of the current buffer, which for go modes I have set to <code>go test -v</code></p></pre>creack: <pre><p>From my config: <a href="https://github.com/creack/dotfiles/blob/master/dot.emacs#L88" rel="nofollow">https://github.com/creack/dotfiles/blob/master/dot.emacs#L88</a></p> <pre><code>(global-set-key (kbd &#34;C-c C-t&#34;) &#39;save-and-test-program) (defun save-and-test-program() &#34;Save any unsaved buffers and compile&#34; (interactive) (save-some-buffers t) (compile &#34;go test -v -cover -coverprofile=/tmp/c -covermode=count&#34;)) </code></pre></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

587 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传