load("@fbsource//tools/build_defs/dirsync:fb_dirsync_cpp_unittest.bzl", "fb_dirsync_cpp_unittest")
load("@fbsource//xplat/folly:defs.bzl", "folly_xplat_cxx_test")

oncall("fbcode_entropy_wardens_folly")

fb_dirsync_cpp_unittest(
    name = "at_fork_test",
    srcs = ["AtForkTest.cpp"],
    xplat_impl = folly_xplat_cxx_test,
    deps = [
        "//folly:utility",
        "//folly/portability:gmock",
        "//folly/portability:gtest",
        "//folly/system:at_fork",
    ],
    external_deps = [
        "glog",
    ],
)

fb_dirsync_cpp_unittest(
    name = "aux_vector_test",
    srcs = ["AuxVectorTest.cpp"],
    xplat_impl = folly_xplat_cxx_test,
    deps = [
        "//folly/portability:gtest",
        "//folly/system:aux_vector",
    ],
)

fb_dirsync_cpp_unittest(
    name = "env_util_test",
    srcs = ["EnvUtilTest.cpp"],
    xplat_impl = folly_xplat_cxx_test,
    deps = [
        "//folly:subprocess",
        "//folly/container:array",
        "//folly/portability:fcntl",
        "//folly/portability:gflags",
        "//folly/portability:gtest",
        "//folly/portability:stdlib",
        "//folly/system:env_util",
    ],
    external_deps = [
        ("boost", None, "boost_algorithm"),
        "glog",
    ],
)

fb_dirsync_cpp_unittest(
    name = "pid_test",
    srcs = ["PidTest.cpp"],
    xplat_impl = folly_xplat_cxx_test,
    deps = [
        "//folly/portability:gtest",
        "//folly/system:pid",
    ],
    external_deps = [
        "glog",
    ],
)

fb_dirsync_cpp_unittest(
    name = "memory_mapping_test",
    srcs = ["MemoryMappingTest.cpp"],
    xplat_impl = folly_xplat_cxx_test,
    deps = [
        "//folly:file_util",
        "//folly:random",
        "//folly/portability:gtest",
        "//folly/portability:sys_mman",
        "//folly/system:memory_mapping",
    ],
    external_deps = [
        "glog",
    ],
)

fb_dirsync_cpp_unittest(
    name = "shell_test",
    srcs = ["ShellTest.cpp"],
    xplat_impl = folly_xplat_cxx_test,
    deps = [
        "//folly/portability:gtest",
        "//folly/system:shell",
    ],
    external_deps = [
        "glog",
    ],
)

fb_dirsync_cpp_unittest(
    name = "thread_id_test",
    srcs = ["ThreadIdTest.cpp"],
    xplat_impl = folly_xplat_cxx_test,
    deps = [
        "//folly:benchmark",
        "//folly/portability:gtest",
        "//folly/portability:unistd",
        "//folly/system:thread_id",
    ],
)

fb_dirsync_cpp_unittest(
    name = "thread_name_test",
    srcs = ["ThreadNameTest.cpp"],
    xplat_impl = folly_xplat_cxx_test,
    deps = [
        "//folly:scope_guard",
        "//folly/portability:gtest",
        "//folly/synchronization:baton",
        "//folly/system:thread_name",
    ],
)

fb_dirsync_cpp_unittest(
    name = "hardware_concurrency_test",
    srcs = ["HardwareConcurrencyTest.cpp"],
    headers = [],
    deps = [
        "//folly/portability:gtest",
        "//folly/system:hardware_concurrency",
    ],
)
