【问题标题】:Explicitly specifying the main package to run tests for in golang with goconvey使用 goconvey 显式指定要在 golang 中运行测试的主包
【发布时间】:2015-07-11 04:16:34
【问题描述】:

如何使用 go test 命令明确说明只对主包运行测试,而不对源目录中的其他包运行测试。

目前它正在使用$go test -v。但是......我也在使用goconvey,它似乎是递归运行的。根据此页面https://github.com/smartystreets/goconvey/wiki/Profiles 我有一个文件,我可以在其中将参数传递给 go test 命令。我知道你可以 go test -v ./... 进行递归或 go test -c packagename/... 但我该怎么做呢?

【问题讨论】:

    标签: testing go goconvey


    【解决方案1】:

    Profiles 是完成此任务的工具之一,但您也可以为跑步者指定“深度”:

    $ goconvey -depth=0
    

    0 的值将运行器限制在工作目录中。

    运行goconvey -help了解详情。

    【讨论】:

      猜你喜欢
      • 2015-09-29
      • 1970-01-01
      • 2015-10-02
      • 2011-12-21
      • 2019-05-28
      • 2017-07-22
      • 1970-01-01
      • 1970-01-01
      • 2017-03-13
      相关资源
      最近更新 更多