mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-24 10:41:11 +08:00
feat: 添加基准测试基础设施
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
pub fn run_rust_bench(filter: Option<&str>) -> std::process::ExitCode {
|
||||
let mut cmd = std::process::Command::new("cargo");
|
||||
cmd.args(["bench", "-p", "oxide_vm"]);
|
||||
if let Some(name) = filter {
|
||||
cmd.args(["--bench", name]);
|
||||
}
|
||||
match cmd.status() {
|
||||
Ok(status) => {
|
||||
if status.success() {
|
||||
std::process::ExitCode::SUCCESS
|
||||
} else {
|
||||
std::process::ExitCode::from(1)
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
eprintln!("Failed to run cargo bench: {}", e);
|
||||
std::process::ExitCode::from(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user