2022-04-04 00:52:03 +00:00
|
|
|
"Tests for copy_directory"
|
|
|
|
|
|
|
|
load("//lib:copy_directory.bzl", "copy_directory")
|
|
|
|
load("//lib:copy_to_directory.bzl", "copy_to_directory")
|
2023-09-29 21:42:33 +00:00
|
|
|
load("//lib:diff_test.bzl", "diff_test")
|
2022-04-04 00:52:03 +00:00
|
|
|
|
|
|
|
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",
|
2023-01-17 01:19:13 +00:00
|
|
|
verbose = True,
|
2022-04-04 00:52:03 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
diff_test(
|
|
|
|
name = "copy_directory_test",
|
|
|
|
file1 = ":dir",
|
|
|
|
file2 = ":dir_copy",
|
|
|
|
)
|
2023-01-17 01:19:13 +00:00
|
|
|
|
|
|
|
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",
|
|
|
|
)
|