blob: 0f10818ad95cb0a412fabf90b0ca16fe702c68fe [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/components.gni")
static_library("shell_interpreter") {
public = [
"src/expressions.h",
"src/instructions.h",
"src/interpreter.h",
"src/nodes.h",
"src/schema.h",
"src/types.h",
]
sources = [
"src/expressions.cc",
"src/instructions.cc",
"src/interpreter.cc",
"src/nodes.cc",
"src/schema.cc",
"src/scope.cc",
"src/thread.cc",
"src/types.cc",
"src/value.cc",
]
deps = [ "//sdk/lib/syslog/cpp" ]
public_deps = [ "//sdk/lib/stdcompat" ]
}
static_library("shell_server_lib") {
public = [ "src/server.h" ]
sources = [ "src/server.cc" ]
public_deps = [
":shell_interpreter",
"//sdk/lib/fdio",
"//sdk/lib/svc",
"//sdk/lib/sys/cpp",
"//sdk/lib/syslog/cpp",
"//src/developer/shell/common",
"//src/developer/shell/fidl/fuchsia.shell:shell_llcpp",
"//zircon/system/ulib/async-default",
"//zircon/system/ulib/async-loop",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/fidl-async:fidl-async-cpp",
]
# TODO(fxbug.dev/94768): This target uses mutable tables which are deprecated,
# rather than builders.
configs += [ "//build/cpp:fidl-wire-deprecated-mutable-tables" ]
}
executable("bin") {
output_name = "shell_server"
sources = [ "src/server_main.cc" ]
deps = [
":shell_interpreter",
":shell_server_lib",
"//sdk/lib/syslog/cpp",
]
}
executable("shell_interpreter_test_bin") {
testonly = true
sources = [ "test/interpreter_unit_tests.cc" ]
deps = [
":shell_interpreter",
"//sdk/lib/syslog/cpp",
"//src/lib/fxl/test:gtest_main",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
executable("shell_server_test_bin") {
testonly = true
sources = [
"test/addition.cc",
"test/assignment.cc",
"test/emit_result.cc",
"test/interpreter.cc",
"test/interpreter_test.cc",
"test/load.cc",
"test/server_unittests.cc",
]
deps = [
":shell_server",
":shell_server_lib",
"//sdk/lib/fdio",
"//sdk/lib/sys/cpp",
"//src/developer/shell/common",
"//src/lib/fxl/test:gtest_main",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
"//zircon/system/ulib/async-default",
"//zircon/system/ulib/async-loop",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/fidl-async:fidl-async-cpp",
]
}
fuchsia_unittest_component("shell-interpreter-test") {
deps = [ ":shell_interpreter_test_bin" ]
}
fuchsia_unittest_component("shell-server-test") {
manifest = "meta/shell_server_test_bin.cml"
deps = [ ":shell_server_test_bin" ]
}
fuchsia_test_component("shell_server") {
manifest = "../meta/shell_server.cml"
deps = [ ":bin" ]
}
fuchsia_test_package("shell-interpreter-tests") {
test_components = [
":shell-interpreter-test",
":shell-server-test",
]
deps = [ ":shell_server" ]
}
group("tests") {
testonly = true
deps = [ ":shell-interpreter-tests" ]
}