| # Copyright 2025 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/test.gni") |
| |
| source_set("i2c-channel") { |
| sources = [ |
| "i2c-channel.cc", |
| "i2c-channel.h", |
| ] |
| public_deps = [ |
| "//sdk/fidl/fuchsia.hardware.i2c:fuchsia.hardware.i2c_cpp", |
| "//sdk/lib/driver/incoming/cpp", |
| "//zircon/system/ulib/zx", |
| ] |
| deps = [ "//zircon/system/ulib/zx" ] |
| } |
| |
| test("i2c-channel-test-bin") { |
| testonly = true |
| output_name = "i2c-channel-test" |
| sources = [ "i2c-channel-test.cc" ] |
| deps = [ |
| ":i2c-channel", |
| "//sdk/fidl/fuchsia.hardware.i2c:fuchsia.hardware.i2c_cpp", |
| "//sdk/lib/async-loop:async-loop-cpp", |
| "//sdk/lib/async_patterns/testing/cpp", |
| "//sdk/lib/component/outgoing/cpp", |
| "//src/devices/i2c/testing/fake-i2c", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/testing/predicates", |
| "//third_party/googletest:gmock", |
| ] |
| } |
| |
| fuchsia_unittest_package("i2c-channel-test") { |
| deps = [ ":i2c-channel-test-bin" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":i2c-channel-test" ] |
| } |