load("@rules_cc//cc:defs.bzl", "cc_test")

cc_test(
    name = "concurrency_validation_test",
    size = "small",
    srcs = ["concurrency_validation_test.cpp"],
    copts = [],
    deps = [
        "//library/src:testable_dds",
        "//library/src/api:api_definitions",
        "@googletest//:gtest_main",
    ],
)

cc_test(
    name = "configure_tt_api_test",
    size = "small",
    srcs = ["configure_tt_api_test.cpp"],
    deps = [
        "//library/src:testable_dds",
        "//library/src/api:api_definitions",
        "@googletest//:gtest_main",
    ],
)

cc_test(
    name = "context_equivalence_test",
    size = "small",
    srcs = ["context_equivalence_test.cpp"],
    copts = [],
    deps = [
        "//library/src:dds",
        "//library/src/api:api_definitions",
        "@googletest//:gtest_main",
    ],
)

# Same parity test, but with context TT ownership enabled to validate lazy TT path
cc_test(
    name = "context_equivalence_test_ctx_tt",
    size = "small",
    srcs = ["context_equivalence_test.cpp"],
    copts = [],
    local_defines = ["DDS_TT_CONTEXT_OWNERSHIP"],
    deps = [
        "//library/src:testable_dds",
        "//library/src/api:api_definitions",
        "@googletest//:gtest_main",
    ],
)

# New lifecycle test that validates SolverContext-managed TT behavior
cc_test(
    name = "context_tt_facade_test",
    size = "small",
    srcs = ["context_tt_facade_test.cpp"],
    copts = [],
    deps = [
        "//library/src:testable_dds",
        "//library/src/api:api_definitions",
        "@googletest//:gtest_main",
    ],
)

# Utilities feature flags tests
cc_test(
    name = "utilities_feature_flags_test",
    size = "small",
    srcs = ["utilities_feature_flags_test.cpp"],
    deps = [
        "//library/src:testable_dds",
        "//library/src/api:api_definitions",
        "@googletest//:gtest_main",
    ],
)

cc_test(
    name = "utilities_feature_flags_test_with_log",
    size = "small",
    srcs = ["utilities_feature_flags_test_with_log.cpp"],
    deps = [
        "//library/src:testable_dds_util_log",
        "//library/src/api:api_definitions",
        "@googletest//:gtest_main",
    ],
)

cc_test(
    name = "utilities_feature_flags_test_with_stats",
    size = "small",
    srcs = ["utilities_feature_flags_test_with_stats.cpp"],
    deps = [
        "//library/src:testable_dds_util_stats",
        "//library/src/api:api_definitions",
        "@googletest//:gtest_main",
    ],
)

# Utilities logging tests
cc_test(
    name = "utilities_log_contains_test",
    size = "small",
    srcs = ["utilities_log_contains_test.cpp"],
    deps = [
        "//library/src:testable_dds",
        "//library/src/api:api_definitions",
        "@googletest//:gtest_main",
    ],
)

cc_test(
    name = "utilities_log_ctx_ops_test",
    size = "small",
    srcs = ["utilities_log_ctx_ops_test.cpp"],
    deps = [
        "//library/src:testable_dds",
        "//library/src/api:api_definitions",
        "@googletest//:gtest_main",
    ],
)

cc_test(
    name = "utilities_log_ctx_ops_test_with_define",
    size = "small",
    srcs = ["utilities_log_ctx_ops_test_with_define.cpp"],
    deps = [
        "//library/src:testable_dds_util_log",
        "//library/src/api:api_definitions",
        "@googletest//:gtest_main",
    ],
)

cc_test(
    name = "utilities_log_test",
    size = "small",
    srcs = ["utilities_log_test.cpp"],
    copts = [],
    deps = [
        "//library/src:testable_dds",
        "//library/src/api:api_definitions",
        "@googletest//:gtest_main",
    ],
)

cc_test(
    name = "utilities_log_test_with_define",
    size = "small",
    srcs = ["utilities_log_test_with_define.cpp"],
    deps = [
        "//library/src:testable_dds_util_log",
        "//library/src/api:api_definitions",
        "@googletest//:gtest_main",
    ],
)

# Utilities snapshot tests
# DISABLED: Tests for unimplemented log_snapshot() feature
cc_test(
    name = "utilities_log_snapshot_test",
    srcs = ["utilities_log_snapshot_test.cpp"],
    tags = ["manual"],
    deps = [
        "//library/src:testable_dds",
        "//library/src/api:api_definitions",
        "@googletest//:gtest_main",
    ],
)

# Utilities stats tests
cc_test(
    name = "utilities_stats_test",
    size = "small",
    srcs = ["utilities_stats_test.cpp"],
    deps = [
        "//library/src:testable_dds",
        "//library/src/api:api_definitions",
        "@googletest//:gtest_main",
    ],
)

# Transposition table sharing tests
# DISABLED: Tests for SolverContext TT sharing (incomplete API)
cc_test(
    name = "tt_sharing_test",
    srcs = ["tt_sharing_test.cpp"],
    tags = ["manual"],
    deps = [
        "//library/src:testable_dds",
        "//library/src/api:api_definitions",
        "@googletest//:gtest_main",
    ],
)
