コード例 #1
0
ファイル: main_test.go プロジェクト: GitGoldie/cockroach
func TestForbiddenDeps(t *testing.T) {
	defer leaktest.AfterTest(t)()
	// Verify kv does not depend on storage (or any of its subpackages).
	buildutil.VerifyNoImports(t,
		"github.com/cockroachdb/cockroach/kv", true,
		[]string{},
		[]string{
			"github.com/cockroachdb/cockroach/storage",
		})
}
コード例 #2
0
ファイル: main_test.go プロジェクト: CubeLite/cockroach
func TestForbiddenDeps(t *testing.T) {
	defer leaktest.AfterTest(t)()
	// Verify kv does not depend on storage (or any of its subpackages).
	buildutil.VerifyNoImports(t,
		"github.com/cockroachdb/cockroach/kv", true,
		// TODO(tschottdorf): should really disallow ./storage/... but at the
		// time of writing there's a (legit) dependency on `enginepb`.
		[]string{
			"github.com/cockroachdb/cockroach/storage",
			"github.com/cockroachdb/cockroach/storage/engine",
		},
		[]string{})
}
コード例 #3
0
ファイル: flags_test.go プロジェクト: GitGoldie/cockroach
func TestNoLinkForbidden(t *testing.T) {
	defer leaktest.AfterTest(t)()
	// Verify that the cockroach binary doesn't depend on certain packages.
	buildutil.VerifyNoImports(t,
		"github.com/cockroachdb/cockroach", true,
		[]string{
			"testing",  // defines flags
			"go/build", // probably not something we want in the main binary
			"github.com/cockroachdb/cockroach/security/securitytest", // contains certificates
		},
		[]string{
			"github.com/cockroachdb/cockroach/testutils", // meant for testing code only
		})
}