Files
Alexander Kiselev 3db0af7a3c feat: Add comprehensive E2E test suite and fix CLI argument conflicts
Add E2E test infrastructure:
- DaemonTestHarness for managing daemon lifecycle in tests
- Test fixtures and helpers in tests/common/
- Sample binary fixture for integration tests

Add test coverage:
- command_tests.rs: version, doctor, config commands
- project_tests.rs: project create/list/info/delete, import, analyze
- daemon_tests.rs: daemon start/status/ping/stop/clear-cache
- query_tests.rs: function list, strings, memory, decompile, xref
- unimplemented_tests.rs: 39 tests for graceful error messages

Fix CLI bugs:
- DisasmArgs: rename count to num_instructions (--instructions/-n)
  to avoid conflict with QueryOptions.count
- GraphExportArgs: add unique arg id for format positional to avoid
  conflict with QueryOptions.format

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 04:47:22 -08:00

42 lines
1.1 KiB
Rust

//! End-to-end smoke tests for ghidra-cli
//!
//! This is a lightweight smoke test that verifies basic CLI functionality.
//! Comprehensive test coverage is in:
//! - command_tests.rs (version, doctor, config)
//! - project_tests.rs (project management, import, analyze)
//! - daemon_tests.rs (daemon lifecycle)
//! - query_tests.rs (function, strings, memory, decompile, dump)
//! - unimplemented_tests.rs (graceful error messages)
use assert_cmd::Command;
use predicates::prelude::*;
mod common;
/// Smoke test - verifies basic CLI commands work
#[test]
fn test_smoke() {
// Version command should always work
Command::cargo_bin("ghidra")
.unwrap()
.arg("version")
.assert()
.success()
.stdout(predicate::str::contains("ghidra-cli"));
// Doctor command verifies installation
Command::cargo_bin("ghidra")
.unwrap()
.arg("doctor")
.assert()
.success();
// Config list should work
Command::cargo_bin("ghidra")
.unwrap()
.arg("config")
.arg("list")
.assert()
.success();
}