mirror of
https://github.com/bazel-contrib/rules_foreign_cc
synced 2024-11-28 08:43:26 +00:00
14520d220f
* Made buildifier checks more aggressive * Ran buildifier to fix all warnings * Added sorting to cmake script generation and updated tests
64 lines
1.1 KiB
Python
64 lines
1.1 KiB
Python
load("@bazel_skylib//rules:diff_test.bzl", "diff_test")
|
|
load(":detect_root_test_rule.bzl", "detect_root_test_rule")
|
|
|
|
filegroup(
|
|
name = "fg",
|
|
srcs = glob(
|
|
["dir1/**"],
|
|
exclude_directories = 0,
|
|
),
|
|
)
|
|
|
|
filegroup(
|
|
name = "fg_srcs",
|
|
srcs = glob(
|
|
["dir1/srcs/**"],
|
|
exclude_directories = 0,
|
|
),
|
|
)
|
|
|
|
detect_root_test_rule(
|
|
name = "srcs_is_fg",
|
|
srcs = ":fg",
|
|
out = "out_fg.txt",
|
|
)
|
|
|
|
detect_root_test_rule(
|
|
name = "srcs_is_fg_srcs",
|
|
srcs = ":fg_srcs",
|
|
out = "out_fg_srcs.txt",
|
|
)
|
|
|
|
detect_root_test_rule(
|
|
name = "srcs_in_repo",
|
|
srcs = "@repo//:srcs",
|
|
out = "out_repo.txt",
|
|
)
|
|
|
|
diff_test(
|
|
name = "repo_test",
|
|
file1 = ":srcs_in_repo",
|
|
file2 = "expected/out_repo.txt",
|
|
)
|
|
|
|
diff_test(
|
|
name = "fg_test",
|
|
file1 = ":srcs_is_fg",
|
|
file2 = "expected/out_fg.txt",
|
|
)
|
|
|
|
diff_test(
|
|
name = "fg_srcs_test",
|
|
file1 = ":srcs_is_fg_srcs",
|
|
file2 = "expected/out_fg_srcs.txt",
|
|
)
|
|
|
|
test_suite(
|
|
name = "tests",
|
|
tests = [
|
|
"fg_srcs_test",
|
|
"fg_test",
|
|
"repo_test",
|
|
],
|
|
)
|