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 escape_chars_with = {"%": "%"}, 13 failure_templ = """@echo off 14echo %s 15exit /b 1 16""", 17 file_ext = ".bat", 18 join_on = "\necho ", 19 success_templ = "@exit /b 0", 20 visibility = ["//visibility:public"], 21) 22 23toolchain( 24 name = "cmd_toolchain", 25 exec_compatible_with = [ 26 "@platforms//os:windows", 27 ], 28 toolchain = ":cmd", 29 toolchain_type = TOOLCHAIN_TYPE, 30) 31 32unittest_toolchain( 33 name = "bash", 34 escape_other_chars_with = "\\", 35 failure_templ = """#!/bin/sh 36echo %s 37exit 1 38""", 39 file_ext = ".sh", 40 join_on = "\necho ", 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