您的位置:首页 > 其它

How to test only one benchmark function?

2014-06-19 16:55 363 查看
http://stackoverflow.com/questions/16161142/how-to-test-only-one-benchmark-function

Description of testing flags
-test.bench pattern
Run benchmarks matching the regular expression.
By default, no benchmarks run.

-test.run pattern
Run only those tests and examples matching the regular
expression.


For convenience, each of these 
-test.X
 flags
of the test binary is also available as the flag 
-X
 in
'
go test
'
itself.

For help,
$ go help testflag


For example,
go test -test.bench MapTravel
go test -test.bench MapGet


or
go test -bench MapTravel
go test -bench MapGet


To bypass test functions, use an improbable 
-test.run
 pattern.
For example,
go test -test.bench MapTravel -test.run XXX


or
go test -bench MapTravel -run XXX
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐