1load("//lib:unittest.bzl", "TOOLCHAIN_TYPE", "unittest_toolchain") 2 3licenses(["notice"]) 4 5toolchain_type( 6 name = "toolchain_type", 7 visibility = ["//visibility:public"], 8) 9 10unittest_toolchain( 11 name = "cmd", 12 failure_templ = """@echo off 13echo %s 14exit /b 1 15""", 16 file_ext = ".bat", 17 join_on = "\necho ", 18 success_templ = "@exit /b 0", 19 visibility = ["//visibility:public"], 20) 21 22toolchain( 23 name = "cmd_toolchain", 24 exec_compatible_with = [ 25 "@platforms//os:windows", 26 ], 27 toolchain = ":cmd", 28 toolchain_type = TOOLCHAIN_TYPE, 29) 30 31unittest_toolchain( 32 name = "bash", 33 failure_templ = """#!/bin/sh 34cat <<'EOF' 35%s 36EOF 37exit 1 38""", 39 file_ext = ".sh", 40 join_on = "\n", 41 success_templ = "#!/bin/sh\nexit 0", 42 visibility = ["//visibility:public"], 43) 44 45toolchain( 46 name = "bash_toolchain", 47 toolchain = ":bash", 48 toolchain_type = TOOLCHAIN_TYPE, 49) 50 51filegroup( 52 name = "test_deps", 53 testonly = True, 54 srcs = [ 55 "BUILD", 56 ], 57 visibility = ["//:__subpackages__"], 58) 59 60# The files needed for distribution 61filegroup( 62 name = "distribution", 63 srcs = ["BUILD"], 64 visibility = [ 65 "//:__pkg__", 66 ], 67) 68