5bee7092d3
- Add insta dev-dependency for visual regression testing - Create lib.rs to expose modules for integration tests - Add snapshot tests for progress_bar, topbar, library, help modal - Add unit tests for LibraryState navigation - Move all tests to tests/ directory (proper Rust convention) - Make build.rs skip proto compilation when protoc unavailable - Add docs/testing-possible-solutions.md with testing strategies
23 lines
657 B
Rust
23 lines
657 B
Rust
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
let proto_root = "../music-agregator/proto";
|
|
let proto_file = format!("{}/music_agregator/v1/music_agregator.proto", proto_root);
|
|
|
|
let proto_file_exists = std::path::Path::new(&proto_file).exists();
|
|
let protoc_available = std::process::Command::new("protoc")
|
|
.arg("--version")
|
|
.output()
|
|
.is_ok();
|
|
|
|
if !proto_file_exists || !protoc_available {
|
|
return Ok(());
|
|
}
|
|
|
|
tonic_build::configure()
|
|
.build_server(false)
|
|
.build_client(true)
|
|
.out_dir("src/proto")
|
|
.compile_protos(&[proto_file], &[proto_root])?;
|
|
|
|
Ok(())
|
|
}
|