| # 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") |
| import("//build/test.gni") |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":zxio-standalone-package", |
| ":zxio-unittest-package", |
| ":zxio-vmo-flags-unittest-package", |
| ] |
| } |
| |
| test("zxio") { |
| output_name = "zxio-test" |
| sources = [ |
| "c-compilation-test.c", |
| "constants-test.cc", |
| "create-test.cc", |
| "debuglog-test.cc", |
| "directory-test.cc", |
| "dirent-test.cc", |
| "file-test.cc", |
| "file_test_suite.cc", |
| "file_test_suite.h", |
| "inception-test.cc", |
| "null-test.cc", |
| "pipe-test.cc", |
| "posix-mode-test.cc", |
| "remote-test.cc", |
| "socket-test.cc", |
| "test_directory_server_base.h", |
| "test_file_server_base.h", |
| "test_node_server.h", |
| "test_socket_server.h", |
| "transferable-test.cc", |
| "tty-test.cc", |
| "vmo-test.cc", |
| "watcher-test.cc", |
| "zxio-test.cc", |
| ] |
| deps = [ |
| "//sdk/fidl/fuchsia.boot:fuchsia.boot_cpp", |
| "//sdk/fidl/fuchsia.hardware.pty:fuchsia.hardware.pty_cpp_testing", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_cpp_testing", |
| "//sdk/fidl/fuchsia.posix.socket:fuchsia.posix.socket_cpp_testing", |
| "//sdk/fidl/fuchsia.posix.socket.packet:fuchsia.posix.socket.packet_cpp_testing", |
| "//sdk/fidl/fuchsia.posix.socket.raw:fuchsia.posix.socket.raw_cpp_testing", |
| "//sdk/lib/async-default", |
| "//sdk/lib/async-loop:async-loop-cpp", |
| "//sdk/lib/async-loop:async-loop-default", |
| "//sdk/lib/component/incoming/cpp", |
| "//sdk/lib/fdio", |
| "//sdk/lib/fit", |
| "//sdk/lib/zxio", |
| "//sdk/lib/zxio:create_with_type", |
| "//sdk/lib/zxio:inception", |
| "//zircon/system/ulib/sync", |
| "//zircon/system/ulib/zx", |
| "//zircon/system/ulib/zxtest:zxtest-streams", |
| ] |
| } |
| |
| test("standalone") { |
| sources = [ "standalone_main.c" ] |
| |
| disable_syslog_backend = true |
| |
| deps = [ "//sdk/lib/zxio:standalone" ] |
| configs -= [ "//build/config/fuchsia:fdio_config" ] |
| configs += [ "//build/config/fuchsia:no_cpp_standard_library" ] |
| } |
| |
| rustc_test("zxio_rust_test") { |
| edition = "2021" |
| sources = [ "zxio-test.rs" ] |
| source_root = "zxio-test.rs" |
| deps = [ |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//sdk/rust/zx", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-fs", |
| "//src/starnix/lib/syncio", |
| "//src/storage/fxfs/platform:fxfs-testing", |
| "//src/storage/lib/fsverity-merkle", |
| "//src/storage/lib/vfs/rust:vfs", |
| "//third_party/rust_crates:assert_matches", |
| ] |
| } |
| |
| fuchsia_unittest_component("zxio-test") { |
| manifest = "meta/zxio_test.cml" |
| deps = [ ":zxio" ] |
| } |
| |
| fuchsia_unittest_component("zxio-rust-test") { |
| manifest = "meta/zxio-rust-test.cml" |
| deps = [ ":zxio_rust_test" ] |
| } |
| |
| fuchsia_test_package("zxio-unittest-package") { |
| test_components = [ |
| ":zxio-test", |
| ":zxio-rust-test", |
| ] |
| } |
| |
| fuchsia_unittest_component("zxio-standalone") { |
| deps = [ |
| ":standalone", |
| "//src/sys/testing/elftest", |
| ] |
| } |
| |
| fuchsia_test_package("zxio-standalone-package") { |
| test_components = [ ":zxio-standalone" ] |
| } |
| |
| test("zxio-vmo-flags") { |
| output_name = "zxio-vmo-flags-test" |
| sources = [ "vmo-flags-test.cc" ] |
| deps = [ |
| "//sdk/fidl/fuchsia.io:fuchsia.io_cpp_testing", |
| "//sdk/fidl/fuchsia.kernel:fuchsia.kernel_cpp", |
| "//sdk/lib/component/incoming/cpp", |
| "//sdk/lib/fdio", |
| "//sdk/lib/zxio", |
| "//sdk/lib/zxio:create_with_type", |
| "//zircon/system/ulib/zx", |
| "//zircon/system/ulib/zxtest:zxtest-streams", |
| ] |
| } |
| |
| fuchsia_unittest_component("zxio-vmo-flags-test") { |
| manifest = "meta/zxio-vmo-flags-test.cml" |
| deps = [ ":zxio-vmo-flags" ] |
| test_type = "system" |
| } |
| |
| fuchsia_test_package("zxio-vmo-flags-unittest-package") { |
| test_components = [ ":zxio-vmo-flags-test" ] |
| } |