技术控

    今日:94| 主题:49113
收藏本版 (1)
最新软件应用技术尽在掌握

[其他] patter: `go test -v` as TAP output

[复制链接]
我的闺蜜会发光 发表于 2016-9-30 16:02:43
119 1

立即注册CoLaBug.com会员,免费获得投稿人的专业资料,享用更多功能,玩转个人品牌!

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
patter

  Output's    go test -vas TAP.  
  Usage

  1. usage: patter
复制代码
Patter has no arguments. It reads from STDIN, the output of    go test -v, and outputs    TAP v13compatible output.  
  Example

  Suppose the current directory has a test file,    foo_test.go. Running    go test -v ./...might produce the following output:  
  1. $ go test -v ./...
  2. === RUN   TestSkip
  3. --- SKIP: TestSkip (0.00s)
  4.     foo_test.go:6: this test is being skipped
  5. === RUN   TestError
  6. --- FAIL: TestError (0.00s)
  7.     foo_test.go:10: this test is erroring
  8. === RUN   Test2Errors
  9. --- FAIL: Test2Errors (0.00s)
  10.     foo_test.go:14: this test is error 1
  11.     foo_test.go:15: this test is error 2
  12. === RUN   TestFatal
  13. --- FAIL: TestFatal (0.00s)
  14.     foo_test.go:19: this test is fataling
  15. === RUN   TestOK
  16. --- PASS: TestOK (0.00s)
  17. FAIL
  18. exit status 1
  19. FAIL    github.com/apg/patter   0.007s
复制代码
If we, instead, pipe the output of    go test -v ./...into    patter, we get the following output:  
  1. $ go test -v ./... | patter
  2. TAP version 13
  3. ok 1 # skip TestSkip (0.00s)
  4. # foo_test.go:6: this test is being skipped
  5. not ok 2 - TestError (0.00s)
  6. # foo_test.go:10: this test is erroring
  7. not ok 3 - Test2Error (0.00s)
  8. # foo_test.go:14: this test is error 1
  9. # foo_test.go:15: this test is error 2
  10. not ok 4 - TestFatal (0.00s)
  11. # foo_test.go:19: this test is fataling
  12. ok 5 - TestOK (0.00s)
  13. 1..5
复制代码
Because    patterdoesn't know how many tests will be run, it outputs the plan line (e.g. 1..5) at the end. This is allowed via the spec.  
  Bailing out!

  It's possible that    patterwill encounter I/O errors while reading from STDIN. If this happens, patter    bails outusing the special words    Bail out!followed by an error message. This is the expected emergency behaviour of TAP.  
  Contributing

  Contributions are welcome, and encouraged! Please open an issue before a Pull Request to avoid duplicated effort, and/or functionality that will not be merged.
  Copyright

  (c) 2016, Andrew Gwozdziewycz    [email protected]  
  See LICENSE file for more information.
友荐云推荐




上一篇:nginx配置中的location和rewrite规则介绍
下一篇:iOS开发-选择城市
酷辣虫提示酷辣虫禁止发表任何与中华人民共和国法律有抵触的内容!所有内容由用户发布,并不代表酷辣虫的观点,酷辣虫无法对用户发布内容真实性提供任何的保证,请自行验证并承担风险与后果。如您有版权、违规等问题,请通过"联系我们"或"违规举报"告知我们处理。

贾一兰 发表于 2016-9-30 23:55:44
恋爱就是无数个饭局,结婚就是一个饭局。  
回复 支持 反对

使用道具 举报

*滑动验证:
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

我要投稿

推荐阅读

扫码访问 @iTTTTT瑞翔 的微博
回页顶回复上一篇下一篇回列表手机版
手机版/CoLaBug.com ( 粤ICP备05003221号 | 文网文[2010]257号 )|网站地图 酷辣虫

© 2001-2016 Comsenz Inc. Design: Dean. DiscuzFans.

返回顶部 返回列表