blob: 5d043287065c77802e4edf58b2b32c1bd2f6a352 [file] [log] [blame]
load("@io_bazel_rules_go//go:def.bzl", "go_test")
go_test(
name = "stamp_with_linkstamp",
size = "small",
srcs = ["stamped_bin_test.go"],
linkstamp = "github.com/bazelbuild/rules_go/examples/stamped_bin/stamp",
x_defs = {
"github.com/bazelbuild/rules_go/examples/stamped_bin/stamp.PassIfEmpty": "",
"github.com/bazelbuild/rules_go/examples/stamped_bin/stamp.XdefBuildTimestamp": "pass",
"github.com/bazelbuild/rules_go/examples/stamped_bin/stamp.XdefInvalid": "{Undefined_Var}", # undefined should leave the var alone
},
deps = ["//examples/stamped_bin/stamp:go_default_library"],
)
go_test(
name = "stamp_with_x_defs",
size = "small",
srcs = ["stamped_bin_test.go"],
x_defs = {
"github.com/bazelbuild/rules_go/examples/stamped_bin/stamp.BUILD_TIMESTAMP": "{BUILD_TIMESTAMP}",
"github.com/bazelbuild/rules_go/examples/stamped_bin/stamp.XdefBuildTimestamp": "{BUILD_TIMESTAMP}",
"github.com/bazelbuild/rules_go/examples/stamped_bin/stamp.PassIfEmpty": "",
"github.com/bazelbuild/rules_go/examples/stamped_bin/stamp.XdefInvalid": "{Undefined_Var}", # undefined should leave the var alone
},
deps = ["//examples/stamped_bin/stamp:go_default_library"],
)
go_test(
name = "stamp_with_linkstamp_and_x_defs",
size = "small",
srcs = ["stamped_bin_test.go"],
linkstamp = "github.com/bazelbuild/rules_go/examples/stamped_bin/stamp",
x_defs = {
"github.com/bazelbuild/rules_go/examples/stamped_bin/stamp.XdefBuildTimestamp": "{BUILD_TIMESTAMP}",
"github.com/bazelbuild/rules_go/examples/stamped_bin/stamp.PassIfEmpty": "",
"github.com/bazelbuild/rules_go/examples/stamped_bin/stamp.XdefInvalid": "{Undefined_Var}", # undefined should leave the var alone
},
deps = ["//examples/stamped_bin/stamp:go_default_library"],
)