summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls/linux/BUILD
diff options
context:
space:
mode:
Diffstat (limited to 'test/syscalls/linux/BUILD')
-rw-r--r--test/syscalls/linux/BUILD108
1 files changed, 47 insertions, 61 deletions
diff --git a/test/syscalls/linux/BUILD b/test/syscalls/linux/BUILD
index 68dcc598b..ee7a8a673 100644
--- a/test/syscalls/linux/BUILD
+++ b/test/syscalls/linux/BUILD
@@ -1,5 +1,4 @@
-load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
-load("//test/syscalls:build_defs.bzl", "select_for_linux")
+load("//tools:defs.bzl", "cc_binary", "cc_library", "default_net_util", "select_arch", "select_system")
package(
default_visibility = ["//:sandbox"],
@@ -19,16 +18,6 @@ exports_files(
visibility = ["//:sandbox"],
)
-config_setting(
- name = "x86_64",
- constraint_values = ["@bazel_tools//platforms:x86_64"],
-)
-
-config_setting(
- name = "aarch64",
- constraint_values = ["@bazel_tools//platforms:aarch64"],
-)
-
cc_binary(
name = "sigaltstack_check",
testonly = 1,
@@ -136,13 +125,11 @@ cc_library(
testonly = 1,
srcs = [
"socket_test_util.cc",
- ] + select_for_linux(
- [
- "socket_test_util_impl.cc",
- ],
- ),
+ "socket_test_util_impl.cc",
+ ],
hdrs = ["socket_test_util.h"],
- deps = [
+ defines = select_system(),
+ deps = default_net_util() + [
"@com_google_googletest//:gtest",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/strings",
@@ -153,8 +140,7 @@ cc_library(
"//test/util:temp_path",
"//test/util:test_util",
"//test/util:thread_util",
- ] + select_for_linux([
- ]),
+ ],
)
cc_library(
@@ -207,16 +193,18 @@ cc_binary(
cc_binary(
name = "32bit_test",
testonly = 1,
- srcs = select({
- ":x86_64": ["32bit.cc"],
- ":aarch64": [],
- }),
+ srcs = select_arch(
+ amd64 = ["32bit.cc"],
+ arm64 = [],
+ ),
linkstatic = 1,
deps = [
"//test/util:memory_util",
+ "//test/util:platform_util",
"//test/util:posix_error",
"//test/util:test_main",
"//test/util:test_util",
+ "@com_google_absl//absl/base:core_headers",
"@com_google_googletest//:gtest",
],
)
@@ -496,6 +484,7 @@ cc_binary(
srcs = ["concurrency.cc"],
linkstatic = 1,
deps = [
+ "//test/util:platform_util",
"//test/util:test_main",
"//test/util:test_util",
"//test/util:thread_util",
@@ -597,13 +586,11 @@ cc_binary(
cc_binary(
name = "exceptions_test",
testonly = 1,
- srcs = select({
- ":x86_64": ["exceptions.cc"],
- ":aarch64": [],
- }),
+ srcs = ["exceptions.cc"],
linkstatic = 1,
deps = [
"//test/util:logging",
+ "//test/util:platform_util",
"//test/util:signal_util",
"//test/util:test_main",
"//test/util:test_util",
@@ -656,10 +643,10 @@ cc_binary(
cc_binary(
name = "exec_binary_test",
testonly = 1,
- srcs = select({
- ":x86_64": ["exec_binary.cc"],
- ":aarch64": [],
- }),
+ srcs = select_arch(
+ amd64 = ["exec_binary.cc"],
+ arm64 = [],
+ ),
linkstatic = 1,
deps = [
"//test/util:cleanup",
@@ -773,6 +760,7 @@ cc_binary(
":socket_test_util",
"//test/util:cleanup",
"//test/util:eventfd_util",
+ "//test/util:fs_util",
"//test/util:multiprocess_util",
"//test/util:posix_error",
"//test/util:save_util",
@@ -830,10 +818,10 @@ cc_binary(
cc_binary(
name = "fpsig_fork_test",
testonly = 1,
- srcs = select({
- ":x86_64": ["fpsig_fork.cc"],
- ":aarch64": [],
- }),
+ srcs = select_arch(
+ amd64 = ["fpsig_fork.cc"],
+ arm64 = [],
+ ),
linkstatic = 1,
deps = [
"//test/util:logging",
@@ -847,10 +835,10 @@ cc_binary(
cc_binary(
name = "fpsig_nested_test",
testonly = 1,
- srcs = select({
- ":x86_64": ["fpsig_nested.cc"],
- ":aarch64": [],
- }),
+ srcs = select_arch(
+ amd64 = ["fpsig_nested.cc"],
+ arm64 = [],
+ ),
linkstatic = 1,
deps = [
"//test/util:test_main",
@@ -1416,6 +1404,7 @@ cc_binary(
linkstatic = 1,
deps = [
"//test/util:file_descriptor",
+ "//test/util:fs_util",
"//test/util:posix_error",
"//test/util:temp_path",
"//test/util:test_main",
@@ -1465,12 +1454,10 @@ cc_binary(
cc_binary(
name = "arch_prctl_test",
testonly = 1,
- srcs = select({
- ":x86_64": ["arch_prctl.cc"],
- ":aarch64": [],
- }),
+ srcs = ["arch_prctl.cc"],
linkstatic = 1,
deps = [
+ "//test/util:file_descriptor",
"//test/util:test_main",
"//test/util:test_util",
"@com_google_googletest//:gtest",
@@ -1689,6 +1676,7 @@ cc_binary(
deps = [
"//test/util:logging",
"//test/util:multiprocess_util",
+ "//test/util:platform_util",
"//test/util:signal_util",
"//test/util:test_util",
"//test/util:thread_util",
@@ -2063,21 +2051,21 @@ cc_binary(
cc_binary(
name = "sigiret_test",
testonly = 1,
- srcs = select({
- ":x86_64": ["sigiret.cc"],
- ":aarch64": [],
- }),
+ srcs = select_arch(
+ amd64 = ["sigiret.cc"],
+ arm64 = [],
+ ),
linkstatic = 1,
deps = [
+ "@com_google_googletest//:gtest",
"//test/util:logging",
"//test/util:signal_util",
"//test/util:test_util",
"//test/util:timer_util",
- "@com_google_googletest//:gtest",
- ] + select({
- ":x86_64": [],
- ":aarch64": ["//test/util:test_main"],
- }),
+ ] + select_arch(
+ amd64 = [],
+ arm64 = ["//test/util:test_main"],
+ ),
)
cc_binary(
@@ -2205,6 +2193,7 @@ cc_library(
":socket_test_util",
"//test/util:test_util",
"//test/util:thread_util",
+ "@com_google_absl//absl/memory",
"@com_google_absl//absl/time",
"@com_google_googletest//:gtest",
],
@@ -2727,6 +2716,7 @@ cc_binary(
srcs = ["socket_inet_loopback.cc"],
linkstatic = 1,
deps = [
+ ":ip_socket_test_util",
":socket_test_util",
"//test/util:file_descriptor",
"//test/util:posix_error",
@@ -2922,7 +2912,6 @@ cc_library(
":unix_domain_socket_test_util",
"//test/util:test_util",
"//test/util:thread_util",
- "//test/util:timer_util",
"@com_google_absl//absl/time",
"@com_google_googletest//:gtest",
],
@@ -3294,10 +3283,7 @@ cc_binary(
cc_binary(
name = "sysret_test",
testonly = 1,
- srcs = select({
- ":x86_64": ["sysret.cc"],
- ":aarch64": [],
- }),
+ srcs = ["sysret.cc"],
linkstatic = 1,
deps = [
"//test/util:logging",
@@ -3420,11 +3406,11 @@ cc_library(
name = "udp_socket_test_cases",
testonly = 1,
srcs = [
- "udp_socket_test_cases.cc",
- ] + select_for_linux([
"udp_socket_errqueue_test_case.cc",
- ]),
+ "udp_socket_test_cases.cc",
+ ],
hdrs = ["udp_socket_test_cases.h"],
+ defines = select_system(),
deps = [
":socket_test_util",
":unix_domain_socket_test_util",