test: add Linux rig validation suite
Runs encoder verification, Wayland and X11 capture with segment and remux checks, and five failure scenarios that must end in an honest failed status: source lost, window closed, unwritable segments, low disk space and a portal that grants no source.
This commit is contained in:
@@ -324,6 +324,7 @@ fn record(options: &Options) -> Result<bool, Box<dyn std::error::Error>> {
|
||||
Duration::from_secs(options.segment_seconds as u64),
|
||||
);
|
||||
let mut status = RecordingStatus::Starting;
|
||||
let mut recorded = false;
|
||||
println!("t={} status={}", elapsed(), status.label());
|
||||
|
||||
let stop_at = started + Duration::from_secs(options.seconds);
|
||||
@@ -349,6 +350,7 @@ fn record(options: &Options) -> Result<bool, Box<dyn std::error::Error>> {
|
||||
health.written_bytes
|
||||
);
|
||||
report_status(&mut status, tracker.sample(&health, now), &elapsed());
|
||||
recorded |= status == RecordingStatus::Recording;
|
||||
}
|
||||
if !stopping && (now >= stop_at || matches!(status, RecordingStatus::Failed { .. })) {
|
||||
stopping = true;
|
||||
@@ -382,7 +384,10 @@ fn record(options: &Options) -> Result<bool, Box<dyn std::error::Error>> {
|
||||
if let Some(token) = recording.restore_token() {
|
||||
println!("restore_token={token}");
|
||||
}
|
||||
Ok(outcome == Some(StopReason::Success) && !matches!(status, RecordingStatus::Failed { .. }))
|
||||
println!("recorded={recorded}");
|
||||
Ok(recorded
|
||||
&& outcome == Some(StopReason::Success)
|
||||
&& !matches!(status, RecordingStatus::Failed { .. }))
|
||||
}
|
||||
|
||||
fn report_status(shown: &mut RecordingStatus, current: &RecordingStatus, elapsed: &str) {
|
||||
|
||||
Reference in New Issue
Block a user