mirror of
https://github.com/protocolbuffers/protobuf
synced 2026-08-26 02:23:14 -04:00
This is required for use with bazel after this commit71ca0ed111Many files have these already Closes #23584 COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/23584 from keith:ks/bazel-add-missing-rules_cc-loads733a0ccf6fPiperOrigin-RevId: 817836399
42 lines
975 B
Text
42 lines
975 B
Text
# Tests for CMake file list generation
|
|
|
|
load("@rules_cc//cc:cc_library.bzl", "cc_library")
|
|
load("@rules_shell//shell:sh_test.bzl", "sh_test")
|
|
load("//pkg:build_systems.bzl", "gen_file_lists")
|
|
load("//pkg:cc_dist_library.bzl", "cc_dist_library")
|
|
|
|
cc_library(
|
|
name = "test_lib",
|
|
testonly = True,
|
|
srcs = ["test_lib.cc"],
|
|
hdrs = ["test_lib.h"],
|
|
)
|
|
|
|
cc_dist_library(
|
|
name = "test_lib_dist",
|
|
testonly = True,
|
|
deps = [":test_lib"],
|
|
)
|
|
|
|
gen_file_lists(
|
|
name = "gen_file_lists",
|
|
testonly = True,
|
|
out_stem = "file_lists",
|
|
src_libs = {
|
|
":test_lib_dist": "libtest",
|
|
},
|
|
)
|
|
|
|
# This test checks the output from gen_file_lists() against a golden file.
|
|
sh_test(
|
|
name = "gen_file_lists_golden_test",
|
|
srcs = ["gen_file_lists_golden_test.sh"],
|
|
args = [
|
|
"$(location file_lists.cmake.golden)",
|
|
"$(location :gen_file_lists)",
|
|
],
|
|
data = [
|
|
"file_lists.cmake.golden",
|
|
":gen_file_lists",
|
|
],
|
|
)
|