mirror of
https://github.com/zhom/donutbrowser.git
synced 2026-04-24 12:56:31 +02:00
22 lines
530 B
Rust
22 lines
530 B
Rust
use std::path::PathBuf;
|
|
use std::process::Command;
|
|
|
|
/// Utility functions for integration tests
|
|
pub struct TestUtils;
|
|
|
|
impl TestUtils {
|
|
/// Execute a command (generic, for donut-proxy tests)
|
|
#[allow(dead_code)]
|
|
pub async fn execute_command(
|
|
binary_path: &PathBuf,
|
|
args: &[&str],
|
|
) -> Result<std::process::Output, Box<dyn std::error::Error + Send + Sync>> {
|
|
let mut cmd = Command::new(binary_path);
|
|
cmd.args(args);
|
|
|
|
let output = tokio::process::Command::from(cmd).output().await?;
|
|
|
|
Ok(output)
|
|
}
|
|
}
|