| # 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/components.gni") | |
| import("//build/test.gni") | |
| source_set("options") { | |
| sources = [ "options.cc" ] | |
| public = [ "options.h" ] | |
| public_deps = [ "//sdk/lib/fit-promise" ] | |
| } | |
| source_set("volume-descriptor") { | |
| sources = [ "volume_descriptor.cc" ] | |
| public = [ "volume_descriptor.h" ] | |
| public_deps = [ | |
| ":options", | |
| "utils:guid", | |
| "//sdk/lib/fit-promise", | |
| "//third_party/rapidjson", | |
| ] | |
| } | |
| source_set("address-descriptor") { | |
| sources = [ "address_descriptor.cc" ] | |
| public = [ "address_descriptor.h" ] | |
| public_deps = [ | |
| "//sdk/lib/fit-promise", | |
| "//zircon/system/ulib/fbl", | |
| ] | |
| deps = [ "//third_party/rapidjson" ] | |
| } | |
| source_set("partition") { | |
| sources = [ "partition.cc" ] | |
| public = [ "partition.h" ] | |
| public_deps = [ | |
| ":address-descriptor", | |
| "//src/storage/volume_image:volume-descriptor", | |
| "//src/storage/volume_image/utils:io-interfaces", | |
| ] | |
| deps = [ "//third_party/rapidjson" ] | |
| } | |
| source_set("volume-descriptor-test") { | |
| testonly = true | |
| sources = [ | |
| "address_descriptor_test.cc", | |
| "options_test.cc", | |
| "partition_test.cc", | |
| "volume_descriptor_test.cc", | |
| ] | |
| deps = [ | |
| ":address-descriptor", | |
| ":partition", | |
| ":volume-descriptor", | |
| "serialization:schema", | |
| "//src/lib/json_parser", | |
| "//third_party/googletest:gmock", | |
| "//third_party/googletest:gtest", | |
| ] | |
| } | |
| test("storage-volume-image-test") { | |
| deps = [ | |
| ":volume-descriptor-test", | |
| "ftl:tests", | |
| "fvm:fvm-test", | |
| "serialization:tests", | |
| "//src/lib/fxl/test:gtest_main", | |
| "//src/sys/test_runners:tmp_storage", | |
| ] | |
| if (is_fuchsia) { | |
| deps += [ "//sdk/lib/fdio" ] | |
| } | |
| } | |
| test("storage-volume-image-adapter-test") { | |
| deps = [ | |
| "adapter:adapter-tests", | |
| "//src/lib/fxl/test:gtest_main", | |
| "//src/sys/test_runners:tmp_storage", | |
| ] | |
| if (is_fuchsia) { | |
| deps += [ "//sdk/lib/fdio" ] | |
| } | |
| } | |
| test("storage-volume-image-utils-test") { | |
| deps = [ | |
| "utils:tests", | |
| "//src/lib/fxl/test:gtest_main", | |
| "//src/sys/test_runners:tmp_storage", | |
| ] | |
| if (is_fuchsia) { | |
| deps += [ "//sdk/lib/fdio" ] | |
| } | |
| } | |
| test("storage-volume-image-integration-test") { | |
| deps = [ | |
| "ftl:integration-tests", | |
| "//src/lib/fxl/test:gtest_main", | |
| "//src/sys/test_runners:tmp_storage", | |
| ] | |
| if (is_fuchsia) { | |
| deps += [ "//sdk/lib/fdio" ] | |
| } | |
| } | |
| resource("serialization-schemas") { | |
| sources = [ | |
| "serialization/address_descriptor.schema.json", | |
| "serialization/blob_manifest.schema.json", | |
| "serialization/volume_descriptor.schema.json", | |
| "serialization/volume_image.schema.json", | |
| ] | |
| outputs = [ "data/schema/{{source_file_part}}" ] | |
| } | |
| fuchsia_unittest_component("storage-volume-image-test-component") { | |
| deps = [ | |
| ":serialization-schemas", | |
| ":storage-volume-image-test", | |
| ] | |
| } | |
| fuchsia_unittest_component("storage-volume-image-integration-test-component") { | |
| deps = [ ":storage-volume-image-integration-test" ] | |
| } | |
| fuchsia_unittest_component("storage-volume-image-adapter-test-component") { | |
| deps = [ | |
| ":storage-volume-image-adapter-test", | |
| "adapter:adapter-test-images", | |
| ] | |
| } | |
| fuchsia_unittest_component("storage-volume-image-utils-test-component") { | |
| deps = [ ":storage-volume-image-utils-test" ] | |
| } | |
| fuchsia_test_package("storage-volume-image-tests") { | |
| test_components = [ | |
| ":storage-volume-image-test-component", | |
| ":storage-volume-image-adapter-test-component", | |
| ":storage-volume-image-integration-test-component", | |
| ":storage-volume-image-utils-test-component", | |
| ] | |
| } | |
| group("tests") { | |
| testonly = true | |
| deps = [ | |
| ":storage-volume-image-integration-test($host_toolchain)", | |
| ":storage-volume-image-test($host_toolchain)", | |
| ":storage-volume-image-tests", | |
| "adapter:tests", | |
| "fvm:tests", | |
| ] | |
| } |