| # 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/components.gni") |
| import("//build/drivers.gni") |
| import("//build/test.gni") |
| |
| driver_bind_rules("tmp112-bind") { |
| rules = "tmp112.bind" |
| tests = "tmp112-bind-test.json" |
| deps = [ |
| "//sdk/fidl/fuchsia.hardware.i2c:fuchsia.hardware.i2c_bindlib", |
| "//src/devices/bind/fuchsia.ti.platform", |
| ] |
| } |
| |
| fuchsia_driver("tmp112-driver") { |
| output_name = "tmp112" |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| sources = [ "tmp112.cc" ] |
| deps = [ |
| ":tmp112-bind", |
| "//sdk/fidl/fuchsia.hardware.temperature:fuchsia.hardware.temperature_cpp", |
| "//src/devices/bus/lib/device-protocol-pdev", |
| "//src/devices/i2c/lib/device-protocol-i2c-channel", |
| "//src/devices/lib/driver", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| ] |
| } |
| |
| fuchsia_driver_component("tmp112") { |
| info = "tmp112-info.json" |
| component_name = "tmp112" |
| deps = [ ":tmp112-driver" ] |
| manifest = "meta/tmp112.cml" |
| } |
| |
| test("tmp112-test-bin") { |
| output_name = "tmp112-test" |
| sources = [ |
| "tmp112-test.cc", |
| "tmp112.cc", |
| ] |
| deps = [ |
| ":tmp112-bind", |
| "//sdk/fidl/fuchsia.hardware.i2c:fuchsia.hardware.i2c_cpp", |
| "//sdk/fidl/fuchsia.hardware.temperature:fuchsia.hardware.temperature_cpp", |
| "//src/devices/bus/lib/device-protocol-pdev", |
| "//src/devices/i2c/lib/device-protocol-i2c-channel", |
| "//src/devices/i2c/testing/mock-i2c", |
| "//src/devices/testing/mock-ddk", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/zxtest", |
| ] |
| } |
| |
| fuchsia_unittest_package("tmp112-test") { |
| deps = [ ":tmp112-test-bin" ] |
| test_specs = { |
| environments = basic_envs |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":tmp112-bind_test", |
| ":tmp112-test", |
| ] |
| } |