| # 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/rust/rustc_library.gni") |
| import("//build/test.gni") |
| import("//build/test/test_package.gni") |
| import("//build/testing/environments.gni") |
| |
| group("netemul_empty_binaries") { |
| write_file("$root_out_dir/netstack_no_network_test", "") |
| } |
| |
| executable("netstack_no_network_test_client") { |
| testonly = true |
| |
| sources = [ |
| "netstack_no_network_test_client.cc", |
| ] |
| |
| deps = [ |
| "//garnet/lib/inet", |
| "//third_party/googletest:gtest_main", |
| ] |
| } |
| |
| rustc_library("netstack_fidl_integration") { |
| testonly = true |
| with_unit_tests = true |
| edition = "2018" |
| |
| deps = [ |
| "//garnet/public/lib/fidl/rust/fidl", |
| "//garnet/public/rust/fuchsia-async", |
| "//garnet/public/rust/fuchsia-component", |
| "//garnet/public/rust/fuchsia-zircon", |
| "//sdk/fidl/fuchsia.netstack:fuchsia.netstack-rustc", |
| "//sdk/fidl/fuchsia.sys:fuchsia.sys-rustc", |
| "//src/connectivity/network/testing/netemul/lib/fidl:environment-rustc", |
| "//src/connectivity/network/testing/netemul/lib/fidl:network-rustc", |
| "//src/connectivity/network/testing/netemul/lib/fidl:sandbox-rustc", |
| "//third_party/rust_crates:failure", |
| "//third_party/rust_crates:futures-preview", |
| "//zircon/public/fidl/fuchsia-hardware-ethernet:fuchsia-hardware-ethernet-rustc", |
| "//zircon/public/fidl/fuchsia-net:fuchsia-net-rustc", |
| "//zircon/public/fidl/fuchsia-net-stack:fuchsia-net-stack-rustc", |
| ] |
| } |
| |
| test("netstack_bsdsocket_c_api_test") { |
| if (is_linux || is_fuchsia) { |
| sources = [ |
| "bsdsocket_test.cc", |
| "util.cc", |
| "util.h", |
| ] |
| } |
| |
| deps = [ |
| "//third_party/googletest:gtest_main", |
| ] |
| } |
| |
| test("netstack_fuchsia_c_api_test") { |
| sources = [ |
| "fdio_test.cc", |
| "ioctl_test.cc", |
| "util.cc", |
| "util.h", |
| ] |
| |
| deps = [ |
| "//garnet/public/lib/netstack/c", |
| "//third_party/googletest:gtest_main", |
| "//zircon/public/fidl/fuchsia-net:fuchsia-net_c", |
| "//zircon/public/lib/fdio", |
| "//zircon/public/lib/sync", |
| ] |
| } |
| |
| test_package("netstack_integration_tests") { |
| deps = [ |
| ":netstack_fidl_integration", |
| ] |
| |
| tests = [ |
| { |
| name = "netstack_fidl_integration_lib_test" |
| environments = [ qemu_env ] |
| }, |
| ] |
| } |
| |
| test_package("netstack_c_api_tests") { |
| deps = [ |
| ":netemul_empty_binaries", |
| ":netstack_bsdsocket_c_api_test", |
| ":netstack_fuchsia_c_api_test", |
| ":netstack_no_network_test_client", |
| ] |
| |
| binaries = [ |
| { |
| name = "netstack_no_network_test_client" |
| }, |
| ] |
| |
| meta = [ |
| { |
| path = rebase_path("meta/netstack_no_network_test_client.cmx") |
| dest = "netstack_no_network_test_client.cmx" |
| }, |
| ] |
| |
| tests = [ |
| { |
| name = "netstack_bsdsocket_c_api_test" |
| environments = [ qemu_env ] |
| }, |
| { |
| name = "netstack_fuchsia_c_api_test" |
| environments = [ qemu_env ] |
| }, |
| { |
| name = "netstack_no_network_test" |
| environments = [ qemu_env ] |
| }, |
| ] |
| } |