blob: 80960b7dfefc943b939448a73bd8e5f76348f7e7 [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/package.gni")
import("//build/rust/rustc_library.gni")
import("//build/rust/rustc_test.gni")
import("//build/test/test_package.gni")
import("//build/testing/environments.gni")
import("//build/testing/host_test_data.gni")
rustc_library("font_info") {
edition = "2018"
deps = [
"//src/fonts/char_set",
"//src/fonts/freetype_ffi",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:libc",
"//third_party/rust_crates:thiserror",
]
if (is_fuchsia) {
deps += [
"//sdk/fidl/fuchsia.io:fuchsia.io-rustc",
"//sdk/fidl/fuchsia.mem:fuchsia.mem-rustc",
"//src/lib/zircon/rust:fuchsia-zircon",
]
}
sources = [
"src/lib.rs",
"src/sources.rs",
"src/vmo_stream.rs",
]
}
rustc_test("font_info_test_bin") {
name = "font_info_test"
edition = "2018"
deps = [
":font_info",
"//src/fonts/char_set",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:thiserror",
]
source_root = "tests/tests.rs"
non_rust_deps = []
if (is_host) {
non_rust_deps += [ ":test_data" ]
}
sources = [ "tests/tests.rs" ]
# TODO(fxbug.dev/38228): Fix leak in font_info_test.
non_rust_deps += [ "//build/config/sanitizers:suppress-lsan.DO-NOT-USE-THIS" ]
}
# Needed for testing on Fuchsia
test_package("font_info_tests") {
deps = [ ":font_info_test_bin" ]
resources = [
{
path = rebase_path("//src/fonts/test_data/sample_font.ttf")
dest = "sample_font.ttf"
},
]
tests = [
{
name = "font_info_test"
},
]
}
if (is_host) {
host_test_data("test_data") {
sources = [ "//src/fonts/test_data/sample_font.ttf" ]
outputs = [ "$root_out_dir/test_data/font_info/{{source_file_part}}" ]
}
}
group("tests") {
testonly = true
public_deps = [
":font_info_test_bin($host_toolchain)",
":font_info_tests",
]
}