load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target")
load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest")
load("../../../../defs.bzl", "folly_xplat_cxx_test")
load("../../../../io/async/test/certs/defs.bzl", "alias_pem")

oncall("fbcode_entropy_wardens_folly")

non_fbcode_target(
    _kind = folly_xplat_cxx_test,
    name = "ssl_errors_test",
    srcs = ["SSLErrorsTest.cpp"],
    contacts = ["oncall+secure_pipes@xmail.facebook.com"],
    raw_headers = [],
    deps = [
        "fbsource//xplat/folly/portability:gtest",
        "fbsource//xplat/folly/portability:openssl",
        "//xplat/folly/io/async/ssl:ssl_errors",
    ],
)

non_fbcode_target(
    _kind = folly_xplat_cxx_test,
    name = "basic_transport_certificate_test",
    srcs = [
        # "BasicTransportCertificateTest.cpp",
    ],
    contacts = ["oncall+secure_pipes@xmail.facebook.com"],
    raw_headers = [],
    deps = [
        "fbsource//xplat/folly/portability:gtest",
        "//xplat/folly:file_util",
        "//xplat/folly/io/async/ssl:basic_transport_certificate",
        "//xplat/folly/ssl:openssl_cert_utils",
    ],
)

# !!!! fbcode/folly/io/async/ssl/test/TARGETS was merged into this file, see https://fburl.com/workplace/xl8l9yuo for more info !!!!

fbcode_target(
    _kind = alias_pem,
    pems = [
        "tests-cert.pem",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "ssl_errors_test",
    srcs = ["SSLErrorsTest.cpp"],
    headers = [],
    emails = ["oncall+secure_pipes@xmail.facebook.com"],
    deps = [
        "//folly/io/async/ssl:ssl_errors",
        "//folly/portability:gtest",
        "//folly/portability:openssl",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "basic_transport_certificate_test",
    srcs = ["BasicTransportCertificateTest.cpp"],
    headers = [],
    emails = ["oncall+secure_pipes@xmail.facebook.com"],
    resources = [
        ":tests-cert.pem",
    ],
    deps = [
        "//folly:file_util",
        "//folly/io/async/ssl:basic_transport_certificate",
        "//folly/portability:gtest",
        "//folly/ssl:openssl_cert_utils",
        "//folly/testing:test_util",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "openssl_utils_test",
    srcs = ["OpenSSLUtilsTest.cpp"],
    headers = [],
    emails = ["oncall+secure_pipes@xmail.facebook.com"],
    deps = [
        "//folly:string",
        "//folly/io/async/ssl:openssl_utils",
        "//folly/portability:gtest",
        "//folly/portability:openssl",
        "//folly/ssl:openssl_ptr_types",
    ],
)
