mirror of
https://github.com/bazel-contrib/bazel-lib
synced 2024-11-28 21:33:48 +00:00
e00ea2b977
It needs to match the one CI runs in https://github.com/aspect-build/bazel-lib/actions/runs/6357283303/job/17268197322
52 lines
907 B
Python
52 lines
907 B
Python
"Tests for copy_directory"
|
|
|
|
load("//lib:copy_directory.bzl", "copy_directory")
|
|
load("//lib:copy_to_directory.bzl", "copy_to_directory")
|
|
load("//lib:diff_test.bzl", "diff_test")
|
|
|
|
genrule(
|
|
name = "a_file",
|
|
outs = ["a"],
|
|
cmd = "echo 'foo' > $@",
|
|
)
|
|
|
|
genrule(
|
|
name = "b_file",
|
|
outs = ["a2"],
|
|
cmd = "echo 'bar' > $@",
|
|
)
|
|
|
|
copy_to_directory(
|
|
name = "dir",
|
|
srcs = [
|
|
":a_file",
|
|
":b_file",
|
|
],
|
|
)
|
|
|
|
copy_directory(
|
|
name = "dir_copy",
|
|
src = "dir",
|
|
out = "copy_of_dir",
|
|
verbose = True,
|
|
)
|
|
|
|
diff_test(
|
|
name = "copy_directory_test",
|
|
file1 = ":dir",
|
|
file2 = ":dir_copy",
|
|
)
|
|
|
|
copy_directory(
|
|
name = "external_dir_copy",
|
|
src = "@external_test_repo//:test_a",
|
|
out = "external_dir",
|
|
verbose = True,
|
|
)
|
|
|
|
diff_test(
|
|
name = "copy_external_directory_test",
|
|
file1 = ":external_dir_copy",
|
|
file2 = "@external_test_repo//:test_a",
|
|
)
|