Check package and its tests build without creating a binary or running the tests

huangapple go评论86阅读模式
英文:

Check package and its tests build without creating a binary or running the tests

问题

使用Go语言,我如何在不运行测试或创建超过检查时间的二进制文件的情况下,检查一个包及其测试是否能够成功构建?

英文:

Using Go, how can I check that a package and its tests will build successfully, without running the tests or creating a binary that outlives the check?

答案1

得分: 0

使用以下命令:

go test -run @

该命令会编译包和测试,并启动测试应用程序,但由于没有函数名称与正则表达式“@”匹配,所以没有运行任何测试。

英文:

Use the command:

go test -run @

This command compiles the package and tests and starts the test application, but no tests run because no function name matches the regular expression "@".

huangapple
  • 本文由 发表于 2015年3月1日 13:12:14
  • 转载请务必保留本文链接:https://go.coder-hub.com/28790347.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定