|
|
@ -13,6 +13,7 @@ import (
|
|
|
|
func Run(t *testing.T, tree *Tree) {
|
|
|
|
func Run(t *testing.T, tree *Tree) {
|
|
|
|
t.Run(tree.name, func(t *testing.T) {
|
|
|
|
t.Run(tree.name, func(t *testing.T) {
|
|
|
|
exec(t, tree)
|
|
|
|
exec(t, tree)
|
|
|
|
|
|
|
|
after(t, tree)
|
|
|
|
|
|
|
|
|
|
|
|
if t.Failed() || t.Skipped() {
|
|
|
|
if t.Failed() || t.Skipped() {
|
|
|
|
for _, child := range tree.children {
|
|
|
|
for _, child := range tree.children {
|
|
|
@ -47,6 +48,15 @@ func exec(t *testing.T, tree *Tree) *env {
|
|
|
|
return e.save(test)
|
|
|
|
return e.save(test)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func after(t *testing.T, tree *Tree) {
|
|
|
|
|
|
|
|
if a, ok := tree.test.(After); ok {
|
|
|
|
|
|
|
|
a.After(t)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if tree.parent != nil {
|
|
|
|
|
|
|
|
after(t, tree.parent)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// skip skips the provided tree node as well as all of its children.
|
|
|
|
// skip skips the provided tree node as well as all of its children.
|
|
|
|
func skip(t *testing.T, tree *Tree) {
|
|
|
|
func skip(t *testing.T, tree *Tree) {
|
|
|
|
t.Run(tree.name, func(t *testing.T) {
|
|
|
|
t.Run(tree.name, func(t *testing.T) {
|
|
|
|