requirement
provides support for requirement to be able to skip some tests depending on the environment.
It is intended to work at lesat with the built-in testing
framework. But any testing framework that
defines a Skip(args ...interface{})
method can be used.
To write a test with a requirement, you need import this library and call it like the following
func TestWithRequirement(t *testing.T) {
requirement.Is(t, func() bool {
return false
})
}
This will print requirement.go:51: requirement_test.go:56: unmatched requirement TestWithRequirement.func1
A few requirement are also provided by this library. They are all based on the built-in libraries.
runtime
withArchitectureIs
,OperatingSystemIs
andGoVersionIs
.