mirror of
https://github.com/bazel-contrib/bazel-lib
synced 2024-11-30 01:41:21 +00:00
896ee0c1f0
I recently enabled --test_verbose_timeout_warnings and that caused a bunch of warnings in our build. This fixes it, and adds a utility for us or others to make test-wrapping macros that set to short by default.
70 lines
1.2 KiB
Python
70 lines
1.2 KiB
Python
"tests for copy_to_bin"
|
|
|
|
load("//lib:copy_to_bin.bzl", "copy_to_bin")
|
|
load("//lib:output_files.bzl", "output_files")
|
|
|
|
copy_to_bin(
|
|
name = "copy",
|
|
srcs = [
|
|
"file1",
|
|
"file2",
|
|
],
|
|
)
|
|
|
|
output_files(
|
|
name = "pull_out_file1",
|
|
paths = ["%s/file1" % package_name()],
|
|
target = ":copy",
|
|
)
|
|
|
|
output_files(
|
|
name = "pull_out_file2",
|
|
paths = ["%s/file2" % package_name()],
|
|
target = ":copy",
|
|
)
|
|
|
|
sh_test(
|
|
name = "file1_test",
|
|
timeout = "short",
|
|
srcs = ["test.sh"],
|
|
args = [
|
|
"lib/tests/copy_to_bin/file1",
|
|
"$(execpath file1)",
|
|
"$(execpath :pull_out_file1)",
|
|
],
|
|
data = [
|
|
"file1",
|
|
":pull_out_file1",
|
|
],
|
|
)
|
|
|
|
sh_test(
|
|
name = "file2_test",
|
|
timeout = "short",
|
|
srcs = ["test.sh"],
|
|
args = [
|
|
"lib/tests/copy_to_bin/file2",
|
|
"$(execpath file2)",
|
|
"$(execpath :pull_out_file2)",
|
|
],
|
|
data = [
|
|
"file2",
|
|
":pull_out_file2",
|
|
],
|
|
)
|
|
|
|
# Case: two different targets copying same file to bin
|
|
copy_to_bin(
|
|
name = "copy_same_file_1",
|
|
srcs = [
|
|
"file3",
|
|
],
|
|
)
|
|
|
|
copy_to_bin(
|
|
name = "copy_same_file_2",
|
|
srcs = [
|
|
"file3",
|
|
],
|
|
)
|