blob: da3b30b29b0b78a040312b08e8bef62cf9c0b3a6 [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/rust/rustc_test.gni")
import("//build/test/test_package.gni")
group("integration") {
testonly = true
deps = [ ":font_provider_integration_tests" ]
}
# Integration tests without a `main()` function.
rustc_test("font_provider_integration_tests_bin") {
name = "font_provider_integration_tests"
edition = "2018"
deps = [
"//garnet/lib/rust/fidl_fuchsia_fonts_ext",
"//sdk/fidl/fuchsia.fonts:fuchsia.fonts-rustc",
"//sdk/fidl/fuchsia.fonts.experimental:fuchsia.fonts.experimental-rustc",
"//sdk/fidl/fuchsia.intl:fuchsia.intl-rustc",
"//sdk/fidl/fuchsia.io:fuchsia.io-rustc",
"//sdk/fidl/fuchsia.pkg:fuchsia.pkg-rustc",
"//src/fonts/char_set",
"//src/fonts/manifest",
"//src/lib/fdio/rust:fdio",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-url",
"//src/lib/syslog/rust:syslog",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:itertools",
"//third_party/rust_crates:lazy_static",
"//third_party/rust_crates:thiserror",
]
visibility = [ ":*" ]
sources = [
"src/experimental_api/get_typeface_by_id.rs",
"src/experimental_api/get_typefaces_by_family.rs",
"src/experimental_api/list_typefaces.rs",
"src/experimental_api/mod.rs",
"src/experimental_api/util/mod.rs",
"src/lib.rs",
"src/old_api/mod.rs",
"src/reviewed_api/ephemeral.rs",
"src/reviewed_api/get_font_family_info.rs",
"src/reviewed_api/get_typeface.rs",
"src/reviewed_api/mod.rs",
"src/reviewed_api/util/mod.rs",
"src/util.rs",
]
}
# Generate arg-specialized manifests for font_provider_integration_test
cmx_merge("fonts_with_ephemeral_fonts_cml") {
sources = [
rebase_path("../../meta/fonts.cml"),
rebase_path("meta/ephemeral_fonts_shard.cml"),
]
output_name = "fonts_with_ephemeral_fonts.cml"
}
cmx_merge("fonts_with_aliases_fonts_cml") {
sources = [
rebase_path("../../meta/fonts.cml"),
rebase_path("meta/aliases_fonts_shard.cml"),
]
output_name = "fonts_with_aliases_fonts.cml"
}
cmx_merge("fonts_with_small_fonts_cml") {
sources = [
rebase_path("../../meta/fonts.cml"),
rebase_path("meta/small_fonts_shard.cml"),
]
output_name = "fonts_with_small_fonts.cml"
}
cmx_merge("fonts_with_medium_fonts_cml") {
sources = [
rebase_path("../../meta/fonts.cml"),
rebase_path("meta/medium_fonts_shard.cml"),
]
output_name = "fonts_with_medium_fonts.cml"
}
cmx_merge("fonts_with_large_fonts_cml") {
sources = [
rebase_path("../../meta/fonts.cml"),
rebase_path("meta/large_fonts_shard.cml"),
]
output_name = "fonts_with_large_fonts.cml"
}
test_package("font_provider_integration_tests") {
deps = [
":font_provider_integration_tests_bin",
":fonts_with_aliases_fonts_cml",
":fonts_with_ephemeral_fonts_cml",
":fonts_with_large_fonts_cml",
":fonts_with_medium_fonts_cml",
":fonts_with_small_fonts_cml",
"//src/fonts:font_provider",
"//src/fonts/collections:test-fonts-large-collection",
"//src/fonts/collections:test-fonts-medium-collection",
"//src/fonts/collections:test-fonts-small-collection",
"//src/fonts/testing/mock_font_resolver:mock_font_resolver_bin",
]
meta = [
{
path = rebase_path("${target_out_dir}/fonts_with_ephemeral_fonts.cml")
dest = "fonts_with_ephemeral_fonts.cm"
},
{
path = rebase_path("${target_out_dir}/fonts_with_aliases_fonts.cml")
dest = "fonts_with_aliases_fonts.cm"
},
{
path = rebase_path("${target_out_dir}/fonts_with_small_fonts.cml")
dest = "fonts_with_small_fonts.cm"
},
{
path = rebase_path("${target_out_dir}/fonts_with_medium_fonts.cml")
dest = "fonts_with_medium_fonts.cm"
},
{
path = rebase_path("${target_out_dir}/fonts_with_large_fonts.cml")
dest = "fonts_with_large_fonts.cm"
},
{
path = rebase_path(
"../../testing/mock_font_resolver/meta/mock_font_resolver.cml")
dest = "mock_font_resolver.cm"
},
{
path = rebase_path("meta/font_provider_integration_tests_driver.cml")
dest = "test_driver.cm"
},
]
binaries = [
{
name = "mock_font_resolver"
},
{
name = "font_provider"
},
]
v2_tests = [
{
name = "font_provider_integration_tests"
environments = basic_envs
},
]
resources = [
{
path = rebase_path("ephemeral.font_manifest.json")
dest = "testdata/ephemeral.font_manifest.json"
},
{
path = rebase_path("aliases.font_manifest.json")
dest = "testdata/aliases.font_manifest.json"
},
]
}