# BUILD file for use with https://github.com/dejwk/roo_testing.

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

cc_library(
    name = "roo_scheduler",
    srcs = glob(
        [
            "src/**/*.cpp",
            "src/**/*.h",
        ],
        exclude = ["test/**"],
    ),
    includes = [
        "src",
    ],
    visibility = ["//visibility:public"],
    deps = [
        "@roo_collections",
        "@roo_threads",
        "@roo_time",
    ],
)

cc_test(
    name = "roo_scheduler_test",
    srcs = [
        "test/roo_scheduler_test.cpp",
    ],
    copts = ["-Iexternal/gtest/include"],
    includes = ["src"],
    linkstatic = 1,
    deps = [
        ":roo_scheduler",
        "@googletest//:gtest",
        "@roo_testing//:arduino_gtest_main",
        "@roo_testing//roo_testing/system:manual_time_mode",
    ],
)

cc_test(
    name = "roo_scheduler_auto_time_test",
    srcs = [
        "test/roo_scheduler_auto_time_test.cpp",
    ],
    copts = ["-Iexternal/gtest/include"],
    includes = ["src"],
    linkstatic = 1,
    deps = [
        ":roo_scheduler",
        "@googletest//:gtest",
        "@roo_testing//:arduino_gtest_main",
    ],
)
