| # 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/test/test_package.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" ] | |
| } | |
| 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", | |
| ] | |
| } | |
| executable("bin") { | |
| output_name = "shell_server" | |
| sources = [ "src/server_main.cc" ] | |
| deps = [ | |
| ":shell_interpreter", | |
| ":shell_server_lib", | |
| "//sdk/lib/syslog/cpp", | |
| ] | |
| } | |
| package("shell_server") { | |
| deps = [ ":bin" ] | |
| binaries = [ | |
| { | |
| name = "shell_server" | |
| dest = "shell_server" | |
| }, | |
| ] | |
| meta = [ | |
| { | |
| path = rebase_path("../meta/shell_server.cmx") | |
| dest = "shell_server.cmx" | |
| }, | |
| ] | |
| } | |
| 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", | |
| ] | |
| deps = [ | |
| ":shell_server", | |
| "//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/async-loop:async-loop-default", | |
| "//zircon/system/ulib/fidl-async:fidl-async-cpp", | |
| ] | |
| } | |
| test_package("shell-interpreter-tests") { | |
| deps = [ | |
| ":shell_interpreter_test_bin", | |
| ":shell_server_test_bin", | |
| ] | |
| tests = [ | |
| { | |
| name = "shell_interpreter_test_bin" | |
| environments = basic_envs | |
| }, | |
| { | |
| name = "shell_server_test_bin" | |
| environments = basic_envs | |
| }, | |
| ] | |
| } | |
| group("tests") { | |
| testonly = true | |
| deps = [ ":shell-interpreter-tests" ] | |
| } |