2020-02-20 02:20:52 +00:00
|
|
|
load("//tools:defs.bzl", "cc_library", "cc_test", "gbenchmark", "gtest", "select_system")
|
2019-08-26 21:04:24 +00:00
|
|
|
|
2018-12-10 22:41:40 +00:00
|
|
|
package(
|
|
|
|
default_visibility = ["//:sandbox"],
|
2019-01-31 19:11:44 +00:00
|
|
|
licenses = ["notice"],
|
2018-12-10 22:41:40 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "capability_util",
|
|
|
|
testonly = 1,
|
|
|
|
srcs = ["capability_util.cc"],
|
|
|
|
hdrs = ["capability_util.h"],
|
|
|
|
deps = [
|
|
|
|
":cleanup",
|
|
|
|
":memory_util",
|
|
|
|
":posix_error",
|
|
|
|
":save_util",
|
|
|
|
":test_util",
|
|
|
|
"@com_google_absl//absl/strings",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2019-01-29 16:00:33 +00:00
|
|
|
cc_library(
|
|
|
|
name = "eventfd_util",
|
|
|
|
testonly = 1,
|
|
|
|
hdrs = ["eventfd_util.h"],
|
|
|
|
deps = [
|
|
|
|
":file_descriptor",
|
|
|
|
":posix_error",
|
|
|
|
":save_util",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2018-12-10 22:41:40 +00:00
|
|
|
cc_library(
|
|
|
|
name = "file_descriptor",
|
|
|
|
testonly = 1,
|
|
|
|
hdrs = ["file_descriptor.h"],
|
|
|
|
deps = [
|
|
|
|
":logging",
|
|
|
|
":posix_error",
|
|
|
|
":save_util",
|
|
|
|
"@com_google_absl//absl/strings",
|
|
|
|
"@com_google_absl//absl/strings:str_format",
|
2020-01-31 01:37:17 +00:00
|
|
|
gtest,
|
2018-12-10 22:41:40 +00:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "proc_util",
|
|
|
|
testonly = 1,
|
|
|
|
srcs = ["proc_util.cc"],
|
|
|
|
hdrs = ["proc_util.h"],
|
|
|
|
deps = [
|
|
|
|
":fs_util",
|
|
|
|
":posix_error",
|
|
|
|
":test_util",
|
|
|
|
"@com_google_absl//absl/strings",
|
2020-01-31 01:37:17 +00:00
|
|
|
gtest,
|
2018-12-10 22:41:40 +00:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2018-12-18 15:22:44 +00:00
|
|
|
cc_test(
|
|
|
|
name = "proc_util_test",
|
|
|
|
size = "small",
|
|
|
|
srcs = ["proc_util_test.cc"],
|
|
|
|
deps = [
|
|
|
|
":proc_util",
|
2018-12-21 20:14:17 +00:00
|
|
|
":test_main",
|
2018-12-18 15:22:44 +00:00
|
|
|
":test_util",
|
2020-01-31 01:37:17 +00:00
|
|
|
gtest,
|
2018-12-18 15:22:44 +00:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2018-12-10 22:41:40 +00:00
|
|
|
cc_library(
|
|
|
|
name = "cleanup",
|
|
|
|
testonly = 1,
|
|
|
|
hdrs = ["cleanup.h"],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "fs_util",
|
|
|
|
testonly = 1,
|
|
|
|
srcs = ["fs_util.cc"],
|
|
|
|
hdrs = ["fs_util.h"],
|
|
|
|
deps = [
|
|
|
|
":cleanup",
|
|
|
|
":file_descriptor",
|
|
|
|
":posix_error",
|
|
|
|
"@com_google_absl//absl/strings",
|
2020-01-31 01:37:17 +00:00
|
|
|
gtest,
|
2018-12-10 22:41:40 +00:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_test(
|
|
|
|
name = "fs_util_test",
|
|
|
|
size = "small",
|
|
|
|
srcs = ["fs_util_test.cc"],
|
|
|
|
deps = [
|
|
|
|
":fs_util",
|
|
|
|
":posix_error",
|
|
|
|
":temp_path",
|
2018-12-21 20:14:17 +00:00
|
|
|
":test_main",
|
2018-12-10 22:41:40 +00:00
|
|
|
":test_util",
|
2020-01-31 01:37:17 +00:00
|
|
|
gtest,
|
2018-12-10 22:41:40 +00:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "logging",
|
|
|
|
testonly = 1,
|
|
|
|
srcs = ["logging.cc"],
|
|
|
|
hdrs = ["logging.h"],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "memory_util",
|
|
|
|
testonly = 1,
|
|
|
|
hdrs = ["memory_util.h"],
|
|
|
|
deps = [
|
|
|
|
":logging",
|
|
|
|
":posix_error",
|
|
|
|
":save_util",
|
|
|
|
":test_util",
|
|
|
|
"@com_google_absl//absl/strings",
|
|
|
|
"@com_google_absl//absl/strings:str_format",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "mount_util",
|
|
|
|
testonly = 1,
|
|
|
|
hdrs = ["mount_util.h"],
|
|
|
|
deps = [
|
|
|
|
":cleanup",
|
|
|
|
":posix_error",
|
|
|
|
":test_util",
|
2020-01-31 01:37:17 +00:00
|
|
|
gtest,
|
2018-12-10 22:41:40 +00:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "save_util",
|
|
|
|
testonly = 1,
|
2020-01-27 18:04:07 +00:00
|
|
|
srcs = [
|
|
|
|
"save_util.cc",
|
|
|
|
"save_util_linux.cc",
|
|
|
|
"save_util_other.cc",
|
|
|
|
],
|
2018-12-10 22:41:40 +00:00
|
|
|
hdrs = ["save_util.h"],
|
2020-01-27 18:04:07 +00:00
|
|
|
defines = select_system(),
|
2018-12-10 22:41:40 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "multiprocess_util",
|
|
|
|
testonly = 1,
|
|
|
|
srcs = ["multiprocess_util.cc"],
|
|
|
|
hdrs = ["multiprocess_util.h"],
|
|
|
|
deps = [
|
|
|
|
":cleanup",
|
|
|
|
":file_descriptor",
|
|
|
|
":posix_error",
|
|
|
|
":save_util",
|
|
|
|
":test_util",
|
|
|
|
"@com_google_absl//absl/strings",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2020-01-28 06:27:57 +00:00
|
|
|
cc_library(
|
|
|
|
name = "platform_util",
|
|
|
|
testonly = 1,
|
|
|
|
srcs = ["platform_util.cc"],
|
|
|
|
hdrs = ["platform_util.h"],
|
|
|
|
deps = [":test_util"],
|
|
|
|
)
|
|
|
|
|
2018-12-10 22:41:40 +00:00
|
|
|
cc_library(
|
|
|
|
name = "posix_error",
|
|
|
|
testonly = 1,
|
|
|
|
srcs = ["posix_error.cc"],
|
|
|
|
hdrs = ["posix_error.h"],
|
|
|
|
deps = [
|
|
|
|
":logging",
|
|
|
|
"@com_google_absl//absl/base:core_headers",
|
|
|
|
"@com_google_absl//absl/strings",
|
|
|
|
"@com_google_absl//absl/types:variant",
|
2020-01-31 01:37:17 +00:00
|
|
|
gtest,
|
2018-12-10 22:41:40 +00:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_test(
|
|
|
|
name = "posix_error_test",
|
|
|
|
size = "small",
|
|
|
|
srcs = ["posix_error_test.cc"],
|
2018-12-21 20:14:17 +00:00
|
|
|
deps = [
|
|
|
|
":posix_error",
|
|
|
|
":test_main",
|
2020-01-31 01:37:17 +00:00
|
|
|
gtest,
|
2018-12-21 20:14:17 +00:00
|
|
|
],
|
2018-12-10 22:41:40 +00:00
|
|
|
)
|
|
|
|
|
2019-09-19 18:35:27 +00:00
|
|
|
cc_library(
|
|
|
|
name = "pty_util",
|
|
|
|
testonly = 1,
|
|
|
|
srcs = ["pty_util.cc"],
|
|
|
|
hdrs = ["pty_util.h"],
|
|
|
|
deps = [
|
|
|
|
":file_descriptor",
|
|
|
|
":posix_error",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2018-12-10 22:41:40 +00:00
|
|
|
cc_library(
|
|
|
|
name = "signal_util",
|
|
|
|
testonly = 1,
|
|
|
|
srcs = ["signal_util.cc"],
|
|
|
|
hdrs = ["signal_util.h"],
|
|
|
|
deps = [
|
|
|
|
":cleanup",
|
|
|
|
":posix_error",
|
|
|
|
":test_util",
|
2020-01-31 01:37:17 +00:00
|
|
|
gtest,
|
2018-12-10 22:41:40 +00:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "temp_path",
|
|
|
|
testonly = 1,
|
|
|
|
srcs = ["temp_path.cc"],
|
|
|
|
hdrs = ["temp_path.h"],
|
|
|
|
deps = [
|
|
|
|
":fs_util",
|
|
|
|
":posix_error",
|
|
|
|
":test_util",
|
|
|
|
"@com_google_absl//absl/strings",
|
|
|
|
"@com_google_absl//absl/time",
|
2020-01-31 01:37:17 +00:00
|
|
|
gtest,
|
2018-12-10 22:41:40 +00:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "test_util",
|
|
|
|
testonly = 1,
|
2019-11-13 21:20:29 +00:00
|
|
|
srcs = [
|
|
|
|
"test_util.cc",
|
2020-01-27 18:04:07 +00:00
|
|
|
"test_util_impl.cc",
|
|
|
|
"test_util_runfiles.cc",
|
|
|
|
],
|
|
|
|
hdrs = ["test_util.h"],
|
2020-01-28 06:27:57 +00:00
|
|
|
defines = select_system(),
|
2018-12-10 22:41:40 +00:00
|
|
|
deps = [
|
|
|
|
":fs_util",
|
|
|
|
":logging",
|
|
|
|
":posix_error",
|
|
|
|
":save_util",
|
2019-12-03 20:45:43 +00:00
|
|
|
"@bazel_tools//tools/cpp/runfiles",
|
2018-12-10 22:41:40 +00:00
|
|
|
"@com_google_absl//absl/base:core_headers",
|
2019-09-16 18:56:59 +00:00
|
|
|
"@com_google_absl//absl/flags:flag",
|
|
|
|
"@com_google_absl//absl/flags:parse",
|
2018-12-10 22:41:40 +00:00
|
|
|
"@com_google_absl//absl/strings",
|
|
|
|
"@com_google_absl//absl/strings:str_format",
|
|
|
|
"@com_google_absl//absl/time",
|
2020-01-31 01:37:17 +00:00
|
|
|
gtest,
|
2020-02-20 02:20:52 +00:00
|
|
|
gbenchmark,
|
2018-12-10 22:41:40 +00:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "thread_util",
|
|
|
|
testonly = 1,
|
|
|
|
hdrs = ["thread_util.h"],
|
|
|
|
deps = [":logging"],
|
|
|
|
)
|
|
|
|
|
2019-05-24 19:57:34 +00:00
|
|
|
cc_library(
|
|
|
|
name = "time_util",
|
|
|
|
testonly = 1,
|
|
|
|
srcs = ["time_util.cc"],
|
|
|
|
hdrs = ["time_util.h"],
|
|
|
|
deps = [
|
|
|
|
"@com_google_absl//absl/time",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2018-12-10 22:41:40 +00:00
|
|
|
cc_library(
|
|
|
|
name = "timer_util",
|
|
|
|
testonly = 1,
|
|
|
|
srcs = ["timer_util.cc"],
|
|
|
|
hdrs = ["timer_util.h"],
|
|
|
|
deps = [
|
|
|
|
":cleanup",
|
|
|
|
":logging",
|
|
|
|
":posix_error",
|
|
|
|
":test_util",
|
|
|
|
"@com_google_absl//absl/time",
|
2020-01-31 01:37:17 +00:00
|
|
|
gtest,
|
2018-12-10 22:41:40 +00:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_test(
|
|
|
|
name = "test_util_test",
|
|
|
|
size = "small",
|
|
|
|
srcs = ["test_util_test.cc"],
|
2018-12-21 20:14:17 +00:00
|
|
|
deps = [
|
|
|
|
":test_main",
|
|
|
|
":test_util",
|
2020-01-31 01:37:17 +00:00
|
|
|
gtest,
|
2018-12-21 20:14:17 +00:00
|
|
|
],
|
2018-12-10 22:41:40 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "test_main",
|
|
|
|
testonly = 1,
|
|
|
|
srcs = ["test_main.cc"],
|
|
|
|
deps = [":test_util"],
|
|
|
|
)
|
2018-12-27 22:58:41 +00:00
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "epoll_util",
|
|
|
|
testonly = 1,
|
|
|
|
srcs = ["epoll_util.cc"],
|
|
|
|
hdrs = ["epoll_util.h"],
|
|
|
|
deps = [
|
|
|
|
":file_descriptor",
|
|
|
|
":posix_error",
|
|
|
|
":save_util",
|
2020-01-31 01:37:17 +00:00
|
|
|
gtest,
|
2018-12-27 22:58:41 +00:00
|
|
|
],
|
|
|
|
)
|
2019-01-10 17:43:43 +00:00
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "rlimit_util",
|
|
|
|
testonly = 1,
|
|
|
|
srcs = ["rlimit_util.cc"],
|
|
|
|
hdrs = ["rlimit_util.h"],
|
|
|
|
deps = [
|
|
|
|
":cleanup",
|
|
|
|
":logging",
|
|
|
|
":posix_error",
|
|
|
|
":test_util",
|
|
|
|
],
|
|
|
|
)
|
2019-09-27 21:12:35 +00:00
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "uid_util",
|
|
|
|
testonly = 1,
|
|
|
|
srcs = ["uid_util.cc"],
|
|
|
|
hdrs = ["uid_util.h"],
|
|
|
|
deps = [
|
|
|
|
":posix_error",
|
|
|
|
":save_util",
|
|
|
|
],
|
|
|
|
)
|
2020-03-03 20:36:37 +00:00
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "temp_umask",
|
|
|
|
testonly = 1,
|
|
|
|
hdrs = ["temp_umask.h"],
|
|
|
|
)
|