mirror of
https://github.com/tursodatabase/libsql.git
synced 2024-12-15 15:39:52 +00:00
34 lines
888 B
Rust
34 lines
888 B
Rust
use std::{path::PathBuf, process::Command};
|
|
|
|
#[test]
|
|
fn bootstrap() {
|
|
let iface_files = &["proto/storage.proto"];
|
|
let dirs = &["storage"];
|
|
|
|
let out_dir = PathBuf::from(std::env!("CARGO_MANIFEST_DIR"))
|
|
.join("src")
|
|
.join("generated");
|
|
|
|
let mut config = prost_build::Config::new();
|
|
config.bytes([".wal_log"]);
|
|
|
|
tonic_build::configure()
|
|
.build_client(true)
|
|
.build_server(true)
|
|
.build_transport(true)
|
|
.out_dir(&out_dir)
|
|
.type_attribute(".proxy", "#[derive(serde::Serialize, serde::Deserialize)]")
|
|
.compile_with_config(config, iface_files, dirs)
|
|
.unwrap();
|
|
|
|
let status = Command::new("git")
|
|
.arg("diff")
|
|
.arg("--exit-code")
|
|
.arg("--")
|
|
.arg(&out_dir)
|
|
.status()
|
|
.unwrap();
|
|
|
|
assert!(status.success(), "You should commit the protobuf files");
|
|
}
|