| # 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/testing/host_test_data.gni") |
| |
| config("schema_path") { |
| if (is_host) { |
| defines = [ "STORAGE_VOLUME_IMAGE_SCHEMA_PATH=\"schema/\"" ] |
| } else { |
| defines = [ "STORAGE_VOLUME_IMAGE_SCHEMA_PATH=\"pkg/data/schema/\"" ] |
| } |
| } |
| |
| source_set("schema") { |
| sources = [ "schema.cc" ] |
| public = [ "schema.h" ] |
| |
| configs += [ ":schema_path" ] |
| deps = [ "//src/storage/volume_image/utils:path" ] |
| } |
| |
| if (is_host) { |
| host_test_data("schema_json") { |
| sources = [ |
| "address_descriptor.schema.json", |
| "blob_manifest.schema.json", |
| "volume_descriptor.schema.json", |
| "volume_image.schema.json", |
| ] |
| outputs = [ "$root_out_dir/schema/{{source_file_part}}" ] |
| } |
| } |
| |
| source_set("schema-test") { |
| testonly = true |
| sources = [ "schema_test.cc" ] |
| deps = [ |
| ":schema", |
| "//src/lib/json_parser", |
| "//third_party/googletest:gtest", |
| ] |
| |
| if (is_host) { |
| deps += [ ":schema_json" ] |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":schema-test" ] |
| } |