blob: ea3bccc4c83fb9bc224c8e0d9a5686d0501dfb3d [file] [log] [blame]
# 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/host.gni")
import("//build/rust/rustc_binary.gni")
import("//build/rust/rustc_test.gni")
import("//build/testing/environments.gni")
import("//build/testing/host_test_data.gni")
rustc_binary("font_manifest_generator") {
name = "font_manifest_generator"
with_unit_tests = true
edition = "2018"
deps = [
"//garnet/lib/rust/fidl_fuchsia_fonts_ext",
"//sdk/fidl/fuchsia.fonts:fuchsia.fonts-rustc",
"//src/fonts/char_set",
"//src/fonts/font_info",
"//src/fonts/manifest",
"//src/fonts/offset_string",
"//src/lib/fuchsia-url",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:itertools",
"//third_party/rust_crates:rayon",
"//third_party/rust_crates:serde",
"//third_party/rust_crates:serde_json",
"//third_party/rust_crates:serde_json5",
"//third_party/rust_crates:structopt",
"//third_party/rust_crates:thiserror",
"//third_party/rust_crates:unicase",
]
test_deps = [
"//src/lib/intl/unicode_utils/char_collection",
"//third_party/rust_crates:maplit",
"//third_party/rust_crates:matches",
"//third_party/rust_crates:pretty_assertions",
"//third_party/rust_crates:tempfile",
]
sources = [
"src/constants.rs",
"src/fake_font_info_loader.rs",
"src/font_catalog.rs",
"src/font_db.rs",
"src/font_pkgs.rs",
"src/font_sets.rs",
"src/generator.rs",
"src/main.rs",
"src/merge.rs",
"src/product_config.rs",
"src/serde_ext.rs",
]
}
if (is_host) {
rustc_test("font_manifest_generator_integration_tests") {
edition = "2018"
deps = [
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:itertools",
"//third_party/rust_crates:pretty_assertions",
"//third_party/rust_crates:serde_json",
"//third_party/rust_crates:tempfile",
"//third_party/rust_crates:thiserror",
]
source_root = "tests/tests.rs"
# Must depend directly on these in order to have access to them in CQ
non_rust_deps = [ ":test_files" ]
sources = [ "tests/tests.rs" ]
}
host_test_data("test_data") {
sources = [
"tests/data/a.font_catalog.json",
"tests/data/a.font_pkgs.json",
"tests/data/b.font_catalog.json",
"tests/data/b.font_pkgs.json",
"tests/data/product_ab.all_fonts.json",
"tests/data/product_ab.fontcfg.json",
"tests/data/product_ab.local_fonts.json",
"tests/goldens/product_ab.font_manifest.json",
]
outputs = [
"$root_out_dir/test_data/font_manifest_generator/{{source_file_part}}",
]
}
host_test_data("generator") {
sources = [ "$root_out_dir/font_manifest_generator" ]
deps = [ ":font_manifest_generator" ]
}
group("test_files") {
testonly = true
data_deps = [
":generator",
":test_data",
]
}
}
group("manifest_generator") {
public_deps = [ ":font_manifest_generator($host_toolchain)" ]
}
group("tests") {
testonly = true
public_deps = [
":font_manifest_generator_integration_tests($host_toolchain)",
":font_manifest_generator_test($host_toolchain)",
]
}