generated: hack/update-vendor.sh

This commit is contained in:
Jordan Liggitt
2019-04-01 11:07:04 -04:00
parent 2ea3cbdcbc
commit d0261b1077
528 changed files with 24751 additions and 126492 deletions

View File

@@ -1,30 +0,0 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = [
"config.go",
"files.go",
],
importmap = "k8s.io/kubernetes/vendor/github.com/bazelbuild/bazel-gazelle/internal/testtools",
importpath = "github.com/bazelbuild/bazel-gazelle/internal/testtools",
visibility = ["//vendor/github.com/bazelbuild/bazel-gazelle:__subpackages__"],
deps = [
"//vendor/github.com/bazelbuild/bazel-gazelle/internal/config:go_default_library",
"//vendor/github.com/bazelbuild/bazel-gazelle/internal/language:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)

View File

@@ -1,53 +0,0 @@
/* Copyright 2018 The Bazel Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package testtools
import (
"flag"
"testing"
"github.com/bazelbuild/bazel-gazelle/internal/config"
"github.com/bazelbuild/bazel-gazelle/internal/language"
)
// NewTestConfig returns a Config used for tests in any language extension.
// cexts is a list of configuration extensions to use. langs is a list of
// language extensions to use (languages are also configuration extensions,
// but it may be convenient to keep them separate). args is a list of
// command line arguments to apply. NewTestConfig calls t.Fatal if any
// error is encountered while processing flags.
func NewTestConfig(t *testing.T, cexts []config.Configurer, langs []language.Language, args []string) *config.Config {
c := config.New()
fs := flag.NewFlagSet("test", flag.ContinueOnError)
for _, lang := range langs {
cexts = append(cexts, lang)
}
for _, cext := range cexts {
cext.RegisterFlags(fs, "update", c)
}
if err := fs.Parse(args); err != nil {
t.Fatal(err)
}
for _, cext := range cexts {
if err := cext.CheckFlags(fs, c); err != nil {
t.Fatal(err)
}
}
return c
}

View File

@@ -1,109 +0,0 @@
/* Copyright 2018 The Bazel Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package testtools
import (
"io/ioutil"
"os"
"path/filepath"
"strings"
"testing"
)
// FileSpec specifies the content of a test file.
type FileSpec struct {
// Path is a slash-separated path relative to the test directory. If Path
// ends with a slash, it indicates a directory should be created
// instead of a file.
Path string
// Symlink is a slash-separated path relative to the test directory. If set,
// it indicates a symbolic link should be created with this path instead of a
// file.
Symlink string
// Content is the content of the test file.
Content string
}
// CreateFiles creates a directory of test files. This is a more compact
// alternative to testdata directories. CreateFiles returns a canonical path
// to the directory and a function to call to clean up the directory
// after the test.
func CreateFiles(t *testing.T, files []FileSpec) (dir string, cleanup func()) {
dir, err := ioutil.TempDir(os.Getenv("TEST_TEMPDIR"), "gazelle_test")
if err != nil {
t.Fatal(err)
}
dir, err = filepath.EvalSymlinks(dir)
if err != nil {
t.Fatal(err)
}
for _, f := range files {
path := filepath.Join(dir, filepath.FromSlash(f.Path))
if strings.HasSuffix(f.Path, "/") {
if err := os.MkdirAll(path, 0700); err != nil {
os.RemoveAll(dir)
t.Fatal(err)
}
continue
}
if err := os.MkdirAll(filepath.Dir(path), 0700); err != nil {
os.RemoveAll(dir)
t.Fatal(err)
}
if f.Symlink != "" {
if err := os.Symlink(f.Symlink, path); err != nil {
t.Fatal(err)
}
continue
}
if err := ioutil.WriteFile(path, []byte(f.Content), 0600); err != nil {
os.RemoveAll(dir)
t.Fatal(err)
}
}
return dir, func() { os.RemoveAll(dir) }
}
// CheckFiles checks that files in "dir" exist and have the content specified
// in "files". Files not listed in "files" are not tested, so extra files
// are allowed.
func CheckFiles(t *testing.T, dir string, files []FileSpec) {
for _, f := range files {
path := filepath.Join(dir, f.Path)
if strings.HasSuffix(f.Path, "/") {
if st, err := os.Stat(path); err != nil {
t.Errorf("could not stat %s: %v", f.Path, err)
} else if !st.IsDir() {
t.Errorf("not a directory: %s", f.Path)
}
} else {
want := strings.TrimSpace(f.Content)
gotBytes, err := ioutil.ReadFile(filepath.Join(dir, f.Path))
if err != nil {
t.Errorf("could not read %s: %v", f.Path, err)
continue
}
got := strings.TrimSpace(string(gotBytes))
if got != want {
t.Errorf("%s: got:\n%s\nwant:\n %s", f.Path, gotBytes, f.Content)
}
}
}
}

0
vendor/github.com/bazelbuild/buildtools/api_proto/api.gen.pb.go generated vendored Executable file → Normal file
View File

0
vendor/github.com/bazelbuild/buildtools/build/parse.y.go generated vendored Executable file → Normal file
View File

0
vendor/github.com/bazelbuild/buildtools/build_proto/build.gen.pb.go generated vendored Executable file → Normal file
View File

0
vendor/github.com/bazelbuild/buildtools/lang/tables.gen.go generated vendored Executable file → Normal file
View File