dpql57753 2015-07-09 17:29
浏览 31
已采纳

以编程方式进行通话测试

I want to run specific go tests that send http requests to a server with details on how the tests ran.

Is there a way to programmatically call go test [flags] within a go program?

Super simplified example:

func main() {
    results := runTests(identifier - packagename or testname)
    //send post request with results
}

perhaps I need to look into this http://golang.org/pkg/testing/#RunTests

  • 写回答

1条回答 默认 最新

  • dongzouqie4220 2015-07-16 13:02
    关注

    For now I decided to use exec to parse the output of the command to determine if the test passed or failed.

    I am guessing one can look through the source code of some go testing framework like GoConvey and maybe programmatically call a test and post the results. I will try this sometime in the future when I have more time HA.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 python怎么在已有视频文件后添加新帧
  • ¥20 虚幻UE引擎如何让多个同一个蓝图的NPC执行一样的动画,
  • ¥15 fluent里模拟降膜反应的UDF编写
  • ¥15 MYSQL 多表拼接link
  • ¥15 关于某款2.13寸墨水屏的问题
  • ¥15 obsidian的中文层级自动编号
  • ¥15 同一个网口一个电脑连接有网,另一个电脑连接没网
  • ¥15 神经网络模型一直不能上GPU
  • ¥15 pyqt怎么把滑块和输入框相互绑定,求解决!
  • ¥20 wpf datagrid单元闪烁效果失灵