| # Copyright 2026 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/python/host.gni") | |
| import("//build/python/python_host_test.gni") | |
| import("//build/python/python_library.gni") | |
| _cli_tests = [ | |
| "tests/test_cli.py", | |
| "commands/tests/test_lifecycle_commands.py", | |
| "commands/tests/test_execution_commands.py", | |
| "commands/tests/test_inspection_commands.py", | |
| "commands/tests/test_breakpoint_commands.py", | |
| ] | |
| if (is_host) { | |
| python_library("cli_lib") { | |
| library_name = "cli" | |
| sources = [ | |
| "__init__.py", | |
| "cli.py", | |
| "commands/__init__.py", | |
| "commands/aspace.py", | |
| "commands/async_backtrace.py", | |
| "commands/attach.py", | |
| "commands/base.py", | |
| "commands/break_cmd.py", | |
| "commands/console.py", | |
| "commands/continue_cmd.py", | |
| "commands/detach.py", | |
| "commands/diagnose_hang.py", | |
| "commands/driver_list.py", | |
| "commands/evaluate.py", | |
| "commands/finish.py", | |
| "commands/get_state.py", | |
| "commands/handles.py", | |
| "commands/location_utils.py", | |
| "commands/mem_read.py", | |
| "commands/modules.py", | |
| "commands/next_cmd.py", | |
| "commands/pause.py", | |
| "commands/schema.py", | |
| "commands/stack_trace.py", | |
| "commands/start.py", | |
| "commands/step_in.py", | |
| "commands/stop.py", | |
| "commands/threads.py", | |
| "commands/tracepoint.py", | |
| "commands/variables.py", | |
| "commands/wait_for_event.py", | |
| "commands/watch_cmd.py", | |
| ] | |
| deps = [ | |
| "//scripts/debug/zxdb_cli/daemon_manager", | |
| "//scripts/debug/zxdb_cli/shared:protocol_lib", | |
| "//scripts/lib/fx_cmd", | |
| ] | |
| } | |
| python_library("test_helpers") { | |
| testonly = true | |
| library_name = "cli" | |
| sources = [ | |
| "tests/__init__.py", | |
| "tests/helpers.py", | |
| ] | |
| deps = [ ":cli_lib" ] | |
| } | |
| foreach(test_source, _cli_tests) { | |
| _test_name = get_path_info(test_source, "name") | |
| python_host_test(_test_name) { | |
| main_source = test_source | |
| libraries = [ | |
| ":cli_lib", | |
| ":test_helpers", | |
| ] | |
| test_data_deps = [ "//prebuilt/third_party/pydantic-core:test_data" ] | |
| } | |
| } | |
| group("tests") { | |
| testonly = true | |
| deps = [] | |
| foreach(test_source, _cli_tests) { | |
| _test_name = get_path_info(test_source, "name") | |
| deps += [ ":$_test_name" ] | |
| } | |
| } | |
| } else { | |
| group("tests") { | |
| testonly = true | |
| deps = [ ":tests($host_toolchain)" ] | |
| } | |
| } |