blob: d4cdec65042b889bbe62b42c9aa0ce1739e77eb5 [file] [log] [blame]
# Copyright 2020 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/test.gni")
import("//src/sys/build/fuchsia_component.gni")
import("//src/sys/build/fuchsia_test_package.gni")
group("tests") {
testonly = true
deps = [
":fs-tests",
":large-fs-tests",
"//src/lib/isolated_devmgr/v2_component",
]
}
static_library("fs_test") {
testonly = true
sources = [
"fs_test.cc",
"fs_test_fixture.cc",
"misc.cc",
]
deps = [
"//sdk/fidl/fuchsia.fs",
"//sdk/fidl/fuchsia.io:fuchsia.io_llcpp",
"//sdk/lib/fdio",
"//sdk/lib/sys/cpp",
"//src/storage/fuchsia-fatfs:fatfs",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/block-client",
"//zircon/system/ulib/fdio-caller",
"//zircon/system/ulib/fvm",
"//zircon/system/ulib/memfs",
]
public_deps = [
# fs_test.h:
"//src/lib/isolated_devmgr/v2_component:client",
"//src/storage/blobfs",
"//src/storage/minfs",
"//third_party/googletest:gtest",
"//zircon/public/lib/fbl",
"//zircon/public/lib/zx",
"//zircon/public/lib/zxc",
"//zircon/system/ulib/fs-management",
]
}
test("access_tests") {
sources = [ "access.cc" ]
deps = [
":fs_test",
"//sdk/fidl/fuchsia.io:fuchsia.io_llcpp",
"//src/lib/fxl/test:gtest_main",
"//zircon/system/ulib/fdio-caller",
]
}
fuchsia_component("access-tests") {
testonly = true
manifest = "$target_gen_dir/access-tests.cml"
deps = [
":access_tests",
":manifests",
]
}
test("append_tests") {
sources = [ "append.cc" ]
deps = [
":fs_test",
"//src/lib/fxl/test:gtest_main",
"//zircon/public/lib/fbl",
]
}
fuchsia_component("append-tests") {
testonly = true
manifest = "$target_gen_dir/append-tests.cml"
deps = [
":append_tests",
":manifests",
]
}
test("attr_tests") {
sources = [ "attr.cc" ]
deps = [
":fs_test",
"//src/lib/fxl/test:gtest_main",
"//zircon/public/lib/fbl",
]
}
fuchsia_component("attr-tests") {
testonly = true
manifest = "$target_gen_dir/attr-tests.cml"
deps = [
":attr_tests",
":manifests",
]
}
test("basic_tests") {
sources = [ "basic.cc" ]
deps = [
":fs_test",
"//src/lib/fxl/test:gtest_main",
]
}
fuchsia_component("basic-tests") {
testonly = true
manifest = "$target_gen_dir/basic-tests.cml"
deps = [
":basic_tests",
":manifests",
]
}
test("case_sensitivity_tests") {
sources = [ "case_sensitivity.cc" ]
deps = [
":fs_test",
"//src/lib/fxl/test:gtest_main",
]
}
fuchsia_component("case-sensitivity-tests") {
testonly = true
manifest = "$target_gen_dir/case-sensitivity-tests.cml"
deps = [
":case_sensitivity_tests",
":manifests",
]
}
test("clone_tests") {
sources = [ "clone.cc" ]
deps = [
":fs_test",
"//src/lib/fxl/test:gtest_main",
"//zircon/public/lib/fbl",
]
}
fuchsia_component("clone-tests") {
testonly = true
manifest = "$target_gen_dir/clone-tests.cml"
deps = [
":clone_tests",
":manifests",
]
}
test("corrupt_tests") {
sources = [ "corrupt.cc" ]
deps = [
":fs_test",
"//sdk/fidl/fuchsia.device:fuchsia.device_llcpp",
"//src/lib/fxl/test:gtest_main",
"//zircon/public/lib/fbl",
]
}
fuchsia_component("corrupt-tests") {
testonly = true
manifest = "$target_gen_dir/corrupt-tests.cml"
deps = [
":corrupt_tests",
":manifests",
]
}
test("directory_tests") {
sources = [ "directory.cc" ]
deps = [
":fs_test",
"//src/lib/fxl/test:gtest_main",
"//zircon/public/lib/fbl",
]
}
fuchsia_component("directory-tests") {
testonly = true
manifest = "$target_gen_dir/directory-tests.cml"
deps = [
":directory_tests",
":manifests",
]
}
test("dot_dot_tests") {
sources = [ "dot_dot.cc" ]
deps = [
":fs_test",
"//sdk/fidl/fuchsia.io:fuchsia.io_llcpp",
"//src/lib/fxl/test:gtest_main",
"//zircon/public/lib/zx",
"//zircon/system/ulib/fdio-caller",
]
}
fuchsia_component("dot-dot-tests") {
testonly = true
manifest = "$target_gen_dir/dot-dot-tests.cml"
deps = [
":dot_dot_tests",
":manifests",
]
}
test("fcntl_tests") {
sources = [ "fcntl.cc" ]
deps = [
":fs_test",
"//src/lib/fxl/test:gtest_main",
"//zircon/public/lib/fbl",
]
}
fuchsia_component("fcntl-tests") {
testonly = true
manifest = "$target_gen_dir/fcntl-tests.cml"
deps = [
":fcntl_tests",
":manifests",
]
}
test("filename_tests") {
sources = [ "filename.cc" ]
deps = [
":fs_test",
"//src/lib/fxl/test:gtest_main",
"//zircon/public/lib/fbl",
]
}
fuchsia_component("filename-tests") {
testonly = true
manifest = "$target_gen_dir/filename-tests.cml"
deps = [
":filename_tests",
":manifests",
]
}
test("link_tests") {
sources = [ "link.cc" ]
deps = [
":fs_test",
"//src/lib/fxl/test:gtest_main",
"//zircon/public/lib/fbl",
]
}
fuchsia_component("link-tests") {
testonly = true
manifest = "$target_gen_dir/link-tests.cml"
deps = [
":link_tests",
":manifests",
]
}
test("lseek_tests") {
sources = [ "lseek.cc" ]
deps = [
":fs_test",
"//src/lib/fxl/test:gtest_main",
"//zircon/public/lib/fbl",
]
}
fuchsia_component("lseek-tests") {
testonly = true
manifest = "$target_gen_dir/lseek-tests.cml"
deps = [
":lseek_tests",
":manifests",
]
}
test("minfs_tests") {
sources = [ "minfs.cc" ]
deps = [
":fs_test",
"//sdk/fidl/fuchsia.io:fuchsia.io_llcpp",
"//sdk/fidl/fuchsia.minfs:fuchsia.minfs_c",
"//sdk/lib/fdio",
"//src/lib/fxl/test:gtest_main",
"//src/storage/minfs",
"//third_party/googletest:gmock",
"//zircon/system/ulib/fdio-caller",
"//zircon/system/ulib/fvm",
]
}
fuchsia_component("minfs-tests") {
testonly = true
manifest = "$target_gen_dir/minfs-tests.cml"
deps = [
":manifests",
":minfs_tests",
]
}
test("mmap_tests") {
sources = [ "mmap.cc" ]
deps = [
":fs_test",
"//src/lib/fxl/test:gtest_main",
"//third_party/googletest:gmock",
"//zircon/public/lib/fbl",
]
}
fuchsia_component("mmap-tests") {
testonly = true
manifest = "$target_gen_dir/mmap-tests.cml"
deps = [
":manifests",
":mmap_tests",
]
}
test("overflow_tests") {
sources = [ "overflow.cc" ]
deps = [
":fs_test",
"//src/lib/fxl/test:gtest_main",
]
}
fuchsia_component("overflow-tests") {
testonly = true
manifest = "$target_gen_dir/overflow-tests.cml"
deps = [
":manifests",
":overflow_tests",
]
}
test("persist_tests") {
sources = [ "persist.cc" ]
deps = [
":fs_test",
"//src/lib/fxl/test:gtest_main",
"//zircon/public/lib/fbl",
]
}
fuchsia_component("persist-tests") {
testonly = true
manifest = "$target_gen_dir/persist-tests.cml"
deps = [
":manifests",
":persist_tests",
]
}
test("random_op_tests") {
sources = [ "random_op.cc" ]
deps = [
":fs_test",
"//src/lib/fxl/test:gtest_main",
"//zircon/public/lib/fbl",
]
}
fuchsia_component("random-op-tests") {
testonly = true
manifest = "$target_gen_dir/random-op-tests.cml"
deps = [
":manifests",
":random_op_tests",
]
}
test("realpath_tests") {
sources = [ "realpath.cc" ]
deps = [
":fs_test",
"//src/lib/fxl/test:gtest_main",
"//zircon/public/lib/fbl",
]
}
fuchsia_component("realpath-tests") {
testonly = true
manifest = "$target_gen_dir/realpath-tests.cml"
deps = [
":manifests",
":realpath_tests",
]
}
test("rename_tests") {
sources = [ "rename.cc" ]
deps = [
":fs_test",
"//sdk/fidl/fuchsia.io:fuchsia.io_llcpp",
"//src/lib/fxl/test:gtest_main",
"//zircon/public/lib/fbl",
"//zircon/system/ulib/fdio-caller",
]
}
fuchsia_component("rename-tests") {
testonly = true
manifest = "$target_gen_dir/rename-tests.cml"
deps = [
":manifests",
":rename_tests",
]
}
test("resize_tests") {
sources = [ "resize.cc" ]
deps = [
":fs_test",
"//sdk/fidl/fuchsia.io:fuchsia.io_llcpp",
"//src/lib/fxl/test:gtest_main",
"//src/storage/minfs",
"//zircon/public/lib/fbl",
"//zircon/system/ulib/fdio-caller",
"//zircon/system/ulib/fvm",
]
}
fuchsia_component("resize-tests") {
testonly = true
manifest = "$target_gen_dir/resize-tests.cml"
deps = [
":manifests",
":resize_tests",
]
}
test("rw_tests") {
sources = [ "rw.cc" ]
deps = [
":fs_test",
"//src/lib/fxl/test:gtest_main",
"//zircon/public/lib/fbl",
]
}
fuchsia_component("rw-tests") {
testonly = true
manifest = "$target_gen_dir/rw-tests.cml"
deps = [
":manifests",
":rw_tests",
]
}
test("rw_workers_tests") {
sources = [ "rw_workers.cc" ]
deps = [
":fs_test",
"//src/lib/fxl/test:gtest_main",
"//zircon/public/lib/fbl",
]
}
fuchsia_component("rw-workers-tests") {
testonly = true
manifest = "$target_gen_dir/rw-workers-tests.cml"
deps = [
":manifests",
":rw_workers_tests",
]
}
test("sparse_tests") {
sources = [ "sparse.cc" ]
deps = [
":fs_test",
"//src/lib/fxl/test:gtest_main",
"//zircon/public/lib/fbl",
]
}
fuchsia_component("sparse-tests") {
testonly = true
manifest = "$target_gen_dir/sparse-tests.cml"
deps = [
":manifests",
":sparse_tests",
]
}
test("sync_tests") {
sources = [ "sync.cc" ]
deps = [
":fs_test",
"//src/lib/fxl/test:gtest_main",
"//zircon/public/lib/fbl",
]
}
fuchsia_component("sync-tests") {
testonly = true
manifest = "$target_gen_dir/sync-tests.cml"
deps = [
":manifests",
":sync_tests",
]
}
test("threading_tests") {
sources = [ "threading.cc" ]
deps = [
":fs_test",
"//src/lib/fxl/test:gtest_main",
"//zircon/public/lib/fbl",
]
}
fuchsia_component("threading-tests") {
testonly = true
manifest = "$target_gen_dir/threading-tests.cml"
deps = [
":manifests",
":threading_tests",
]
}
test("truncate_tests") {
sources = [
"truncate.cc",
"truncate_fixture.cc",
]
deps = [
":fs_test",
"//src/lib/fxl/test:gtest_main",
"//zircon/public/lib/fbl",
]
}
fuchsia_component("truncate-tests") {
testonly = true
manifest = "$target_gen_dir/truncate-tests.cml"
deps = [
":manifests",
":truncate_tests",
]
}
test("unicode_tests") {
sources = [ "unicode.cc" ]
deps = [
":fs_test",
"//src/lib/fxl/test:gtest_main",
"//zircon/public/lib/fbl",
]
}
fuchsia_component("unicode-tests") {
testonly = true
manifest = "$target_gen_dir/unicode-tests.cml"
deps = [
":manifests",
":unicode_tests",
]
}
test("unlink_tests") {
sources = [ "unlink.cc" ]
deps = [
":fs_test",
"//src/lib/fxl/test:gtest_main",
"//zircon/public/lib/fbl",
]
}
fuchsia_component("unlink-tests") {
testonly = true
manifest = "$target_gen_dir/unlink-tests.cml"
deps = [
":manifests",
":unlink_tests",
]
}
test("watcher_tests") {
sources = [ "watcher.cc" ]
deps = [
":fs_test",
"//sdk/fidl/fuchsia.io:fuchsia.io_llcpp",
"//src/lib/fxl/test:gtest_main",
"//zircon/public/lib/fbl",
"//zircon/system/ulib/fdio-caller",
]
}
fuchsia_component("watcher-tests") {
testonly = true
manifest = "$target_gen_dir/watcher-tests.cml"
deps = [
":manifests",
":watcher_tests",
]
}
fuchsia_test_package("fs-tests") {
test_components = [
":access-tests",
":append-tests",
":attr-tests",
":basic-tests",
":case-sensitivity-tests",
":clone-tests",
# Uncomment this when fxbug.dev/53973 is fixed.
# ":corrupt-tests",
":directory-tests",
":dot-dot-tests",
":fcntl-tests",
":filename-tests",
":link-tests",
":lseek-tests",
":minfs-tests",
":mmap-tests",
":overflow-tests",
":persist-tests",
":random-op-tests",
":realpath-tests",
":rename-tests",
":resize-tests",
":rw-tests",
":rw-workers-tests",
":sparse-tests",
":sync-tests",
":threading-tests",
":truncate-tests",
":unicode-tests",
":unlink-tests",
":watcher-tests",
]
}
test("directory_large_tests") {
sources = [ "directory_large.cc" ]
deps = [
":fs_test",
"//src/lib/fxl/test:gtest_main",
"//zircon/public/lib/fbl",
]
}
fuchsia_component("directory-large-tests") {
testonly = true
manifest = "$target_gen_dir/directory-large-tests.cml"
deps = [
":directory_large_tests",
":manifests",
]
}
test("max_file_tests") {
sources = [ "max_file.cc" ]
deps = [
":fs_test",
"//src/lib/fxl/test:gtest_main",
"//zircon/public/lib/fbl",
]
}
fuchsia_component("max-file-tests") {
testonly = true
manifest = "$target_gen_dir/max-file-tests.cml"
deps = [
":manifests",
":max_file_tests",
]
}
test("sparse_large_tests") {
sources = [ "sparse_large.cc" ]
deps = [
":fs_test",
"//src/lib/fxl/test:gtest_main",
"//zircon/public/lib/fbl",
]
}
fuchsia_component("sparse-large-tests") {
testonly = true
manifest = "$target_gen_dir/sparse-large-tests.cml"
deps = [
":manifests",
":sparse_large_tests",
]
}
test("truncate_large_tests") {
sources = [
"truncate_fixture.cc",
"truncate_large.cc",
]
deps = [
":fs_test",
"//src/lib/fxl/test:gtest_main",
"//zircon/public/lib/fbl",
]
}
fuchsia_component("truncate-large-tests") {
testonly = true
manifest = "$target_gen_dir/truncate-large-tests.cml"
deps = [
":manifests",
":truncate_large_tests",
]
}
fuchsia_test_package("large-fs-tests") {
test_components = [
":directory-large-tests",
":max-file-tests",
":sparse-large-tests",
":truncate-large-tests",
]
test_specs = {
environments = [
{
dimensions = emu_env.dimensions
tags = [ "slow" ]
},
]
}
}
action("manifests") {
script = "generate_manifests.py"
sources = [ "meta/fs_tests.cml" ]
outputs = [
"$target_gen_dir/access-tests.cml",
"$target_gen_dir/append-tests.cml",
"$target_gen_dir/attr-tests.cml",
"$target_gen_dir/basic-tests.cml",
"$target_gen_dir/case-sensitivity-tests.cml",
"$target_gen_dir/clone-tests.cml",
"$target_gen_dir/corrupt-tests.cml",
"$target_gen_dir/directory-large-tests.cml",
"$target_gen_dir/directory-tests.cml",
"$target_gen_dir/dot-dot-tests.cml",
"$target_gen_dir/fcntl-tests.cml",
"$target_gen_dir/filename-tests.cml",
"$target_gen_dir/link-tests.cml",
"$target_gen_dir/lseek-tests.cml",
"$target_gen_dir/max-file-tests.cml",
"$target_gen_dir/minfs-tests.cml",
"$target_gen_dir/mmap-tests.cml",
"$target_gen_dir/overflow-tests.cml",
"$target_gen_dir/persist-tests.cml",
"$target_gen_dir/random-op-tests.cml",
"$target_gen_dir/realpath-tests.cml",
"$target_gen_dir/rename-tests.cml",
"$target_gen_dir/resize-tests.cml",
"$target_gen_dir/rw-tests.cml",
"$target_gen_dir/rw-workers-tests.cml",
"$target_gen_dir/sparse-tests.cml",
"$target_gen_dir/sparse-large-tests.cml",
"$target_gen_dir/sync-tests.cml",
"$target_gen_dir/threading-tests.cml",
"$target_gen_dir/truncate-large-tests.cml",
"$target_gen_dir/truncate-tests.cml",
"$target_gen_dir/unicode-tests.cml",
"$target_gen_dir/unlink-tests.cml",
"$target_gen_dir/watcher-tests.cml",
]
args = rebase_path(sources, root_build_dir) +
rebase_path(outputs, root_build_dir)
}