mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
dfc51704c0
The underlying issue is with a Copybara transform and the internal Blaze BUILD file. PiperOrigin-RevId: 308787839 Change-Id: I32af664b3eac4c925d39f50b967756198eff23f3
140 lines
3.7 KiB
Python
140 lines
3.7 KiB
Python
# Copyright 2019 Google LLC
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
load("//sandboxed_api/bazel:build_defs.bzl", "sapi_platform_copts")
|
|
load("//sandboxed_api/bazel:proto.bzl", "sapi_proto_library")
|
|
|
|
package(default_visibility = ["//sandboxed_api:__subpackages__"])
|
|
|
|
licenses(["notice"])
|
|
|
|
sapi_proto_library(
|
|
name = "status_proto",
|
|
srcs = ["status.proto"],
|
|
)
|
|
|
|
# Reimplementations of utility functions not released with absl::Status.
|
|
cc_library(
|
|
name = "status",
|
|
srcs = ["status.cc"],
|
|
hdrs = [
|
|
"status.h",
|
|
"status_macros.h",
|
|
],
|
|
copts = sapi_platform_copts(),
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":status_cc_proto",
|
|
"@com_google_absl//absl/base:core_headers",
|
|
"@com_google_absl//absl/status",
|
|
"@com_google_absl//absl/strings",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "statusor",
|
|
hdrs = ["statusor.h"],
|
|
copts = sapi_platform_copts(),
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":raw_logging",
|
|
":status",
|
|
"@com_google_absl//absl/base:core_headers",
|
|
"@com_google_absl//absl/base:log_severity",
|
|
"@com_google_absl//absl/status",
|
|
"@com_google_absl//absl/types:variant",
|
|
],
|
|
)
|
|
|
|
# gMock matchers for absl::Status and sapi::StatusOr<T> and a gUnit printer
|
|
# extension for sapi::StatusOr<T>.
|
|
cc_library(
|
|
name = "status_matchers",
|
|
testonly = 1,
|
|
hdrs = ["status_matchers.h"],
|
|
copts = sapi_platform_copts(),
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":status",
|
|
":statusor",
|
|
"@com_google_absl//absl/status",
|
|
"@com_google_absl//absl/types:optional",
|
|
"@com_google_googletest//:gtest",
|
|
],
|
|
)
|
|
|
|
# Tests for the Status utility.
|
|
cc_test(
|
|
name = "status_test",
|
|
srcs = ["status_test.cc"],
|
|
copts = sapi_platform_copts(),
|
|
deps = [
|
|
":status",
|
|
":status_matchers",
|
|
"@com_google_absl//absl/status",
|
|
"@com_google_googletest//:gtest_main",
|
|
],
|
|
)
|
|
|
|
# Tests for the StatusOr template class.
|
|
cc_test(
|
|
name = "statusor_test",
|
|
srcs = ["statusor_test.cc"],
|
|
copts = sapi_platform_copts(),
|
|
deps = [
|
|
":status",
|
|
":status_matchers",
|
|
":statusor",
|
|
"@com_google_googletest//:gtest_main",
|
|
],
|
|
)
|
|
|
|
# Tests for the Status macros.
|
|
cc_test(
|
|
name = "status_macros_test",
|
|
srcs = ["status_macros_test.cc"],
|
|
copts = sapi_platform_copts(),
|
|
deps = [
|
|
":status",
|
|
":status_matchers",
|
|
":statusor",
|
|
"@com_google_absl//absl/memory",
|
|
"@com_google_absl//absl/status",
|
|
"@com_google_absl//absl/strings",
|
|
"@com_google_googletest//:gtest_main",
|
|
],
|
|
)
|
|
|
|
# Compatibility layer for Abseil's flags vs. gFlags
|
|
cc_library(
|
|
name = "flags",
|
|
hdrs = ["flag.h"],
|
|
copts = sapi_platform_copts(),
|
|
deps = ["@com_github_gflags_gflags//:gflags"],
|
|
)
|
|
|
|
# Small support library emulating verbose logging using Abseil's raw logging
|
|
# facility.
|
|
cc_library(
|
|
name = "raw_logging",
|
|
srcs = ["raw_logging.cc"],
|
|
hdrs = ["raw_logging.h"],
|
|
copts = sapi_platform_copts(),
|
|
deps = [
|
|
"//sandboxed_api/sandbox2/util:strerror",
|
|
"@com_google_absl//absl/strings",
|
|
"@com_google_absl//absl/strings:str_format",
|
|
],
|
|
)
|