| # Copyright 2018 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/rust/rustc_library.gni") |
| import("//build/test/test_package.gni") |
| import("//build/testing/environments.gni") |
| |
| rustc_library("lib") { |
| name = "sl4f_lib" |
| with_unit_tests = true |
| edition = "2018" |
| |
| # Only for internal use. |
| visibility = [ |
| ":*", |
| "tests/*", |
| ] |
| |
| deps = [ |
| "//garnet/lib/rust/connectivity-testing", |
| "//garnet/lib/rust/fidl_fuchsia_hardware_ethernet_ext", |
| "//garnet/lib/rust/files_async", |
| "//garnet/lib/rust/io_util", |
| "//sdk/fidl/fuchsia.auth:fuchsia.auth-rustc", |
| "//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.bluetooth.control:fuchsia.bluetooth.control-rustc", |
| "//sdk/fidl/fuchsia.bluetooth.gatt:fuchsia.bluetooth.gatt-rustc", |
| "//sdk/fidl/fuchsia.bluetooth.le:fuchsia.bluetooth.le-rustc", |
| "//sdk/fidl/fuchsia.camera2:fuchsia.camera2-rustc", |
| "//sdk/fidl/fuchsia.developer.tiles:fuchsia.developer.tiles-rustc", |
| "//sdk/fidl/fuchsia.factory:fuchsia.factory-rustc", |
| "//sdk/fidl/fuchsia.factory.camera:fuchsia.factory.camera-rustc", |
| "//sdk/fidl/fuchsia.hardware.ethernet:fuchsia.hardware.ethernet-rustc", |
| "//sdk/fidl/fuchsia.hardware.power.statecontrol:fuchsia.hardware.power.statecontrol-rustc", |
| "//sdk/fidl/fuchsia.hwinfo:fuchsia.hwinfo-rustc", |
| "//sdk/fidl/fuchsia.images:fuchsia.images-rustc", |
| "//sdk/fidl/fuchsia.intl:fuchsia.intl-rustc", |
| "//sdk/fidl/fuchsia.location.namedplace:fuchsia.location.namedplace-rustc", |
| "//sdk/fidl/fuchsia.media:fuchsia.media-rustc", |
| "//sdk/fidl/fuchsia.modular:fuchsia.modular-rustc", |
| "//sdk/fidl/fuchsia.modular.internal:fuchsia.modular.internal-rustc", |
| "//sdk/fidl/fuchsia.net.stack:fuchsia.net.stack-rustc", |
| "//sdk/fidl/fuchsia.netstack:fuchsia.netstack-rustc", |
| "//sdk/fidl/fuchsia.paver:fuchsia.paver-rustc", |
| "//sdk/fidl/fuchsia.power:fuchsia.power-rustc", |
| "//sdk/fidl/fuchsia.power:fuchsia.power.test-rustc", |
| "//sdk/fidl/fuchsia.settings:fuchsia.settings-rustc", |
| "//sdk/fidl/fuchsia.setui:fuchsia.setui-rustc", |
| "//sdk/fidl/fuchsia.sys:fuchsia.sys-rustc", |
| "//sdk/fidl/fuchsia.test.manager:fuchsia.test.manager-rustc", |
| "//sdk/fidl/fuchsia.tracing.controller:fuchsia.tracing.controller-rustc", |
| "//sdk/fidl/fuchsia.ui.app:fuchsia.ui.app-rustc", |
| "//sdk/fidl/fuchsia.ui.policy:fuchsia.ui.policy-rustc", |
| "//sdk/fidl/fuchsia.ui.scenic:fuchsia.ui.scenic-rustc", |
| "//sdk/fidl/fuchsia.update:fuchsia.update-rustc", |
| "//sdk/fidl/fuchsia.update.channelcontrol:fuchsia.update.channelcontrol-rustc", |
| "//sdk/fidl/fuchsia.virtualaudio:fuchsia.virtualaudio-rustc", |
| "//sdk/fidl/fuchsia.weave:fuchsia.weave-rustc", |
| "//sdk/fidl/fuchsia.web:fuchsia.web-rustc", |
| "//sdk/fidl/fuchsia.wlan.common:fuchsia.wlan.common-rustc", |
| "//sdk/fidl/fuchsia.wlan.device:fuchsia.wlan.device-rustc", |
| "//sdk/fidl/fuchsia.wlan.device.service:fuchsia.wlan.device.service-rustc", |
| "//sdk/fidl/fuchsia.wlan.policy:fuchsia.wlan.policy-rustc", |
| "//sdk/fidl/fuchsia.wlan.sme:fuchsia.wlan.sme-rustc", |
| "//src/connectivity/bluetooth/lib/bt-avdtp", |
| "//src/connectivity/bluetooth/lib/fuchsia-bluetooth", |
| "//src/lib/fdio/rust:fdio", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/inspect/rust/fuchsia-inspect", |
| "//src/lib/inspect/rust/fuchsia-inspect-node-hierarchy", |
| "//src/lib/mapped-vmo", |
| "//src/lib/storage/fuchsia-vfs-watcher", |
| "//src/lib/storage/pseudo-fs", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/test_executor/rust:test_executor", |
| "//src/lib/ui/fuchsia-scenic", |
| "//src/lib/ui/input-synthesis", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:base64", |
| "//third_party/rust_crates:byteorder", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:glob", |
| "//third_party/rust_crates:hex", |
| "//third_party/rust_crates:maplit", |
| "//third_party/rust_crates:matches", |
| "//third_party/rust_crates:parking_lot", |
| "//third_party/rust_crates:rand", |
| "//third_party/rust_crates:regex", |
| "//third_party/rust_crates:rouille", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:slab", |
| "//third_party/rust_crates:tempfile", |
| "//third_party/rust_crates:thiserror", |
| "//third_party/rust_crates:uuid", |
| "//third_party/rust_crates:void", |
| "//zircon/system/fidl/fuchsia-device:fuchsia-device-rustc", |
| "//zircon/system/fidl/fuchsia-io:fuchsia-io-rustc", |
| "//zircon/system/fidl/fuchsia-mem:fuchsia-mem-rustc", |
| "//zircon/system/fidl/fuchsia-net:fuchsia-net-rustc", |
| ] |
| |
| test_deps = [ |
| "//src/lib/fuchsia-async", |
| "//src/lib/storage/pseudo-fs", |
| "//third_party/rust_crates:lazy_static", |
| "//third_party/rust_crates:maplit", |
| ] |
| } |
| |
| rustc_binary("bin") { |
| name = "sl4f" |
| with_unit_tests = true |
| edition = "2018" |
| |
| deps = [ |
| ":lib", |
| "//src/lib/fuchsia-async", |
| "//src/lib/syslog/rust:syslog", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:parking_lot", |
| "//third_party/rust_crates:rouille", |
| "//third_party/rust_crates:thiserror", |
| ] |
| } |
| |
| package("sl4f") { |
| meta = [ |
| { |
| path = "meta/sl4f.cmx" |
| dest = "sl4f.cmx" |
| }, |
| ] |
| |
| deps = [ ":bin" ] |
| |
| binary = "sl4f" |
| } |
| |
| test_package("sl4f-service-tests") { |
| deps = [ ":lib_test" ] |
| |
| resources = [ |
| { |
| path = rebase_path("testdata/cast_factory_store.config") |
| dest = "cast_factory_store.config" |
| }, |
| { |
| path = rebase_path("testdata/misc_factory_store.config") |
| dest = "misc_factory_store.config" |
| }, |
| { |
| path = rebase_path("testdata/playready_factory_store.config") |
| dest = "playready_factory_store.config" |
| }, |
| { |
| path = rebase_path("testdata/weave_factory_store.config") |
| dest = "weave_factory_store.config" |
| }, |
| { |
| path = rebase_path("testdata/widevine_factory_store.config") |
| dest = "widevine_factory_store.config" |
| }, |
| ] |
| |
| tests = [ |
| { |
| name = "sl4f_lib_lib_test" |
| environments = basic_envs |
| }, |
| ] |
| } |
| |
| config_data("fake-factory-store-providers-config") { |
| for_pkg = "fake_factory_store_providers" |
| sources = [ |
| "testdata/cast_factory_store.config", |
| "testdata/misc_factory_store.config", |
| "testdata/playready_factory_store.config", |
| "testdata/weave_factory_store.config", |
| "testdata/widevine_factory_store.config", |
| ] |
| } |
| |
| unittest_package("sl4f-tests") { |
| deps = [ ":bin_test" ] |
| |
| tests = [ |
| { |
| name = "sl4f_bin_test" |
| dest = "sl4f_bin_test" |
| environments = basic_envs |
| }, |
| ] |
| } |
| |
| group("service-tests") { |
| testonly = true |
| deps = [ |
| ":fake-factory-store-providers-config", |
| ":sl4f-service-tests", |
| "//src/factory/fake_factory_store_providers", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":service-tests", |
| ":sl4f-tests", |
| "tests", |
| ] |
| } |
| |
| config_data("sl4f_sysmgr_config") { |
| for_pkg = "sysmgr" |
| outputs = [ "sl4f.config" ] |
| sources = [ "config/sl4f_sysmgr.config" ] |
| } |