blob: aa381d85382463ac4707429d74f9d0a6e8cd6033 [file] [log] [blame]
László Csomorbe3b1fc2019-04-12 19:35:29 +02001# This package aids testing the 'diff_test' rule.
2
3load("//rules:diff_test.bzl", "diff_test")
4
Thomas Van Lenten31b8ea52019-05-01 11:33:25 -04005licenses(["notice"])
6
László Csomorbe3b1fc2019-04-12 19:35:29 +02007package(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 ],
c-parsons84a12d12019-05-07 16:25:43 -040016 # Test marked local because it uses bazel.
17 tags = ["local"],
László Csomorbe3b1fc2019-04-12 19:35:29 +020018 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)