blob: c56f80991f4ec58963c7bf22c572e93425a2a8ff [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("../../../gn/build_rules.gni")
config("public_config") {
# For now clients should include "tests/common/spinel/xxx.h"
include_dirs = [ graphics_compute_dir ]
}
# Spinel-related utilities library. This only depends on the Spinel API
# headers and can be used with any backend (Spinel or Mold).
source_set("spinel_utils") {
sources = [
"spinel_image.cc",
"spinel_image.h",
"spinel_path_sink.cc",
"spinel_path_sink.h",
"svg_spinel_image.cc",
"svg_spinel_image.h",
]
deps = [
"${graphics_compute_dir}/spinel/ext/color",
"${graphics_compute_dir}/spinel/ext/transform_stack",
"${graphics_compute_dir}/tests:common",
"${graphics_compute_dir}/tests/common/svg",
]
public_configs = [ ":public_config" ]
public_deps = [
"${graphics_compute_dir}/spinel:spinel_headers",
"${graphics_compute_dir}/svg:svg",
]
configs += [
# TODO(fxbug.dev/58162): delete the below and fix compiler warnings
"//build/config:Wno-conversion",
]
}
# Spinel-related test utilities. Only depends on the Spinel API headers, and
# and only useful for tests (testonly is set to true).
source_set("spinel_test_utils") {
sources = [
"spinel_test_utils.cc",
"spinel_test_utils.h",
]
public_configs = [ ":public_config" ]
public_deps = [
"${graphics_compute_dir}/spinel:spinel_headers",
"${graphics_compute_dir}/tests:common",
graphics_compute_gtest_target,
]
testonly = true
}
# Unit-tests for both spinel_utils and spinel_test_utils.
graphics_compute_unittests("unittests") {
sources = [
"spinel_image_unittest.cc",
"spinel_path_sink_unittest.cc",
"spinel_test_utils_unittest.cc",
"svg_spinel_image_unittest.cc",
]
deps = [
":spinel_test_utils",
":spinel_utils",
"${graphics_compute_dir}/tests:common",
"${graphics_compute_dir}/tests/common/svg",
"${graphics_compute_dir}/tests/mock_spinel:mock_spinel_test_utils",
]
}