| # Copyright 2020 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/bind/bind.gni") |
| import("//build/config/fuchsia/rules.gni") |
| import("//build/test.gni") |
| import("//src/sys/build/components.gni") |
| |
| group("common") { |
| public_deps = [ |
| ":bind", |
| "//sdk/banjo/fuchsia.hardware.i2c", |
| "//sdk/banjo/fuchsia.hardware.platform.bus:fuchsia.hardware.platform.bus_banjo_cpp", |
| "//sdk/fidl/fuchsia.hardware.power.sensor:fuchsia.hardware.power.sensor_llcpp", |
| "//src/devices/i2c/lib/device-protocol-i2c-channel", |
| "//src/devices/lib/driver", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//zircon/public/lib/zxc", |
| ] |
| } |
| |
| bind_rules("bind") { |
| rules = "ti-ina231.bind" |
| output = "ti-ina231-bind.h" |
| tests = "ti-ina231-bind-test.json" |
| deps = [ "//src/devices/bind/fuchsia.ti.platform" ] |
| } |
| |
| driver_module("ti-ina231") { |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| sources = [ "ti-ina231.cc" ] |
| deps = [ ":common" ] |
| } |
| |
| test("ti-ina231-test-bin") { |
| output_name = "ti-ina231-test" |
| configs += [ "//build/config:all_source" ] |
| sources = [ |
| "ti-ina231-test.cc", |
| "ti-ina231.cc", |
| ] |
| deps = [ |
| ":common", |
| "//src/devices/i2c/testing/fake-i2c", |
| "//src/devices/testing/fake_ddk", |
| "//zircon/public/lib/zxtest", |
| ] |
| |
| # TODO(fxbug.dev/69585): This target uses raw zx::channel with LLCPP which is deprecated. |
| # Please migrate to typed channel APIs (fidl::ClientEnd<T>, fidl::ServerEnd<T>). |
| # See linked bug for details. |
| configs += [ "//build/cpp:fidl-llcpp-deprecated-raw-channels" ] |
| } |
| |
| fuchsia_unittest_package("ti-ina231-test") { |
| deps = [ ":ti-ina231-test-bin" ] |
| test_specs = { |
| environments = basic_envs |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":bind_test", |
| ":ti-ina231-test", |
| ] |
| } |