fix(app-iced): 探针与字体测试的子进程改走 platform::child::quiet(M272)
`cargo test --workspace` 在合并 tip f8d83d1 上被 child_quiet_guard 抓住两处绕开
`platform::child::quiet` 的子进程构造:
① `platform/motion.rs` 的 OS「减少动效」探针(M256 新增,Linux gsettings / macOS
defaults)是产品代码真回归:`run()` 里裸 `Command::new(program)`。改走 `quiet(program)`。
`quiet` 返回的就是普通 `Command`,`.spawn()` 的 `Child` 仍归 `run` 自己,所以
**300ms 超时 + 超时 kill + wait 一个字没丢**;`OnceLock` 缓存、单调用点、不在帧路径
这三条性质也原样保留(这次只换了构造器)。
② `fonts/tests.rs` 里重起自身 test binary 的那处同样改走 `quiet`;`.output()` 的管道
语义不变(已实测子进程断言仍然「1 passed」)。没有往 ALLOWED_ROLES 加白。
This commit is contained in:
1 parent
f8d83d1f77
commit
634955d323
2 files changed
+23
-3
No files matched your search
@@ -270,10 +270,14 @@ fn evaluation_starts_no_download() {
|
||||
}
|
||||
|
||||
/// 用 `current_exe()` 把本 test binary 再起一次,只跑 [`resolving_fonts_never_starts_a_download`]。
|
||||
///
|
||||
/// 子进程经 `unlucky_core::platform::child::quiet` 起(M272):仓规是全树硬约束,测试代码不是
|
||||
/// 例外——这条 test binary 本身是控制台程序,父进程将来若换到 GUI 侧(或 CI 用别的方式直接跑
|
||||
/// 二进制)也照样不该新建窗口。`quiet` 只动创建 flag,`.output()` 的管道语义一个字不变。
|
||||
fn rerun_in_own_process() {
|
||||
let exe = std::env::current_exe().expect("取本 test binary 的路径");
|
||||
let name = "fonts::tests::resolving_fonts_never_starts_a_download";
|
||||
let output = std::process::Command::new(&exe)
|
||||
let output = unlucky_core::platform::child::quiet(&exe)
|
||||
.args(["--exact", "--nocapture", "--test-threads=1", name])
|
||||
.env(CHILD_ENV, "1")
|
||||
// 截图通道的钉子会直接替换 `status()` 的返回值(`install.rs:157` 先看它),
|
||||
|
||||
Reference in new issue
Block a user