Files
NetterSilver a094ed23a9 Fail builds when required Windows resource embedding fails (#427)
The app build scripts stop the build when required Windows resources fail to embed (cargo::error instead of the ignored cargo:error). Fixes #264.
2026-11-02 23:40:59 +07:00

20 lines
818 B
Rust

//! The app build scripts must fail the build (Cargo's `cargo::error` instruction) when Windows
//! resources are required. The single-colon `cargo:error=` form is ignored by Cargo as metadata.
use std::path::Path;
fn read(rel: &str) -> String {
let path = Path::new(env!("CARGO_MANIFEST_DIR")).join(rel);
std::fs::read_to_string(&path).unwrap_or_default()
}
#[test]
fn required_windows_resource_failure_uses_cargo_error_directive() {
for rel in ["build.rs", "../craft-anything/build.rs"] {
let src = read(rel);
assert!(!src.is_empty(), "{rel} should be readable");
assert!(!src.contains("cargo:error="), "{rel} emits the ignored single-colon error directive");
assert!(src.contains("cargo::error="), "{rel} must emit cargo::error= when resources are required");
}
}