| # 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/components.gni") |
| import("//build/product.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/rust/rustc_library.gni") |
| import("//build/testing/environments.gni") |
| import("//build/testing/host_test.gni") |
| |
| fuchsia_unittest_package("fuchsia-async-tests") { |
| manifest = "meta/fuchsia_async_lib_test.cml" |
| deps = [ |
| ":fuchsia-async_test", |
| "//src/connectivity/network:netstack-for-tests", |
| ] |
| test_specs = { |
| environments = [ emu_env ] |
| } |
| |
| if (current_cpu == "riscv64") { |
| # TODO(https://fxbug.dev/299143724): Make this target depend on netstack3 on RISC-V |
| # and remove these lines. |
| test_specs = { |
| } |
| test_specs = { |
| environments = [] |
| } |
| } |
| } |
| |
| if (is_host) { |
| rustc_binary("fuchsia-async-shutdown-test-bin") { |
| edition = "2021" |
| with_unit_tests = false |
| deps = [ |
| ":fuchsia-async", |
| "//sdk/rust/zx-status", |
| "//third_party/rust_crates:futures", |
| ] |
| source_root = "src/handle/emulated/shutdown_test.rs" |
| sources = [ "src/handle/emulated/shutdown_test.rs" ] |
| } |
| |
| host_test("fuchsia-async-shutdown-test") { |
| binary_path = "$root_out_dir/fuchsia-async-shutdown-test-bin" |
| deps = [ ":fuchsia-async-shutdown-test-bin" ] |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":fuchsia-async-shutdown-test($host_toolchain)", |
| ":fuchsia-async-tests", |
| ":fuchsia-async_test($host_toolchain)", |
| ] |
| } |
| |
| ## BAZEL2GN SENTINEL - DO NOT EDIT BELOW THIS LINE ## |
| # |
| # ________ _________ ________ ________ |
| # |\ ____\|\___ ___\\ __ \|\ __ \ |
| # \ \ \___|\|___ \ \_\ \ \|\ \ \ \|\ \ |
| # \ \_____ \ \ \ \ \ \ \\\ \ \ ____\ |
| # \|____|\ \ \ \ \ \ \ \\\ \ \ \___| |
| # ____\_\ \ \ \__\ \ \_______\ \__\ |
| # |\_________\ \|__| \|_______|\|__| |
| # \|_________| |
| # |
| # |
| # AUTO-GENERATED - DO NOT EDIT |
| # |
| # The targets below are auto-generated based on the targets defined in the |
| # BUILD.bazel file from the same directory. If you made changes to targets in |
| # Bazel, instead of editing this file manually, run: |
| # |
| # > fx bazel2gn |
| # |
| # Please do NOT edit this file directly. Instead, edit the BUILD.bazel file and |
| # rerun bazel2gn. |
| |
| import("//build/tools/bazel2gn/bazel_migration.gni") |
| |
| # A self-verification target for generated content in this file. |
| if (is_host) { |
| verify_bazel2gn("verify_bazel2gn") { |
| } |
| } |
| |
| rustc_library("fuchsia-async") { |
| sources = [] |
| sources += [ |
| "src/condition.rs", |
| "src/handle/mod.rs", |
| "src/lib.rs", |
| "src/net/mod.rs", |
| "src/runtime/instrument.rs", |
| "src/runtime/mod.rs", |
| "src/runtime/scope.rs", |
| "src/runtime/task_group.rs", |
| "src/test_support.rs", |
| ] |
| if (is_fuchsia) { |
| sources += [ |
| "src/handle/zircon/channel.rs", |
| "src/handle/zircon/fifo.rs", |
| "src/handle/zircon/mod.rs", |
| "src/handle/zircon/on_interrupt.rs", |
| "src/handle/zircon/on_signals.rs", |
| "src/handle/zircon/rwhandle.rs", |
| "src/handle/zircon/socket.rs", |
| "src/net/fuchsia/mod.rs", |
| "src/net/fuchsia/tcp.rs", |
| "src/net/fuchsia/udp.rs", |
| "src/runtime/fuchsia/executor/atomic_future.rs", |
| "src/runtime/fuchsia/executor/atomic_future/hooks.rs", |
| "src/runtime/fuchsia/executor/atomic_future/spawnable_future.rs", |
| "src/runtime/fuchsia/executor/common.rs", |
| "src/runtime/fuchsia/executor/local.rs", |
| "src/runtime/fuchsia/executor/mod.rs", |
| "src/runtime/fuchsia/executor/packets.rs", |
| "src/runtime/fuchsia/executor/scope.rs", |
| "src/runtime/fuchsia/executor/send.rs", |
| "src/runtime/fuchsia/executor/time.rs", |
| "src/runtime/fuchsia/mod.rs", |
| "src/runtime/fuchsia/task.rs", |
| "src/runtime/fuchsia/timer.rs", |
| ] |
| } else { |
| sources += [ |
| "src/handle/emulated/channel.rs", |
| "src/handle/emulated/mod.rs", |
| "src/handle/emulated/socket.rs", |
| "src/net/portable/mod.rs", |
| "src/net/portable/udp.rs", |
| "src/runtime/portable.rs", |
| "src/runtime/portable/scope.rs", |
| ] |
| } |
| edition = "2021" |
| proc_macro_deps = [ "//src/lib/fuchsia-async-macro" ] |
| test_deps = [] |
| test_deps += [ |
| "//third_party/rust_crates:assert_matches", |
| "//third_party/rust_crates:futures-test", |
| ] |
| if (is_fuchsia) { |
| test_deps += [ "//third_party/rust_crates:rand" ] |
| } else { |
| test_deps += [] |
| } |
| with_unit_tests = true |
| deps = [] |
| deps += [ |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:pin-project-lite", |
| ] |
| if (is_fuchsia) { |
| deps += [ |
| "//sdk/lib/fdio", |
| "//sdk/rust/zx", |
| "//src/lib/fuchsia-sync", |
| "//third_party/rust_crates:crossbeam", |
| "//third_party/rust_crates:libc", |
| "//third_party/rust_crates:rustc-hash", |
| "//third_party/rust_crates:socket2", |
| "//third_party/rust_crates:zerocopy", |
| ] |
| } else { |
| deps += [ |
| "//sdk/rust/zx-status", |
| "//sdk/rust/zx-types", |
| "//third_party/rust_crates:bitflags", |
| "//third_party/rust_crates:futures-lite", |
| "//third_party/rust_crates:lazy_static", |
| "//third_party/rust_crates:tokio", |
| ] |
| } |
| } |