0
0
mirror of https://github.com/tursodatabase/libsql.git synced 2025-01-08 18:49:04 +00:00
libsql/libsql-server/tests/bootstrap.rs
2024-09-11 10:07:06 +02:00

33 lines
776 B
Rust

use std::path::PathBuf;
use std::process::Command;
#[test]
fn bootstrap() {
let iface_files = &["proto/admin_shell.proto"];
let dirs = &["proto"];
let out_dir = PathBuf::from(std::env!("CARGO_MANIFEST_DIR"))
.join("src")
.join("generated");
let config = prost_build::Config::new();
tonic_build::configure()
.build_client(true)
.build_server(true)
.build_transport(true)
.out_dir(&out_dir)
.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");
}