| # Copyright 2024 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/cpp/cpp_fuzzer.gni") |
| import("//build/cpp/library_headers.gni") |
| import("//build/fuzz.gni") |
| import("//build/test.gni") |
| |
| library_headers("headers") { |
| headers = [ |
| "lib/sched/affine.h", |
| "lib/sched/run-queue.h", |
| "lib/sched/thread-base.h", |
| ] |
| |
| public_deps = [ |
| # run-queue.h includes <fbl/intrusive_wavl_tree.h> |
| # run-queue.h includes <fbl/wavl_tree_best_node_observer.h> |
| # thread-base.h includes <fbl/intrusive_wavl_tree.h> |
| "//zircon/system/ulib/fbl", |
| |
| # thread-base.h includes <ffl/fixed.h> |
| "//zircon/system/ulib/ffl:headers", |
| ] |
| } |
| |
| source_set("sched") { |
| public_deps = [ ":headers" ] |
| deps = [ "//zircon/system/ulib/ffl" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":sched-fuzzers($default_toolchain)", |
| ":sched-unittests($host_toolchain)", |
| ] |
| } |
| |
| test("sched-unittests") { |
| sources = [ |
| "affine-tests.cc", |
| "run-queue-tests.cc", |
| "thread-base-tests.cc", |
| ] |
| deps = [ |
| ":sched", |
| "//src/lib/fxl/test:gtest_main", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| if (is_fuchsia) { |
| cpp_fuzzer("run-queue-fuzzer") { |
| sources = [ "run-queue-fuzzer.cc" ] |
| deps = [ ":sched" ] |
| } |
| |
| fuchsia_fuzzer_component("run-queue-fuzzer-component") { |
| manifest = "meta/run-queue-fuzzer.cml" |
| deps = [ ":run-queue-fuzzer" ] |
| } |
| |
| fuchsia_fuzzer_package("sched-fuzzers") { |
| cpp_fuzzer_components = [ ":run-queue-fuzzer-component" ] |
| } |
| } |