add example for parallelTest

This commit is contained in:
Matthias Kadenbach 2017-02-09 19:52:50 -08:00
parent b6bd4fe02d
commit cfe3d2a83e
1 changed files with 20 additions and 0 deletions

20
testing/testing_test.go Normal file
View File

@ -0,0 +1,20 @@
package testing
import (
"testing"
)
func ExampleParallelTest(t *testing.T) {
var isReady = func(i Instance) bool {
// Return true if Instance is ready to run tests.
// Don't block here though.
return true
}
// t is *testing.T coming from parent Test(t *testing.T)
ParallelTest(t, []string{"docker_image:9.6"}, isReady,
func(t *testing.T, i Instance) {
// Run your test/s ...
t.Fatal("...")
})
}