| # Copyright 2021 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/fuzz.gni") |
| import("//build/test.gni") |
| |
| driver_bind_rules("goldfish_sensor-bind") { |
| rules = "goldfish_sensor.bind" |
| tests = "bind_tests.json" |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.hardware.goldfish.pipe:fuchsia.hardware.goldfish.pipe_bindlib", |
| "//src/devices/bind/fuchsia.google.platform", |
| ] |
| } |
| |
| common_deps = [ |
| ":goldfish_sensor-bind", |
| "//sdk/fidl/fuchsia.hardware.goldfish:fuchsia.hardware.goldfish_cpp", |
| "//sdk/fidl/fuchsia.hardware.goldfish.pipe:fuchsia.hardware.goldfish.pipe_cpp", |
| "//sdk/fidl/fuchsia.input.report:fuchsia.input.report_cpp", |
| "//sdk/lib/input_report_reader:input_report_reader", |
| "//src/devices/lib/driver", |
| "//src/devices/lib/driver:driver_runtime", |
| "//src/devices/lib/goldfish/pipe_io", |
| "//src/graphics/display/lib/driver-framework-migration-utils/logging:logging-dfv1", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/zircon-internal", |
| "//zircon/system/ulib/zx", |
| ] |
| |
| fuchsia_driver("sensor_fuchsia_driver") { |
| output_name = "goldfish_sensor" |
| |
| configs += [ "//build/config/fuchsia:enable_zircon_asserts" ] |
| configs += [ "//build/config:all_source" ] |
| |
| sources = [ |
| "input_device.cc", |
| "input_device.h", |
| "input_device_dispatcher.cc", |
| "input_device_dispatcher.h", |
| "parser.cc", |
| "parser.h", |
| "root_device.cc", |
| "root_device.h", |
| ] |
| |
| deps = common_deps |
| } |
| |
| fuchsia_driver_component("sensor_driver") { |
| component_name = "goldfish_sensor" |
| deps = [ ":sensor_fuchsia_driver" ] |
| info = "sensor_driver-info.json" |
| manifest = "meta/sensor_driver.cml" |
| } |
| |
| fuchsia_driver_package("goldfish_sensor") { |
| driver_components = [ ":sensor_driver" ] |
| } |
| |
| test("goldfish-sensor-unittest") { |
| output_name = "goldfish-sensor-unittest" |
| sources = [ |
| "input_device.cc", |
| "input_device.h", |
| "input_device_dispatcher.cc", |
| "input_device_dispatcher.h", |
| "parser.cc", |
| "parser.h", |
| "root_device.cc", |
| "root_device.h", |
| "tests/input_device_test.cc", |
| "tests/parser_test.cc", |
| "tests/root_device_test.cc", |
| ] |
| deps = common_deps + [ |
| "//sdk/lib/async_patterns/testing/cpp", |
| "//sdk/lib/component/outgoing/cpp", |
| "//src/devices/testing/fake-bti", |
| "//src/devices/testing/fake-object", |
| "//src/devices/testing/goldfish/fake_pipe", |
| "//src/devices/testing/mock-ddk", |
| "//src/lib/fxl/test:gtest_main", |
| "//third_party/googletest:gtest", |
| "//zircon/system/ulib/async-default", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/mmio-ptr:mmio-ptr-fake", |
| "//zircon/system/ulib/sync", |
| "//zircon/system/ulib/zircon-internal", |
| "//zircon/system/ulib/zx", |
| ] |
| |
| configs += [ "//build/config:all_source" ] |
| } |
| |
| fuchsia_library_fuzzer("goldfish-sensor-parser-fuzzer") { |
| sources = [ |
| "parser.cc", |
| "parser.h", |
| "tests/parser_fuzztest.cc", |
| ] |
| deps = [ |
| "//src/ui/input/lib/hid-parser", |
| "//zircon/system/ulib/fbl", |
| ] |
| } |
| |
| fuchsia_fuzzer_component("goldfish-sensor-parser-fuzzer-component") { |
| manifest = "meta/goldfish-sensor-parser-fuzzer.cml" |
| deps = [ ":goldfish-sensor-parser-fuzzer" ] |
| } |
| |
| fuchsia_fuzzer_package("goldfish-sensor-parser-fuzzer-package") { |
| package_name = "goldfish-sensor-parser-fuzzer" |
| |
| cpp_fuzzer_components = [ ":goldfish-sensor-parser-fuzzer-component" ] |
| } |
| |
| fuchsia_unittest_package("goldfish-sensor-test-package") { |
| package_name = "goldfish-sensor-test" |
| deps = [ ":goldfish-sensor-unittest" ] |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":goldfish-sensor-parser-fuzzer-package", |
| ":goldfish-sensor-test-package", |
| ":goldfish_sensor-bind_test", |
| ] |
| } |