| # 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/test.gni") |
| import("//build/test/test_package.gni") |
| |
| # Generate a manifest providing all of the .fidl.json files exported by the |
| # core SDK (and any other FIDL files we might want). |
| action("generate_fidl_json") { |
| script = "generate_fidl_json.sh" |
| generated_output = "$target_gen_dir/sdk_fidl_json.manifest" |
| outputs = [ "$generated_output" ] |
| testonly = true |
| deps = [ |
| "//garnet/examples/fidl/services:echo", |
| "//sdk:core", |
| "//sdk:core_fidl_json", |
| "//sdk/fidl/fuchsia.power:fuchsia.power", |
| "//third_party/quickjs:qjs($host_toolchain)", |
| "//zircon/system/fidl/fuchsia-device-manager", |
| "//zircon/system/fidl/fuchsia-kernel", |
| ] |
| args = [ |
| "--qjs=" + rebase_path("$root_build_dir/host_$host_cpu/qjs"), |
| "--fidl-json-file=" + |
| rebase_path("$root_gen_dir/sdk/core.fidl_json.txt", root_build_dir), |
| "--out-file=" + rebase_path("$generated_output", root_build_dir), |
| rebase_path( |
| "$root_build_dir/fidling/gen/garnet/examples/fidl/services/echo.fidl.json", |
| root_build_dir), |
| rebase_path( |
| "$root_build_dir/fidling/gen/sdk/fidl/fuchsia.power/fuchsia.power.fidl.json", |
| root_build_dir), |
| rebase_path( |
| "$root_build_dir/fidling/gen/zircon/system/fidl/fuchsia-kernel/fuchsia-kernel.fidl.json", |
| root_build_dir), |
| rebase_path( |
| "$root_build_dir/fidling/gen/zircon/system/fidl/fuchsia-device-manager/fuchsia-device-manager.fidl.json", |
| root_build_dir), |
| rebase_path( |
| "$root_build_dir/fidling/gen/zircon/system/fidl/fuchsia-boot/fuchsia-boot.fidl.json", |
| root_build_dir), |
| ] |
| } |
| |
| test_package("shell_tests") { |
| rootjob_svc = "//build" |
| deps = [ |
| ":generate_fidl_json", |
| "//src/developer/shell/console:console_unittests_bin", |
| "//src/developer/shell/josh:bin", |
| "//src/developer/shell/josh:josh_tests_bin", |
| "//src/developer/shell/josh/lib:js_libs", |
| "//src/developer/shell/josh/lib:spawn_child_test_util", |
| "//src/developer/shell/mirror:sh_mirror_tests_bin", |
| "//src/developer/shell/parser:parser_tests_bin", |
| ] |
| |
| binaries = [ |
| { |
| name = "spawn_child_test_util" |
| }, |
| { |
| name = "josh" |
| }, |
| ] |
| |
| tests = [ |
| { |
| name = "console_unittests_bin" |
| environments = basic_envs |
| }, |
| { |
| name = "sh_mirror_tests_bin" |
| environments = basic_envs |
| }, |
| { |
| name = "josh_tests_bin" |
| environments = basic_envs |
| }, |
| { |
| name = "parser_tests_bin" |
| environments = basic_envs |
| }, |
| ] |
| extra = get_target_outputs(":generate_fidl_json") + |
| [ "$target_gen_dir/josh/lib/libs.manifest" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| |
| deps = [ |
| ":shell_tests", |
| "interpreter:shell_server", |
| "interpreter:tests", |
| ] |
| } |
| |
| # "josh" is Javascript Object SHell. |
| package("josh") { |
| # TODO(jeremymanson): This is only testonly because sdk:core is. We should undo that. |
| testonly = true |
| deps = [ |
| "//src/developer/shell:generate_fidl_json", |
| "//src/developer/shell/josh:bin", |
| "//src/developer/shell/josh/lib:js_libs", |
| ] |
| binaries = [ |
| { |
| name = "josh" |
| shell = true |
| }, |
| ] |
| extra = get_target_outputs(":generate_fidl_json") + |
| [ "$target_gen_dir/josh/lib/libs.manifest" ] |
| } |
| |
| # "cliff" is the CLI For Fuchsia. Need a better name. |
| package("cliff") { |
| # TODO(jeremymanson): This is only testonly because sdk:core is. We should undo that. |
| testonly = true |
| deps = [ |
| "//src/developer/shell:generate_fidl_json", |
| "//src/developer/shell/console:bin", |
| ] |
| binaries = [ |
| { |
| name = "cliff" |
| shell = true |
| }, |
| ] |
| extra = get_target_outputs(":generate_fidl_json") |
| } |