| # 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/test.gni") |
| import("//build/testing/host_test.gni") |
| import("//build/testing/host_test_data.gni") |
| |
| static_library("host") { |
| sources = [ |
| "blobfs_format.cc", |
| "blobfs_format.h", |
| "container.cc", |
| "container.h", |
| "file_wrapper.cc", |
| "file_wrapper.h", |
| "format.cc", |
| "format.h", |
| "fvm_container.cc", |
| "fvm_container.h", |
| "fvm_info.cc", |
| "fvm_info.h", |
| "fvm_reservation.cc", |
| "fvm_reservation.h", |
| "internal_snapshot_meta_format.cc", |
| "internal_snapshot_meta_format.h", |
| "minfs_format.cc", |
| "minfs_format.h", |
| "sparse_container.cc", |
| "sparse_container.h", |
| "sparse_paver.cc", |
| "sparse_paver.h", |
| ] |
| |
| public_deps = [ |
| "//src/lib/storage/fs_management", |
| "//src/storage/blobfs", |
| "//src/storage/fvm", |
| "//src/storage/minfs", |
| ] |
| deps = [ |
| "//sdk/lib/fit", |
| "//src/lib/digest", |
| "//src/lib/storage/vfs/cpp", |
| "//src/lib/storage/vfs/cpp/transaction", |
| "//src/storage/blobfs", |
| "//src/storage/fvm", |
| "//src/storage/minfs", |
| "//third_party/boringssl", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/safemath", |
| "//zircon/third_party/ulib/cksum", |
| "//zircon/third_party/ulib/lz4", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| # Bitrot has made these tests uncompilable. |
| # We are not planning to fix these as an FVM tool rewrite is in progress (fxbug.dev/48526). |
| # ":fvm-host-test($host_toolchain)", |
| ":fvm_image_tests($host_toolchain)", |
| ] |
| } |
| |
| if (current_toolchain == host_toolchain) { |
| test("fvm-host-test") { |
| sources = [ "fvm_host_test.cc" ] |
| |
| deps = [ |
| ":host", |
| "//sdk/lib/fit", |
| "//src/storage/fvm", |
| "//zircon/public/lib/zxtest", |
| ] |
| } |
| |
| fvm_target = "//src/storage/bin/fvm($host_toolchain)" |
| blobfs_target = "//zircon/tools/blobfs($host_toolchain)" |
| host_test_data("fvm_image_tests_tools") { |
| visibility = [ ":*" ] |
| sources = [ |
| get_label_info(fvm_target, "root_out_dir") + "/fvm", |
| get_label_info(blobfs_target, "root_out_dir") + "/blobfs", |
| ] |
| deps = [ |
| blobfs_target, |
| fvm_target, |
| ] |
| outputs = [ "$root_out_dir/fvm_image_tests_tools/{{source_file_part}}" ] |
| } |
| |
| host_test_data("fvm_image_tests_script") { |
| visibility = [ ":*" ] |
| sources = [ "fvm_image_tests.sh" ] |
| deps = [ ":fvm_image_tests_tools" ] |
| outputs = [ "$root_out_dir/fvm_image_tests_tools/{{source_file_part}}" ] |
| } |
| |
| host_test("fvm_image_tests") { |
| binary_path = "${root_out_dir}/fvm_image_tests_tools/fvm_image_tests.sh" |
| deps = [ |
| ":fvm_image_tests_script($host_toolchain)", |
| ":fvm_image_tests_tools($host_toolchain)", |
| ] |
| } |
| } |