use panic_attacker::xray;
use std::path::Path;
#[test]
#[ignore] fn test_echidna_baseline() {
let echidna_path = Path::new("/var/mnt/eclipse/repos/echidna");
if !echidna_path.exists() {
eprintln!("⚠️ Skipping: echidna repo not found");
return;
}
let report = xray::analyze(echidna_path).expect("echidna analysis should succeed");
assert_eq!(report.language, panic_attacker::types::Language::Rust);
assert!(
report.weak_points.len() >= 10 && report.weak_points.len() <= 20,
"Expected 10-20 weak points, got {}",
report.weak_points.len()
);
for wp in &report.weak_points {
assert!(
wp.location.is_some(),
"Weak point missing location: {:?}",
wp
);
}
assert!(!report.frameworks.is_empty());
assert!(!report.file_statistics.is_empty());
assert!(
report.file_statistics.len() >= 40,
"Expected 40+ files with findings"
);
println!(
"✅ echidna baseline validated: {} weak points",
report.weak_points.len()
);
}
#[test]
#[ignore] fn test_eclexia_baseline() {
let eclexia_path = Path::new("/var/mnt/eclipse/repos/eclexia");
if !eclexia_path.exists() {
eprintln!("⚠️ Skipping: eclexia repo not found");
return;
}
let report = xray::analyze(eclexia_path).expect("eclexia analysis should succeed");
assert_eq!(report.language, panic_attacker::types::Language::Rust);
assert!(
report.weak_points.len() >= 5 && report.weak_points.len() <= 10,
"Expected 5-10 weak points, got {}",
report.weak_points.len()
);
for wp in &report.weak_points {
assert!(
wp.location.is_some(),
"Weak point missing location: {:?}",
wp
);
}
assert!(!report.file_statistics.is_empty());
assert!(
report.file_statistics.len() >= 40,
"Expected 40+ files with findings"
);
println!(
"✅ eclexia baseline validated: {} weak points",
report.weak_points.len()
);
}
#[test]
#[ignore] fn test_panic_attacker_on_itself() {
let self_path = Path::new(env!("CARGO_MANIFEST_DIR"));
let report = xray::analyze(self_path).expect("self-analysis should succeed");
assert_eq!(report.language, panic_attacker::types::Language::Rust);
assert!(
report.weak_points.len() <= 5,
"panic-attacker should have ≤5 weak points, got {}",
report.weak_points.len()
);
for wp in &report.weak_points {
assert!(wp.location.is_some());
}
println!(
"✅ Self-test passed: {} weak points found",
report.weak_points.len()
);
}