mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-14 23:17:29 +00:00
tstest/deptest: add test-only package to unify negative dep tests
Updates #8658 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
32d486e2bf
commit
7560435eb5
@@ -3,10 +3,34 @@
|
||||
|
||||
package main // import "tailscale.com/cmd/tailscaled"
|
||||
|
||||
import "testing"
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"tailscale.com/tstest/deptest"
|
||||
)
|
||||
|
||||
func TestNothing(t *testing.T) {
|
||||
// This test does nothing on purpose, so we can run
|
||||
// GODEBUG=memprofilerate=1 go test -v -run=Nothing -memprofile=prof.mem
|
||||
// without any errors about no matching tests.
|
||||
}
|
||||
|
||||
func TestDeps(t *testing.T) {
|
||||
deptest.DepChecker{
|
||||
GOOS: "darwin",
|
||||
GOARCH: "arm64",
|
||||
BadDeps: map[string]string{
|
||||
"gvisor.dev/gvisor/pkg/hostarch": "will crash on non-4K page sizes",
|
||||
},
|
||||
}.Check(t)
|
||||
|
||||
deptest.DepChecker{
|
||||
GOOS: "linux",
|
||||
GOARCH: "arm64",
|
||||
BadDeps: map[string]string{
|
||||
// TODO: per https://github.com/tailscale/tailscale/issues/8658,
|
||||
// add this line too:
|
||||
// "gvisor.dev/gvisor/pkg/hostarch": "will crash on non-4K page sizes",
|
||||
},
|
||||
}.Check(t)
|
||||
}
|
||||
|
Reference in New Issue
Block a user