mirror of
https://github.com/encounter/ghidra-cli.git
synced 2026-07-10 03:18:56 -07:00
ugh.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
## Critical Rules
|
||||
|
||||
1. **Tests require Ghidra.** Tests use `require_ghidra!()` to check availability; when Ghidra is not installed, tests are skipped (silent pass). This is intentional for local development. CI environments must have Ghidra installed.
|
||||
1. **NEVER SKIP TESTS!** If Ghidra is not installed, the tests MUST fail. `require_ghidra!()` panics when `ghidra doctor` fails.
|
||||
2. **DEFAULT OUTPUT FORMAT** should be human and agent readable, NOT JSON. Use `--json` and `--pretty` for JSON output. Exception: when stdout is not a TTY (piped/scripted), the default auto-detects to `JsonCompact` for machine consumption — this is standard Unix pipe convention.
|
||||
|
||||
## Architecture
|
||||
|
||||
+1
-1
@@ -83,7 +83,7 @@ cargo test --test e2e --test command_tests --test output_format_integration
|
||||
|
||||
### Ghidra Installation
|
||||
|
||||
Tests assume Ghidra is installed. Use `require_ghidra!()` in tests that need a fast, explicit availability check; it skips the test (silent pass) if `ghidra doctor` fails. CI environments must have Ghidra installed.
|
||||
Tests assume Ghidra is installed. Use `require_ghidra!()` in tests that need a fast, explicit availability check; it panics (fails the test) if `ghidra doctor` fails.
|
||||
|
||||
### Test Fixtures
|
||||
|
||||
|
||||
+5
-3
@@ -342,9 +342,11 @@ macro_rules! require_ghidra {
|
||||
let output = String::from_utf8_lossy(&doctor.stdout);
|
||||
|
||||
if !output.contains("OK") || output.contains("NOT FOUND") || output.contains("FAILED") {
|
||||
eprintln!("Ghidra not properly installed, skipping test");
|
||||
eprintln!("Doctor output: {}", output);
|
||||
return;
|
||||
panic!(
|
||||
"Ghidra not properly installed — tests MUST fail without Ghidra.\n\
|
||||
Doctor output: {}",
|
||||
output
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user