| # 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. |
| |
| ########################################## |
| # Though under //zircon, this build file # |
| # is meant to be used in the Fuchsia GN # |
| # build. # |
| # See fxbug.dev/36139. # |
| ########################################## |
| |
| assert(!defined(zx) || zx != "/", |
| "This file can only be used in the Fuchsia GN build.") |
| |
| import("//build/fuzzing/fuzzer.gni") |
| import("//build/test.gni") |
| import("//src/sys/build/fuchsia_unittest_package.gni") |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":fs-connection", |
| ":fs-connection-test-pkg", |
| ":fs-fuzzers", |
| ":fs-vnode", |
| ":fs-vnode-test-pkg", |
| ] |
| } |
| |
| test("fs-vnode") { |
| output_name = "fs-vnode-test" |
| if (is_fuchsia) { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| } |
| if (is_fuchsia) { |
| fdio_config = [ "//build/config/fuchsia:fdio_config" ] |
| if (configs + fdio_config - fdio_config != configs) { |
| configs -= fdio_config |
| } |
| } |
| sources = [ |
| "lazy_dir_tests.cc", |
| "pseudo_dir_tests.cc", |
| "pseudo_file_tests.cc", |
| "remote_dir_tests.cc", |
| "remote_file_tests.cc", |
| "service_tests.cc", |
| "teardown_tests.cc", |
| "tracked_remote_dir_tests.cc", |
| "transaction_counting_tests.cc", |
| "vfs_tests.cc", |
| "vfs_types_tests.cc", |
| "vmo_file_tests.cc", |
| "vnode_contract_tests.cc", |
| ] |
| deps = [ |
| "//sdk/fidl/fuchsia.io:fuchsia.io_llcpp", |
| "//sdk/lib/fdio", |
| "//zircon/public/lib/async", |
| "//zircon/public/lib/async-cpp", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/fidl", |
| "//zircon/public/lib/sync", |
| "//zircon/public/lib/zx", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/async-default", |
| "//zircon/system/ulib/async-loop", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/async-testing", |
| "//zircon/system/ulib/fs", |
| "//zircon/system/ulib/trace", |
| "//zircon/system/ulib/trace-engine", |
| ] |
| } |
| |
| test("fs-connection") { |
| output_name = "fs-connection-test" |
| if (is_fuchsia) { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| } |
| if (is_fuchsia) { |
| fdio_config = [ "//build/config/fuchsia:fdio_config" ] |
| if (configs + fdio_config - fdio_config != configs) { |
| configs -= fdio_config |
| } |
| } |
| sources = [ |
| "connection_contract_tests.cc", |
| "connection_integration_tests.cc", |
| "connection_rights_tests.cc", |
| "fidl_transaction_tests.cc", |
| ] |
| deps = [ |
| "//sdk/fidl/fuchsia.io:fuchsia.io_llcpp", |
| "//sdk/lib/fdio", |
| "//zircon/public/lib/async", |
| "//zircon/public/lib/async-cpp", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/fidl", |
| "//zircon/public/lib/sync", |
| "//zircon/public/lib/zx", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/async-default", |
| "//zircon/system/ulib/async-loop", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/fs", |
| ] |
| } |
| |
| fuzzer("vmo_file-fuzzer") { |
| sources = [ "vmo_file-fuzzer.cc" ] |
| deps = [ "//zircon/system/ulib/fs" ] |
| } |
| |
| fuzzers_package("fs-fuzzers") { |
| cpp_fuzzers = [ ":vmo_file-fuzzer" ] |
| } |
| |
| fuchsia_unittest_package("fs-connection-test-pkg") { |
| package_name = "fs-connection-test" |
| executable_path = "test/fs-connection-test" |
| deps = [ ":fs-connection" ] |
| } |
| |
| fuchsia_unittest_package("fs-vnode-test-pkg") { |
| package_name = "fs-vnode-test" |
| executable_path = "test/fs-vnode-test" |
| deps = [ ":fs-vnode" ] |
| } |