xref: /aosp_15_r20/external/bazel-skylib/tests/diff_test/BUILD (revision bcb5dc7965af6ee42bf2f21341a2ec00233a8c8a)
1# This package aids testing the 'diff_test' rule.
2
3load("//rules:diff_test.bzl", "diff_test")
4
5package(
6    default_applicable_licenses = ["//:license"],
7    default_testonly = 1,
8)
9
10licenses(["notice"])
11
12sh_test(
13    name = "diff_test_tests",
14    srcs = ["diff_test_tests.sh"],
15    data = [
16        "//rules:diff_test",
17        "//tests:unittest.bash",
18    ],
19    # Test marked local because it uses bazel.
20    tags = ["local"],
21    deps = ["@bazel_tools//tools/bash/runfiles"],
22)
23
24diff_test(
25    name = "same_src_src",
26    file1 = "a.txt",
27    file2 = "aa.txt",
28)
29
30diff_test(
31    name = "same_src_gen",
32    file1 = "a.txt",
33    file2 = "a-gen.txt",
34)
35
36diff_test(
37    name = "same_gen_gen",
38    file1 = "a-gen.txt",
39    file2 = "aa-gen.txt",
40)
41
42genrule(
43    name = "gen",
44    outs = [
45        "a-gen.txt",
46        "aa-gen.txt",
47    ],
48    cmd = "echo -n 'potato' > $(location a-gen.txt) && echo -n 'potato' > $(location aa-gen.txt)",
49)
50