Go语言自动化测试

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

go language Automation testing

问题

请有人帮我解决关于Go语言自动化测试的问题。

我一直在手动编写自动化代码。请帮我找到任何可用的包或框架来运行Go语言的自动化测试。

英文:

Please someone help me out on go language automation testing

i have been working out manual coding for automation. Please help me any packages or framework available to run automation testing in go.

答案1

得分: 2

Go提供了自己的测试包,你可以在这里查看它:

https://golang.org/pkg/testing/

你可以编写自己的测试,一个常见的布局是先编写你的文件,然后编写一个_test.go文件来进行测试,例如:

package.go
package_test.go

然后你可以通过运行go test来测试你的文件。

然后,你就可以开始了。

这里是一个随机应用程序的随机测试包的例子:https://github.com/yohcop/openid-go/blob/master/redirect_test.go

英文:

Go provides its own testing package you can view it here

https://golang.org/pkg/testing/

You can write your own tests a common layout is to write your file, then write a _test.go file to test e.g.

package.go
package_test.go

then you can test your file by running

go test

And bam, you're good to go

Here's a random test package from a random app for example: https://github.com/yohcop/openid-go/blob/master/redirect_test.go

答案2

得分: 2

有很多工具!你应该在这里检查一下测试工具的列表:https://github.com/avelino/awesome-go#testing

英文:

A plenty of them! You should check a list of tools for testing here: https://github.com/avelino/awesome-go#testing

答案3

得分: 0

尝试使用http://goconvey.co。

GoConvey还支持Go的原生测试包。

英文:

Try http://goconvey.co

GoConvey also supports Go's native testing package.

答案4

得分: 0

Go提供了自己的测试包,你可以在这里查看:

https://golang.org/pkg/testing/

或者你可以使用其他的测试包,例如testify:

https://github.com/stretchr/testify

英文:

Go provides its own testing package you can view it here

https://golang.org/pkg/testing/

Or you can get other pkg for testing, for example testify

https://github.com/stretchr/testify

huangapple
  • 本文由 发表于 2016年1月4日 17:50:05
  • 转载请务必保留本文链接:https://go.coder-hub.com/34588393.html
匿名

发表评论

匿名网友

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

确定