blob: b23a90c173f4e462c5a17816b0da41b8e7688038 [file] [log] [blame]
# 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/components.gni")
group("test_utils") {
public_deps = [
":button_checker",
":ddk_mock_operators",
":fake_buffer_collection",
]
public_configs = [ ":test_utils_config" ]
}
group("tests") {
testonly = true
deps = [
":button_checker_unittest",
":fake_buffer_collection_unittest",
]
}
config("test_utils_config") {
visibility = [ ":*" ]
include_dirs = [ "." ]
}
source_set("fake_buffer_collection") {
visibility = [ ":*" ]
sources = [
"fake_buffer_collection.cc",
"fake_buffer_collection.h",
]
deps = [ "//zircon/system/ulib/fbl" ]
public_deps = [
"//sdk/banjo/fuchsia.sysmem:fuchsia.sysmem_banjo_c",
"//sdk/lib/syslog/cpp",
"//src/devices/lib/sysmem",
"//src/lib/ddk",
"//src/lib/ddktl",
"//zircon/system/ulib/image-format",
"//zircon/system/ulib/sync",
"//zircon/system/ulib/zircon-internal",
"//zircon/third_party/ulib/safemath",
]
# TODO(fxbug.dev/95833): This target uses the deprecated C bindings.
# Consider switching to the C++ bindings. See linked bug for details.
configs += [ "//build/c:fidl-deprecated-c-bindings" ]
}
source_set("button_checker") {
visibility = [ ":*" ]
sources = [
"button_checker.cc",
"button_checker.h",
]
deps = [
"//sdk/lib/fdio",
"//sdk/lib/syslog/cpp",
"//zircon/system/ulib/fbl",
]
public_deps = [
"//sdk/fidl/fuchsia.hardware.input:fuchsia.hardware.input_hlcpp",
"//zircon/system/ulib/hid",
"//zircon/system/ulib/hid-parser",
]
}
source_set("ddk_mock_operators") {
visibility = [ ":*" ]
sources = [ "ddk_mock_operators.h" ]
public_deps = [ "//sdk/banjo/fuchsia.hardware.camera.sensor:fuchsia.hardware.camera.sensor_banjo_cpp" ]
}
executable("fake_buffer_collection_unittest_bin") {
testonly = true
sources = [ "fake_buffer_collection_unittest.cc" ]
deps = [
":fake_buffer_collection",
"//sdk/banjo/fuchsia.sysmem:fuchsia.sysmem_banjo_c",
"//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem_c",
"//sdk/lib/fdio",
"//sdk/lib/fit",
"//src/devices/lib/mmio",
"//src/devices/testing/fake-bti",
"//src/lib/ddk",
"//src/lib/fxl/test:gtest_main",
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/hwreg",
"//zircon/system/ulib/zx",
]
# TODO(fxbug.dev/95833): This target uses the deprecated C bindings.
# Consider switching to the C++ bindings. See linked bug for details.
configs += [ "//build/c:fidl-deprecated-c-bindings" ]
}
executable("button_checker_unittest_bin") {
testonly = true
sources = [ "button_checker_unittest.cc" ]
deps = [
":button_checker",
"//src/lib/fxl/test:gtest_main",
]
}
fuchsia_unittest_package("fake_buffer_collection_unittest") {
deps = [ ":fake_buffer_collection_unittest_bin" ]
}
fuchsia_unittest_package("button_checker_unittest") {
manifest = "meta/button_checker_unittest.cml"
deps = [ ":button_checker_unittest_bin" ]
test_specs = {
environments = [
astro_env,
sherlock_env,
]
}
}