xref: /aosp_15_r20/external/bazel-skylib/tests/copy_directory/BUILD.bazel (revision bcb5dc7965af6ee42bf2f21341a2ec00233a8c8a)
1*bcb5dc79SHONG Yifan# This package aids testing the 'copy_directory' rule.
2*bcb5dc79SHONG Yifan
3*bcb5dc79SHONG Yifanload("//rules:copy_directory.bzl", "copy_directory")
4*bcb5dc79SHONG Yifanload(":empty_directory.bzl", "empty_directory")
5*bcb5dc79SHONG Yifan
6*bcb5dc79SHONG Yifanpackage(
7*bcb5dc79SHONG Yifan    default_applicable_licenses = ["//:license"],
8*bcb5dc79SHONG Yifan    default_testonly = 1,
9*bcb5dc79SHONG Yifan)
10*bcb5dc79SHONG Yifan
11*bcb5dc79SHONG Yifanlicenses(["notice"])
12*bcb5dc79SHONG Yifan
13*bcb5dc79SHONG Yifan# Copy of directory containing files a and b, and a subdir containing c
14*bcb5dc79SHONG Yifancopy_directory(
15*bcb5dc79SHONG Yifan    name = "copy_of_dir_with_subdir",
16*bcb5dc79SHONG Yifan    src = "dir_with_subdir",
17*bcb5dc79SHONG Yifan    out = "dir_copy",
18*bcb5dc79SHONG Yifan)
19*bcb5dc79SHONG Yifan
20*bcb5dc79SHONG Yifanempty_directory(
21*bcb5dc79SHONG Yifan    name = "empty_dir",
22*bcb5dc79SHONG Yifan)
23*bcb5dc79SHONG Yifan
24*bcb5dc79SHONG Yifancopy_directory(
25*bcb5dc79SHONG Yifan    name = "copy_of_empty_dir",
26*bcb5dc79SHONG Yifan    src = "empty_dir",
27*bcb5dc79SHONG Yifan    out = "empty_dir_copy",
28*bcb5dc79SHONG Yifan)
29*bcb5dc79SHONG Yifan
30*bcb5dc79SHONG Yifancopy_directory(
31*bcb5dc79SHONG Yifan    name = "copy_of_dir_with_symlink",
32*bcb5dc79SHONG Yifan    src = "dir_with_symlink",
33*bcb5dc79SHONG Yifan    out = "dir_with_symlink_copy",
34*bcb5dc79SHONG Yifan)
35*bcb5dc79SHONG Yifan
36*bcb5dc79SHONG Yifansh_test(
37*bcb5dc79SHONG Yifan    name = "copy_directory_tests",
38*bcb5dc79SHONG Yifan    srcs = ["copy_directory_tests.sh"],
39*bcb5dc79SHONG Yifan    data = [
40*bcb5dc79SHONG Yifan        ":copy_of_dir_with_subdir",
41*bcb5dc79SHONG Yifan        ":copy_of_dir_with_symlink",
42*bcb5dc79SHONG Yifan        ":copy_of_empty_dir",
43*bcb5dc79SHONG Yifan        "//tests:unittest.bash",
44*bcb5dc79SHONG Yifan    ],
45*bcb5dc79SHONG Yifan    deps = ["@bazel_tools//tools/bash/runfiles"],
46*bcb5dc79SHONG Yifan)
47