blob: a0ea9db20f85832c848a6a4e967f36e3590d92cd [file] [log] [blame]
load("@io_bazel_rules_go//go:def.bzl", "go_path", "go_test")
test_suite(name = "go_path")
[go_path(
name = mode + "_path",
testonly = True,
data = ["extra.txt"],
include_pkg = True,
mode = mode,
deps = [
"//tests/core/go_path/cmd/bin",
"//tests/core/go_path/cmd/bin:cross",
"//tests/core/go_path/pkg/lib:embed_test",
"//tests/core/go_path/pkg/lib:go_default_library",
"//tests/core/go_path/pkg/lib:go_default_test",
"//tests/core/go_path/pkg/lib:vendored",
],
) for mode in ("archive", "copy", "link")]
go_path(
name = "nodata_path",
testonly = True,
data = ["extra.txt"],
include_data = False,
mode = "copy",
deps = ["//tests/core/go_path/pkg/lib:go_default_library"],
)
go_path(
name = "notransitive_path",
testonly = True,
include_transitive = False,
mode = "copy",
deps = ["//tests/core/go_path/pkg/lib:go_default_library"],
)
go_test(
name = "go_path_test",
srcs = ["go_path_test.go"],
args = [
"-archive_path=$(location :archive_path)",
"-copy_path=$(location :copy_path)",
"-link_path=tests/core/go_path/link_path", # can't use location; not a single file
"-nodata_path=$(location :nodata_path)",
"-notransitive_path=$(location :notransitive_path)",
],
data = [
":archive_path",
":copy_path",
":link_path",
":nodata_path",
":notransitive_path",
],
rundir = ".",
deps = ["//go/tools/bazel:go_default_library"],
)