Skip to content

Commit e1a5b0e

Browse files
committed
优化 Qemu 测试执行逻辑,移除多余的子进程管理代码
1 parent 2d5973e commit e1a5b0e

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

ostool/src/step/qemu.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ impl Step for Qemu {
7878
let test_success_clone = test_success.clone();
7979

8080
self.cmd
81-
.exec_with_lines(project.is_print_cmd, move |line, child| {
81+
.exec_with_lines(project.is_print_cmd, move |line, _child| {
8282
if line.contains("All tests passed") {
8383
println!("{}", "Test passed!".green());
8484
{
@@ -89,8 +89,6 @@ impl Step for Qemu {
8989
// 启动一个线程,1秒后强制退出
9090
thread::spawn(move || {
9191
thread::sleep(Duration::from_secs(1));
92-
child.kill().expect("Failed to kill child process");
93-
child.wait().expect("Failed to wait for child process");
9492
exit(0);
9593
});
9694
}
@@ -104,8 +102,6 @@ impl Step for Qemu {
104102
// 启动一个线程,1秒后强制退出
105103
thread::spawn(move || {
106104
thread::sleep(Duration::from_secs(1));
107-
child.kill().expect("Failed to kill child process");
108-
child.wait().expect("Failed to wait for child process");
109105
exit(1);
110106
});
111107
}

0 commit comments

Comments
 (0)