blob: 62c5679deb8788464dca4ebebb54e0ffbfbdc22d [file] [log] [blame]
package unittest
import (
"runtime"
"go.skia.org/infra/bazel/go/bazel"
"go.skia.org/infra/go/sktest"
)
// BazelOnlyTest is a function which should be called at the beginning of tests
// which should only run under Bazel (e.g. via "bazel test ...").
func BazelOnlyTest(t sktest.TestingT) {
if !bazel.InBazelTest() {
t.Skip("Not running Bazel tests from outside Bazel.")
}
}
// LinuxOnlyTest is a function which should be called at the beginning of a test
// which should only run on Linux.
func LinuxOnlyTest(t sktest.TestingT) {
if runtime.GOOS != "linux" {
t.Skip("Not running Linux-only tests.")
}
}