| # Copyright 2019 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("tcs3400_light_bind") { |
| rules = "meta/tcs3400_light.bind" |
| bind_output = "ams-light.bindbc" |
| tests = "meta/bind_tests.json" |
| deps = [ |
| "//sdk/fidl/fuchsia.hardware.gpio:fuchsia.hardware.gpio_bindlib", |
| "//sdk/fidl/fuchsia.hardware.i2c:fuchsia.hardware.i2c_bindlib", |
| "//src/devices/bind/fuchsia.gpio", |
| "//src/devices/bind/fuchsia.platform", |
| ] |
| } |
| |
| fuchsia_cc_driver("ams-light-driver") { |
| output_name = "ams-light" |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| sources = [ "tcs3400.cc" ] |
| deps = [ |
| ":tcs3400_light_bind", |
| "//sdk/fidl/fuchsia.hardware.gpio:fuchsia.hardware.gpio_cpp", |
| "//sdk/fidl/fuchsia.input.report:fuchsia.input.report_cpp", |
| "//sdk/lib/async-loop:async-loop-cpp", |
| "//sdk/lib/async-loop:async-loop-default", |
| "//sdk/lib/input_report_reader", |
| "//sdk/lib/inspect/contrib/cpp:bounded_list_node", |
| "//src/devices/i2c/lib/device-protocol-i2c-channel", |
| "//src/devices/lib/driver", |
| "//src/devices/lib/driver:driver_runtime", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/inspect", |
| "//zircon/system/ulib/sync", |
| "//zircon/system/ulib/zircon-internal", |
| "//zircon/system/ulib/zx", |
| ] |
| } |
| |
| fuchsia_driver_component("ams-light") { |
| component_name = "ams-light" |
| deps = [ ":ams-light-driver" ] |
| info = "meta/ams-light-info.json" |
| manifest = "meta/ams-light.cml" |
| } |
| |
| fuchsia_driver_package("package") { |
| package_name = "ams-light" |
| driver_components = [ ":ams-light" ] |
| } |
| |
| test("ams-light-test-bin") { |
| configs += [ "//build/config:all_source" ] |
| output_name = "ams-light-test" |
| sources = [ |
| "tcs3400-test.cc", |
| "tcs3400.cc", |
| ] |
| deps = [ |
| ":tcs3400_light_bind", |
| "//sdk/fidl/fuchsia.hardware.gpio:fuchsia.hardware.gpio_cpp", |
| "//sdk/fidl/fuchsia.hardware.i2c:fuchsia.hardware.i2c_cpp", |
| "//sdk/fidl/fuchsia.input.report:fuchsia.input.report_cpp", |
| "//sdk/lib/async-default", |
| "//sdk/lib/async-loop:async-loop-cpp", |
| "//sdk/lib/async-loop:async-loop-default", |
| "//sdk/lib/async_patterns/testing/cpp", |
| "//sdk/lib/component/outgoing/cpp", |
| "//sdk/lib/driver/runtime/testing/cpp", |
| "//sdk/lib/input_report_reader", |
| "//sdk/lib/inspect/contrib/cpp:bounded_list_node", |
| "//sdk/lib/inspect/testing/cpp:zxtest", |
| "//src/devices/gpio/testing/fake-gpio", |
| "//src/devices/i2c/lib/device-protocol-i2c-channel", |
| "//src/devices/i2c/testing/fake-i2c", |
| "//src/devices/i2c/testing/mock-i2c", |
| "//src/devices/lib/mmio", |
| "//src/devices/testing/mock-ddk", |
| "//src/lib/ddktl", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/inspect", |
| "//zircon/system/ulib/mock-function", |
| "//zircon/system/ulib/sync", |
| "//zircon/system/ulib/zircon-internal", |
| "//zircon/system/ulib/zx", |
| "//zircon/system/ulib/zxtest", |
| ] |
| } |
| |
| fuchsia_unittest_package("ams-light-test") { |
| deps = [ ":ams-light-test-bin" ] |
| test_specs = { |
| environments = basic_envs |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":ams-light-test", |
| ":tcs3400_light_bind_test", |
| ] |
| } |