| # 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/config.gni") |
| import("//build/package.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/test/test_package.gni") |
| import("//build/testing/environments.gni") |
| |
| rustc_binary("bin") { |
| name = "bt_a2dp_source" |
| edition = "2018" |
| with_unit_tests = true |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.bluetooth:fuchsia.bluetooth-rustc", |
| "//sdk/fidl/fuchsia.bluetooth.avdtp:fuchsia.bluetooth.avdtp-rustc", |
| "//sdk/fidl/fuchsia.bluetooth.bredr:fuchsia.bluetooth.bredr-rustc", |
| "//sdk/fidl/fuchsia.media:fuchsia.media-rustc", |
| "//sdk/fidl/fuchsia.mediacodec:fuchsia.mediacodec-rustc", |
| "//src/connectivity/bluetooth/fidl:component-rustc", |
| "//src/connectivity/bluetooth/lib/async-helpers", |
| "//src/connectivity/bluetooth/lib/bt-a2dp", |
| "//src/connectivity/bluetooth/lib/bt-avdtp", |
| "//src/connectivity/bluetooth/lib/fuchsia-audio-codec", |
| "//src/connectivity/bluetooth/lib/fuchsia-audio-device-output", |
| "//src/connectivity/bluetooth/lib/fuchsia-bluetooth", |
| "//src/lib/diagnostics/inspect/contrib/rust", |
| "//src/lib/diagnostics/inspect/derive", |
| "//src/lib/diagnostics/inspect/rust", |
| "//src/lib/fdio/rust:fdio", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/trace/rust:trace", |
| "//src/lib/trace/rust:trace-provider", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| "//third_party/rust_crates:bitfield", |
| "//third_party/rust_crates:byteorder", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:parking_lot", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| test_deps = [ |
| "//sdk/fidl/fuchsia.bluetooth:fuchsia.bluetooth-rustc", |
| "//src/lib/mundane", |
| "//third_party/rust_crates:hex", |
| "//third_party/rust_crates:matches", |
| ] |
| |
| sources = [ |
| "src/encoding.rs", |
| "src/main.rs", |
| "src/pcm_audio.rs", |
| "src/source_task.rs", |
| "src/sources.rs", |
| ] |
| } |
| |
| package("bt-a2dp-source") { |
| deps = [ ":bin" ] |
| |
| binaries = [ |
| { |
| name = "bt_a2dp_source" |
| }, |
| ] |
| meta = [ |
| { |
| path = rebase_path("meta/bt-a2dp-source.cmx") |
| dest = "bt-a2dp-source.cmx" |
| }, |
| ] |
| } |
| |
| config_data("startup_config") { |
| for_pkg = "sysmgr" |
| outputs = [ "bt-a2dp-startup.config" ] |
| sources = [ "startup.config" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":bt-a2dp-source-encoding-tests", |
| ":bt-a2dp-source-tests", |
| ] |
| } |
| |
| test_package("bt-a2dp-source-tests") { |
| deps = [ ":bin_test" ] |
| |
| tests = [ |
| { |
| name = "bt_a2dp_source_bin_test" |
| dest = "bt-a2dp-source-unittests" |
| environments = basic_envs |
| }, |
| ] |
| } |
| |
| rustc_test("encoding_integration_bin") { |
| name = "bt_a2dp_source_encoding_tests" |
| edition = "2018" |
| source_root = "src/encoding_integration.rs" |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.media:fuchsia.media-rustc", |
| "//sdk/fidl/fuchsia.mediacodec:fuchsia.mediacodec-rustc", |
| "//src/connectivity/bluetooth/lib/bt-a2dp", |
| "//src/connectivity/bluetooth/lib/bt-avdtp", |
| "//src/connectivity/bluetooth/lib/fuchsia-audio-codec", |
| "//src/connectivity/bluetooth/lib/fuchsia-audio-device-output", |
| "//src/connectivity/bluetooth/lib/fuchsia-bluetooth", |
| "//src/lib/diagnostics/inspect/contrib/rust", |
| "//src/lib/diagnostics/inspect/derive", |
| "//src/lib/diagnostics/inspect/rust", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/mundane", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/test_util", |
| "//src/lib/trace/rust:trace", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:bitfield", |
| "//third_party/rust_crates:byteorder", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:hex", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:parking_lot", |
| ] |
| |
| sources = [ |
| "src/encoding.rs", |
| "src/encoding_integration.rs", |
| "src/pcm_audio.rs", |
| "src/source_task.rs", |
| "src/sources.rs", |
| ] |
| } |
| |
| test_package("bt-a2dp-source-encoding-tests") { |
| deps = [ ":encoding_integration_bin" ] |
| |
| tests = [ |
| { |
| name = "bt_a2dp_source_encoding_tests" |
| dest = "bt-a2dp-source-encoding-tests" |
| environments = basic_envs |
| }, |
| ] |
| } |