Trying to fix some build errors with regression tests, but this is failing

This commit is contained in:
Eric Ratliff
2026-02-22 19:10:40 -06:00
parent d5220bea03
commit 6a0b3af330
7 changed files with 717 additions and 1 deletions

View File

@@ -914,4 +914,31 @@ fn test_monitor_sh_timestamps_work_in_watch_mode() {
"monitor_filter should be defined and used in both watch and normal mode (found {} refs)",
filter_count
);
}
// ============================================================================
// Driver auto-discovery in build/upload scripts
// ============================================================================
#[test]
fn test_build_scripts_autodiscover_driver_includes() {
let tmp = TempDir::new().unwrap();
let ctx = TemplateContext {
project_name: "drv_test".to_string(),
anvil_version: "1.0.0".to_string(),
board_name: "uno".to_string(),
fqbn: "arduino:avr:uno".to_string(),
baud: 115200,
};
TemplateManager::extract("basic", tmp.path(), &ctx).unwrap();
// All four compile scripts must auto-discover lib/drivers/*
for script in &["build.sh", "upload.sh", "build.bat", "upload.bat"] {
let content = fs::read_to_string(tmp.path().join(script)).unwrap();
assert!(
content.contains("lib/drivers") || content.contains("lib\\drivers"),
"{} must auto-discover lib/drivers/* for library include paths",
script
);
}
}