blob: eb2abcfb792ccfa78af9c7ff14390e9ec848db21 [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/test.gni")
import("//build/test/test_package.gni")
static_library("line_input") {
sources = [
"line_input.cc",
"line_input.h",
"modal_line_input.cc",
"modal_line_input.h",
]
deps = []
public_deps = [
"//src/lib/fxl",
"//zircon/public/lib/fit",
]
configs += [
# TODO(fxbug.dev/58162): delete the below and fix compiler warnings
"//build/config:Wno-conversion",
]
}
if (is_host) {
test("line_input_tests") {
sources = [
"line_input_unittest.cc",
"modal_line_input_unittest.cc",
"test_line_input.h",
]
deps = [
":line_input",
"//src/lib/fxl/test:gtest_main",
"//third_party/googletest:gtest",
]
}
# Currently compiled for the host only, but could be packaged for the target if desired.
executable("line_input_example") {
sources = [ "line_input_example.cc" ]
deps = [ ":line_input" ]
configs += [
# TODO(fxbug.dev/58162): delete the below and fix compiler warnings
"//build/config:Wno-conversion",
]
}
} else {
executable("line_input_tests_bin") {
testonly = true
sources = [
"line_input_unittest.cc",
"modal_line_input_unittest.cc",
"test_line_input.h",
]
deps = [
":line_input",
"//src/lib/fxl/test:gtest_main",
"//third_party/googletest:gtest",
]
}
unittest_package("line_input_tests") {
deps = [ ":line_input_tests_bin" ]
tests = [
{
name = "line_input_tests_bin"
environments = basic_envs
},
]
}
}
group("tests") {
testonly = true
deps = [
":line_input_example($host_toolchain)",
":line_input_tests",
":line_input_tests($host_toolchain)",
]
}