2
0
Fork 0
mirror of https://github.com/bazelbuild/bazel-skylib synced 2024-12-03 17:52:40 +00:00
bazel-skylib/toolchains/unittest/BUILD
2019-01-14 16:00:11 -05:00

50 lines
918 B
Python

load("//lib:unittest.bzl", "TOOLCHAIN_TYPE", "unittest_toolchain")
licenses(["notice"])
toolchain_type(
name = "toolchain_type",
visibility = ["//visibility:public"],
)
unittest_toolchain(
name = "cmd",
failure_templ = """@echo off
echo %s
exit /b 1
""",
file_ext = ".bat",
join_on = "\necho ",
success_templ = "@exit /b 0",
visibility = ["//visibility:public"],
)
unittest_toolchain(
name = "bash",
failure_templ = """#!/bin/sh
cat <<'EOF'
%s
EOF
exit 1
""",
file_ext = ".sh",
join_on = "\n",
success_templ = "#!/bin/sh\nexit 0",
visibility = ["//visibility:public"],
)
toolchain(
name = "cmd_toolchain",
exec_compatible_with = [
"@bazel_tools//platforms:windows",
],
toolchain = ":cmd",
toolchain_type = TOOLCHAIN_TYPE,
)
toolchain(
name = "bash_toolchain",
toolchain = ":bash",
toolchain_type = TOOLCHAIN_TYPE,
)