Files
ww/test/package/runtime/escaped_descendant_test.ww
Hojun-Cho 7a2c21acfb wwtest: native package-test coordinator
Single-directory package-test planner: discovers *.ww, groups white-box
and external <pkg>_test sources, composes the combined test package,
builds it through the sibling ww driver, and runs it with the runtime's
-package/-list/-timeout-ms contract. test/package holds its E2E corpus
and the manual runtime fixture set.
2026-08-07 23:01:03 +09:00

27 lines
638 B
Plaintext

package runtime_escaped_descendant_test;
import os;
import time;
@test fn escaped_writer_does_not_hold_runner() void = {
let fds: [2]i32;
assert(os.pipe(&fds) == 0);
let pid: i32 = os.fork();
assert(pid >= 0);
if (pid == 0) {
os.close(fds[0]);
if (os.setpgid(0, 0) != 0) { os.exit(120); };
let ready: u8 = 1u8;
if (os.write(fds[1], &ready, 1u64) != 1i64) { os.exit(121); };
os.close(fds[1]);
time.sleep((time.second: i64): time.duration,
time.clock.monotonic);
os.exit(0);
};
os.close(fds[1]);
let ready: u8 = 0u8;
assert(os.read(fds[0], &ready, 1u64) == 1i64);
os.close(fds[0]);
assert(ready == 1u8);
};