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