1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! Subprocess helpers for integration tests that exercise
//! `cargo ktstr` CLI subcommands by spawning the built
//! `cargo-ktstr` binary as a child process.
//!
//! The integration-test pattern is: build the CLI via
//! `env!("CARGO_BIN_EXE_cargo-ktstr")`, spawn it with the desired
//! args, capture stdout + stderr via `std::process::Output`,
//! assert on the captured bytes. Used by shell-mode lifecycle
//! and topology-inheritance tests where the assertion target is
//! the CLI's externally-visible behavior (banner, exit code,
//! routed console writes) rather than ktstr's in-process API.
pub const CARGO_KTSTR_BINARY: &str = env!;
/// Spawn `cargo ktstr shell --no-perf-mode --test <fixture>
/// --exec <payload>` and return the captured Output. Lets
/// cargo-ktstr resolve the guest kernel via its own kernel-build
/// cache rather than passing an operator-style `--kernel` path —
/// ktstr supplies the kernel itself.
///
/// The `--no-perf-mode` flag is added unconditionally — integration
/// tests run in shared CI environments where the
/// performance-mode LLC-EX lock causes nextest contention; the
/// non-perf path is sufficient for shell-mode lifecycle pins.
/// Combined stdout + stderr from a subprocess Output, with a
/// visible STDERR delimiter so failure diagnostics make the
/// stream split unambiguous. The shell-mode lifecycle marker
/// pattern routes both init-side writes (via `/proc/1/fd/1`)
/// and the payload's stdout through the same virtio-console
/// pipeline, so most assertions search the combined view; the
/// delimiter survives in panic messages so a reader can tell
/// which stream the marker landed in.