blob: d6cb50d47aa595303eee5cb5f5f019cb8aa0d75d [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("//build/test/test_package.gni")
import("//build/testing/environments.gni")
source_set("options") {
sources = [ "options.cc" ]
public = [ "options.h" ]
public_deps = [ "//zircon/public/lib/fit" ]
}
source_set("volume-descriptor") {
sources = [ "volume_descriptor.cc" ]
public = [ "volume_descriptor.h" ]
public_deps = [
":options",
"utils:guid",
"//zircon/public/lib/fit",
# TODO(fxbug.dev/57392): Move it back to //third_party once unification completes.
"//zircon/third_party/rapidjson",
]
}
source_set("address-descriptor") {
sources = [ "address_descriptor.cc" ]
public = [ "address_descriptor.h" ]
public_deps = [
"//zircon/public/lib/fbl",
"//zircon/public/lib/fit",
]
# TODO(fxbug.dev/57392): Move it back to //third_party once unification completes.
deps = [ "//zircon/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",
]
# TODO(fxbug.dev/57392): Move it back to //third_party once unification completes.
deps = [ "//zircon/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_package("storage-volume-image-tests") {
deps = [
":storage-volume-image-integration-test",
":storage-volume-image-test",
]
tests = [
{
name = "storage-volume-image-test"
environments = basic_envs
},
{
name = "storage-volume-image-integration-test"
environments = basic_envs
},
]
resources = [
{
path = rebase_path(
"//src/storage/volume_image/serialization/address_descriptor.schema.json")
dest = "schema/address_descriptor.schema.json"
},
{
path = rebase_path(
"//src/storage/volume_image/serialization/blob_manifest.schema.json")
dest = "schema/blob_manifest.schema.json"
},
{
path = rebase_path(
"//src/storage/volume_image/serialization/volume_descriptor.schema.json")
dest = "schema/volume_descriptor.schema.json"
},
{
path = rebase_path(
"//src/storage/volume_image/serialization/volume_image.schema.json")
dest = "schema/volume_image.schema.json"
},
]
}
test("storage-volume-image-test") {
deps = [
":volume-descriptor-test",
"ftl:tests",
"fvm:fvm-test",
"serialization:tests",
"utils:tests",
"//src/lib/fxl/test:gtest_main",
]
if (is_fuchsia) {
deps += [ "//sdk/lib/fdio" ]
}
}
test("storage-volume-image-integration-test") {
deps = [
"ftl:integration-tests",
"//src/lib/fxl/test:gtest_main",
]
if (is_fuchsia) {
deps += [ "//sdk/lib/fdio" ]
}
}
group("tests") {
testonly = true
deps = [
":storage-volume-image-integration-test($host_toolchain)",
":storage-volume-image-test($host_toolchain)",
":storage-volume-image-tests",
"fvm:tests",
]
}