2022-09-20 15:05:18 +00:00
|
|
|
load("@bazel_skylib//rules:run_binary.bzl", "run_binary")
|
|
|
|
load("@bazel_skylib//rules:build_test.bzl", "build_test")
|
2022-09-22 12:59:02 +00:00
|
|
|
load("@aspect_bazel_lib//lib:wrap_binary.bzl", "chdir_binary", "tty_binary")
|
2022-09-20 15:05:18 +00:00
|
|
|
|
|
|
|
sh_binary(
|
2022-09-22 12:59:02 +00:00
|
|
|
name = "needs_chdir",
|
2022-09-20 15:05:18 +00:00
|
|
|
srcs = ["needs-working-dir.sh"],
|
|
|
|
)
|
|
|
|
|
|
|
|
chdir_binary(
|
2022-09-22 12:59:02 +00:00
|
|
|
name = "has_chdir",
|
2022-09-20 15:05:18 +00:00
|
|
|
binary = "fixture",
|
|
|
|
chdir = package_name(),
|
|
|
|
)
|
|
|
|
|
2022-09-22 12:59:02 +00:00
|
|
|
sh_binary(
|
|
|
|
name = "needs_tty",
|
|
|
|
srcs = ["needs-tty.sh"],
|
|
|
|
)
|
|
|
|
|
|
|
|
tty_binary(
|
|
|
|
name = "has_tty",
|
|
|
|
binary = "needs_tty",
|
|
|
|
runfiles_manifest_key = "aspect_bazel_lib/lib/tests/wrap_binary/needs-tty.sh",
|
|
|
|
)
|
|
|
|
|
|
|
|
###
|
|
|
|
# TESTS
|
|
|
|
###
|
2022-09-20 15:05:18 +00:00
|
|
|
run_binary(
|
2022-09-22 12:59:02 +00:00
|
|
|
name = "assert2",
|
2022-09-20 15:05:18 +00:00
|
|
|
outs = ["thing"],
|
2022-09-22 12:59:02 +00:00
|
|
|
tool = "has_chdir",
|
2022-09-20 15:05:18 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
build_test(
|
|
|
|
name = "test",
|
2022-09-22 12:59:02 +00:00
|
|
|
# FIXME: the rootpath doesn't work
|
|
|
|
tags = ["manual"],
|
|
|
|
targets = ["assert2"],
|
2022-09-20 15:05:18 +00:00
|
|
|
)
|