2019-04-12 17:35:29 +00:00
|
|
|
# This package aids testing the 'diff_test' rule.
|
|
|
|
|
|
|
|
load("//rules:diff_test.bzl", "diff_test")
|
|
|
|
|
2019-05-01 15:33:25 +00:00
|
|
|
licenses(["notice"])
|
|
|
|
|
2019-04-12 17:35:29 +00:00
|
|
|
package(default_testonly = 1)
|
|
|
|
|
|
|
|
sh_test(
|
|
|
|
name = "diff_test_tests",
|
|
|
|
srcs = ["diff_test_tests.sh"],
|
|
|
|
data = [
|
|
|
|
"//rules:diff_test",
|
|
|
|
"//tests:unittest.bash",
|
|
|
|
],
|
2019-05-07 20:25:43 +00:00
|
|
|
# Test marked local because it uses bazel.
|
|
|
|
tags = ["local"],
|
2019-04-12 17:35:29 +00:00
|
|
|
deps = ["@bazel_tools//tools/bash/runfiles"],
|
|
|
|
)
|
|
|
|
|
|
|
|
diff_test(
|
|
|
|
name = "same_src_src",
|
|
|
|
file1 = "a.txt",
|
|
|
|
file2 = "aa.txt",
|
|
|
|
)
|
|
|
|
|
|
|
|
diff_test(
|
|
|
|
name = "same_src_gen",
|
|
|
|
file1 = "a.txt",
|
|
|
|
file2 = "a-gen.txt",
|
|
|
|
)
|
|
|
|
|
|
|
|
diff_test(
|
|
|
|
name = "same_gen_gen",
|
|
|
|
file1 = "a-gen.txt",
|
|
|
|
file2 = "aa-gen.txt",
|
|
|
|
)
|
|
|
|
|
|
|
|
genrule(
|
|
|
|
name = "gen",
|
|
|
|
outs = [
|
|
|
|
"a-gen.txt",
|
|
|
|
"aa-gen.txt",
|
|
|
|
],
|
|
|
|
cmd = "echo -n 'potato' > $(location a-gen.txt) && echo -n 'potato' > $(location aa-gen.txt)",
|
|
|
|
)
|