<p>Hi</p>
<p>I'm looking to create an application that runs a test suite as it's primary function - something like this:</p>
<pre><code>package main
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
)
var t *testing.T
func main() {
t = &testing.T{}
suite.Run(t, new(ExampleTestSuite))
}
type ExampleTestSuite struct {
suite.Suite
VariableThatShouldStartAtFive int
}
func (suite *ExampleTestSuite) TestExample() {
assert.Equal(suite.T(), 5, suite.VariableThatShouldStartAtFive)
}
</code></pre>
<p>That I can later tweak to output junit reports.</p>
<p>The above compiles, and raises no errors - but also doesn't execute the tests.</p>
<p>There are a bunch of exported methods in the testing package, but they all suggest that they're only exported for other internal packages to consume, and that I probably shouldn't be playing there.</p>
<p>Anyone else done something similar, or have any suggestions as to how I might proceed?</p>
<p>Thanks in advance!</p>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
0 回复
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传