Sprint 0 — industrialisation : CI, tracing, tests xdg-shell, GPLv3
5 livrables d'industrialisation posés avant la phase 13 (client réel). - .gitlab-ci.yml : pipeline minimal (fmt-check + tests core + tests frontend nightly). Pas de cross-compile Redox dans le MVP. - rustfmt.toml + fmt.sh : config formatter racine + boucle sur les 23 crates ; fmt sweep appliqué (d'où les diffs cosmétiques). - tracing dans wayland-frontend : 22 println/eprintln remplacés par debug/info/warn/error selon sévérité. Préfixe "[frontend]" supprimé (le target tracing le fournit). - tracing-subscriber dans le compositor : TeeWriter écrit sur stdout + /scheme/debug, filtre via RUST_LOG (défaut info). DebugSink/dlog supprimés. - 15 tests unitaires xdg-shell après extraction de 2 helpers libres (clamp_to_min_max + should_throttle_configure). Couvre compute_resize_geom, contraintes min/max et throttling configure. - LICENSE (GPLv3 texte officiel FSF) + .editorconfig. Total tests : 27 → 42 automatisés (compositor-core + frontend). Leyoda 2026 – GPLv3
This commit is contained in:
parent
2150f31d82
commit
8795f39f08
30 changed files with 1373 additions and 298 deletions
|
|
@ -45,9 +45,21 @@ fn run() -> Result<(), String> {
|
|||
|
||||
// ---- Subtest A: timeout-only, no fd ready ----
|
||||
let mut pfds = [
|
||||
libc::pollfd { fd: ra, events: libc::POLLIN, revents: 0 },
|
||||
libc::pollfd { fd: rb, events: libc::POLLIN, revents: 0 },
|
||||
libc::pollfd { fd: rc, events: libc::POLLIN, revents: 0 },
|
||||
libc::pollfd {
|
||||
fd: ra,
|
||||
events: libc::POLLIN,
|
||||
revents: 0,
|
||||
},
|
||||
libc::pollfd {
|
||||
fd: rb,
|
||||
events: libc::POLLIN,
|
||||
revents: 0,
|
||||
},
|
||||
libc::pollfd {
|
||||
fd: rc,
|
||||
events: libc::POLLIN,
|
||||
revents: 0,
|
||||
},
|
||||
];
|
||||
let n = poll_revents(&mut pfds, 50)?;
|
||||
if n != 0 {
|
||||
|
|
@ -62,12 +74,16 @@ fn run() -> Result<(), String> {
|
|||
return Err(format!("write to wb: {}", errno_str()));
|
||||
}
|
||||
|
||||
for p in pfds.iter_mut() { p.revents = 0; }
|
||||
for p in pfds.iter_mut() {
|
||||
p.revents = 0;
|
||||
}
|
||||
let n = poll_revents(&mut pfds, 1000)?;
|
||||
if n != 1 {
|
||||
return Err(format!("expected 1 ready fd, got {n}"));
|
||||
}
|
||||
let ready: Vec<_> = pfds.iter().enumerate()
|
||||
let ready: Vec<_> = pfds
|
||||
.iter()
|
||||
.enumerate()
|
||||
.filter(|(_, p)| p.revents & libc::POLLIN != 0)
|
||||
.map(|(i, _)| i)
|
||||
.collect();
|
||||
|
|
@ -85,22 +101,33 @@ fn run() -> Result<(), String> {
|
|||
|
||||
// ---- Subtest C: close write end of A, expect HUP on read end ----
|
||||
libc::close(wa);
|
||||
for p in pfds.iter_mut() { p.revents = 0; }
|
||||
for p in pfds.iter_mut() {
|
||||
p.revents = 0;
|
||||
}
|
||||
let n = poll_revents(&mut pfds, 100)?;
|
||||
if n < 1 {
|
||||
return Err(format!("expected at least 1 ready (POLLHUP on ra), got {n}"));
|
||||
return Err(format!(
|
||||
"expected at least 1 ready (POLLHUP on ra), got {n}"
|
||||
));
|
||||
}
|
||||
let hup_a = pfds[0].revents & (libc::POLLHUP | libc::POLLIN) != 0;
|
||||
if !hup_a {
|
||||
return Err(format!("expected HUP/IN on ra, revents={:#x}", pfds[0].revents));
|
||||
return Err(format!(
|
||||
"expected HUP/IN on ra, revents={:#x}",
|
||||
pfds[0].revents
|
||||
));
|
||||
}
|
||||
println!("[test-04] C: closing wa caused POLLHUP/POLLIN on ra (revents={:#x})",
|
||||
pfds[0].revents);
|
||||
println!(
|
||||
"[test-04] C: closing wa caused POLLHUP/POLLIN on ra (revents={:#x})",
|
||||
pfds[0].revents
|
||||
);
|
||||
|
||||
// Cleanup
|
||||
libc::close(ra);
|
||||
libc::close(rb); libc::close(wb);
|
||||
libc::close(rc); libc::close(wc);
|
||||
libc::close(rb);
|
||||
libc::close(wb);
|
||||
libc::close(rc);
|
||||
libc::close(wc);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue