lxd: github.com/lxc/lxd/shared/subtest Index | Files

package subtest

import "github.com/lxc/lxd/shared/subtest"

Package subtest provides a backwards-compatible way to run subtests.

For Go 1.7 and higher, it uses testing.T's run method. For lower versions it mimics subtests by logging additional information.

package foo

import "github.com/mpvl/subtest"

var testCases = ...

func TestFoo(t *testing.T) {
    for _, tc := range testCases {
        subtest.Run(t, tc.name, func(t *testing.T) {
            tc.doTest()
        })
    }
}

Index

Package Files

doc.go go1_7.go

func Run Uses

func Run(t *testing.T, name string, f func(t *testing.T))

Run runs function f as a subtest of t.

Package subtest imports 1 packages (graph). Updated 2017-09-08. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).