| # 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/components.gni") |
| import("//build/cpp/sdk_source_set.gni") |
| import("//build/test.gni") |
| |
| sdk_source_set("cpp") { |
| category = "partner" |
| stable = true |
| sdk_name = "mock_mmio_cpp" |
| include_base = "//sdk" |
| |
| sources = [ |
| "globally-ordered-region.cc", |
| "globally-ordered-region.h", |
| "region.cc", |
| "region.h", |
| "register.cc", |
| "register.h", |
| ] |
| |
| public_deps = [ "//sdk/lib/driver/mmio/cpp" ] |
| |
| public_configs = [ "//sdk/config" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":globally-ordered-region-test-bin", |
| ":region-test-bin", |
| ] |
| } |
| |
| test("region-test-bin") { |
| if (is_fuchsia) { |
| fdio_config = [ "//build/config/fuchsia:fdio_config" ] |
| if (configs + fdio_config - fdio_config != configs) { |
| configs -= fdio_config |
| } |
| } |
| output_name = "mock-mmio-region-sdk-test" |
| sources = [ "tests/region-test.cc" ] |
| deps = [ |
| ":cpp", |
| "//sdk/lib/driver/mmio/cpp", |
| "//src/lib/fxl/test:gtest_main", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| test("globally-ordered-region-test-bin") { |
| output_name = "globally-ordered-region-cpp-test" |
| sources = [ "tests/globally-ordered-region-test.cc" ] |
| deps = [ |
| ":cpp", |
| "//src/lib/fxl/test:gtest_main", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| fuchsia_unittest_package("mock-mmio-cpp-test") { |
| deps = [ |
| ":globally-ordered-region-test-bin", |
| ":region-test-bin", |
| ] |
| } |