fix: copy_to_directory exposes output in runfiles (#10)
This commit is contained in:
parent
0d2981f288
commit
48b0a774ea
|
@ -131,7 +131,10 @@ def _copy_to_directory_impl(ctx):
|
|||
else:
|
||||
_copy_to_dir_bash(ctx, ctx.files.srcs, output)
|
||||
return [
|
||||
DefaultInfo(files = depset([output])),
|
||||
DefaultInfo(
|
||||
files = depset([output]),
|
||||
runfiles = ctx.runfiles([output]),
|
||||
),
|
||||
]
|
||||
|
||||
copy_to_directory_lib = struct(
|
||||
|
|
|
@ -129,3 +129,16 @@ diff_test(
|
|||
file1 = "case_5",
|
||||
file2 = ":expected_5",
|
||||
)
|
||||
|
||||
# Case 6: directory used in a test's runfiles
|
||||
|
||||
copy_to_directory(
|
||||
name = "case_6",
|
||||
srcs = case_srcs,
|
||||
)
|
||||
|
||||
sh_test(
|
||||
name = "case_6_test",
|
||||
srcs = ["case6.sh"],
|
||||
data = ["case_6"],
|
||||
)
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -o errexit -o nounset
|
||||
|
||||
cd $TEST_SRCDIR
|
||||
cd $TEST_WORKSPACE
|
||||
cd $(dirname $TEST_BINARY)
|
||||
cd case_6
|
||||
|
||||
# A path that should be in the directory we have in data[]
|
||||
path="f/f2/f"
|
||||
if [ ! -f "$path" ]; then
|
||||
echo >&2 "Expected $path to exist in runfiles"
|
||||
exit 1
|
||||
fi
|
Loading…
Reference in New Issue