| # 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("//build/test/test_package.gni") |
| |
| bind_rules("tmp112-bind") { |
| rules = "tmp112.bind" |
| output = "tmp112-bind.h" |
| tests = "tmp112-bind-test.json" |
| deps = [ |
| "//src/devices/bind/fuchsia.i2c", |
| "//src/devices/bind/fuchsia.ti.platform", |
| ] |
| } |
| |
| driver_module("tmp112") { |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| sources = [ "tmp112.cc" ] |
| deps = [ |
| ":tmp112-bind", |
| "//sdk/fidl/fuchsia.hardware.temperature:fuchsia.hardware.temperature_llcpp", |
| "//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", |
| ] |
| } |
| |
| test("tmp112-test") { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| output_name = "tmp112-test" |
| sources = [ |
| "tmp112-test.cc", |
| "tmp112.cc", |
| ] |
| deps = [ |
| ":tmp112-bind", |
| "//sdk/fidl/fuchsia.hardware.temperature:fuchsia.hardware.temperature_llcpp", |
| "//src/devices/bus/lib/device-protocol-pdev", |
| "//src/devices/i2c/lib/device-protocol-i2c-channel", |
| "//src/devices/i2c/testing/mock-i2c", |
| "//src/devices/testing/fake_ddk", |
| "//zircon/public/lib/zxtest", |
| ] |
| } |
| |
| unittest_package("tmp112-test-package") { |
| package_name = "tmp112-test" |
| deps = [ ":tmp112-test" ] |
| |
| tests = [ |
| { |
| name = "tmp112-test" |
| environments = basic_envs |
| }, |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":tmp112-bind_test", |
| ":tmp112-test-package", |
| ] |
| } |