xref: /aosp_15_r20/external/bazel-skylib/tests/select_file/BUILD (revision bcb5dc7965af6ee42bf2f21341a2ec00233a8c8a)
1*bcb5dc79SHONG Yifanload("//rules:diff_test.bzl", "diff_test")
2*bcb5dc79SHONG Yifanload("//rules:select_file.bzl", "select_file")
3*bcb5dc79SHONG Yifan
4*bcb5dc79SHONG Yifanpackage(
5*bcb5dc79SHONG Yifan    default_applicable_licenses = ["//:license"],
6*bcb5dc79SHONG Yifan    default_testonly = 1,
7*bcb5dc79SHONG Yifan)
8*bcb5dc79SHONG Yifan
9*bcb5dc79SHONG Yifanlicenses(["notice"])
10*bcb5dc79SHONG Yifan
11*bcb5dc79SHONG Yifanfilegroup(
12*bcb5dc79SHONG Yifan    name = "fg",
13*bcb5dc79SHONG Yifan    srcs = [
14*bcb5dc79SHONG Yifan        "subdir/inner.txt",
15*bcb5dc79SHONG Yifan        ":select_me.txt",
16*bcb5dc79SHONG Yifan    ],
17*bcb5dc79SHONG Yifan)
18*bcb5dc79SHONG Yifan
19*bcb5dc79SHONG Yifanselect_file(
20*bcb5dc79SHONG Yifan    name = "select_me",
21*bcb5dc79SHONG Yifan    srcs = ":fg",
22*bcb5dc79SHONG Yifan    subpath = "select_me.txt",
23*bcb5dc79SHONG Yifan)
24*bcb5dc79SHONG Yifan
25*bcb5dc79SHONG Yifanselect_file(
26*bcb5dc79SHONG Yifan    name = "select_inner",
27*bcb5dc79SHONG Yifan    srcs = ":fg",
28*bcb5dc79SHONG Yifan    subpath = "subdir/inner.txt",
29*bcb5dc79SHONG Yifan)
30*bcb5dc79SHONG Yifan
31*bcb5dc79SHONG Yifandiff_test(
32*bcb5dc79SHONG Yifan    name = "selected_me",
33*bcb5dc79SHONG Yifan    file1 = ":select_me",
34*bcb5dc79SHONG Yifan    file2 = ":select_me.txt",
35*bcb5dc79SHONG Yifan)
36*bcb5dc79SHONG Yifan
37*bcb5dc79SHONG Yifandiff_test(
38*bcb5dc79SHONG Yifan    name = "selected_inner",
39*bcb5dc79SHONG Yifan    file1 = ":select_inner",
40*bcb5dc79SHONG Yifan    file2 = "subdir/inner.txt",
41*bcb5dc79SHONG Yifan)
42