load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest")
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target")

oncall("executorch")

# AOT export coverage only (lowers via VulkanPartitioner, asserts a VulkanBackend delegate); no GPU runtime.
fbcode_target(
    _kind = python_unittest,
    name = "test_add",
    srcs = [
        "ops/test_add.py",
    ],
    deps = [
        "//caffe2:torch",
        "//executorch/backends/vulkan/partitioner:vulkan_partitioner",
        "//executorch/backends/vulkan:vulkan_preprocess",
        "//executorch/exir:lib",
    ],
)

fbcode_target(
    _kind = python_unittest,
    name = "test_index",
    srcs = [
        "ops/index/test_index.py",
    ],
    deps = [
        "//caffe2:torch",
        "//executorch/backends/vulkan/partitioner:vulkan_partitioner",
        "//executorch/backends/vulkan:vulkan_preprocess",
        "//executorch/exir:lib",
    ],
)

fbcode_target(
    _kind = python_unittest,
    name = "test_webgpu_partitioner",
    srcs = [
        "test_webgpu_partitioner.py",
    ],
    deps = [
        "//caffe2:torch",
        "//executorch/backends/vulkan/partitioner:vulkan_partitioner",
        "//executorch/backends/vulkan:vulkan_preprocess",
        "//executorch/backends/webgpu/partitioner:webgpu_partitioner",
        "//executorch/backends/webgpu/test:tester",
        "//executorch/exir:lib",
        "//executorch/exir/backend:partitioner",
    ],
)

fbcode_target(
    _kind = runtime.python_library,
    name = "tester",
    srcs = ["tester.py"],
    deps = [
        "//caffe2:torch",
        "//executorch/backends/test/harness:tester",
        "//executorch/backends/transforms:duplicate_dynamic_quant_chain",
        "//executorch/backends/webgpu/partitioner:webgpu_partitioner",
        "//executorch/exir:lib",
        "//executorch/exir/backend:partitioner",
        "//pytorch/ao:torchao",  # @manual
    ],
)
