Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2

- name: Install cargo-audit
run: cargo install cargo-audit

- name: Cache apt packages
if: contains(matrix.os, 'ubuntu')
uses: actions/cache@v4
Expand Down Expand Up @@ -65,6 +68,9 @@ jobs:
- name: Check formatting
run: cargo fmt --check

- name: Audit dependencies
run: cargo audit

- name: Run Clippy
run: cargo clippy --all-targets -- -D warnings

Expand Down
4 changes: 4 additions & 0 deletions src/engine/midi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2165,6 +2165,10 @@ mod tests {
use std::path::PathBuf;
use std::sync::Arc;

#[cfg_attr(
all(miri, target_os = "freebsd"),
ignore = "Tokio runtime uses kqueue, which Miri does not support on FreeBSD"
)]
#[test]
fn midi_learn_monitor_toggle_flips_all_lanes() {
let runtime = tokio::runtime::Runtime::new().expect("tokio runtime");
Expand Down
60 changes: 60 additions & 0 deletions src/engine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,10 @@ mod tests {
assert_eq!(handle.lock().rt.transport_sample, 1_256);
}

#[cfg_attr(
all(miri, target_os = "freebsd"),
ignore = "Tokio runtime uses kqueue, which Miri does not support on FreeBSD"
)]
#[tokio::test]
async fn inline_completion_advances_without_replaying_startup_block() {
for (inline, seek_pending, advances) in [
Expand All @@ -570,6 +574,10 @@ mod tests {
}
}

#[cfg_attr(
all(miri, target_os = "freebsd"),
ignore = "Tokio runtime uses kqueue, which Miri does not support on FreeBSD"
)]
#[tokio::test]
async fn inline_loop_wrap_reanchors_capture_without_silencing_audio() {
let (mut engine, _client_rx) = make_engine_with_client();
Expand Down Expand Up @@ -612,6 +620,10 @@ mod tests {
assert!(engine.inline_render.take_outcome().unwrap().stale);
}

#[cfg_attr(
all(miri, target_os = "freebsd"),
ignore = "Tokio runtime uses kqueue, which Miri does not support on FreeBSD"
)]
#[tokio::test]
async fn recording_peaks_query_reports_real_take_bounds_and_channel_extrema() {
let (mut engine, mut rx) = make_engine_with_client();
Expand Down Expand Up @@ -781,6 +793,10 @@ mod tests {
assert!(!engine.rt_inline_enabled);
}

#[cfg_attr(
all(miri, target_os = "freebsd"),
ignore = "Tokio runtime uses kqueue, which Miri does not support on FreeBSD"
)]
#[tokio::test]
async fn iodelay_calibration_applies_measured_total_and_blocks_during_recording() {
let (mut engine, mut client_rx) = make_engine_with_client();
Expand Down Expand Up @@ -860,6 +876,10 @@ mod tests {
assert_eq!(engine.recording.discard_remaining_frames, 0);
}

#[cfg_attr(
all(miri, target_os = "freebsd"),
ignore = "Tokio runtime uses kqueue, which Miri does not support on FreeBSD"
)]
#[tokio::test]
async fn overlapping_added_clips_preserve_supplied_fades() {
let (mut engine, _client_rx) = make_engine_with_client();
Expand Down Expand Up @@ -918,6 +938,10 @@ mod tests {
}
}

#[cfg_attr(
all(miri, target_os = "freebsd"),
ignore = "Tokio runtime uses kqueue, which Miri does not support on FreeBSD"
)]
#[tokio::test]
async fn enabled_fades_are_clamped_to_minimum_on_add_and_set() {
let (mut engine, _client_rx) = make_engine_with_client();
Expand Down Expand Up @@ -1022,6 +1046,10 @@ mod tests {
engine.publish_state_snapshot();
}

#[cfg_attr(
all(miri, target_os = "freebsd"),
ignore = "Tokio runtime uses kqueue, which Miri does not support on FreeBSD"
)]
#[test]
fn reset_meters_after_stop_decays_to_silence_over_one_second() {
let (mut engine, _client_rx) = make_engine_with_client();
Expand Down Expand Up @@ -1074,6 +1102,10 @@ mod tests {
);
}

#[cfg_attr(
all(miri, target_os = "freebsd"),
ignore = "Tokio runtime uses kqueue, which Miri does not support on FreeBSD"
)]
#[tokio::test]
async fn same_track_audio_connect_creates_internal_passthrough() {
let (mut engine, _client_rx) = make_engine_with_client();
Expand All @@ -1095,6 +1127,10 @@ mod tests {
);
}

#[cfg_attr(
all(miri, target_os = "freebsd"),
ignore = "Tokio runtime uses kqueue, which Miri does not support on FreeBSD"
)]
#[tokio::test]
async fn same_track_midi_connect_creates_internal_passthrough() {
let (mut engine, _client_rx) = make_engine_with_client();
Expand All @@ -1116,6 +1152,10 @@ mod tests {
);
}

#[cfg_attr(
all(miri, target_os = "freebsd"),
ignore = "Tokio runtime uses kqueue, which Miri does not support on FreeBSD"
)]
#[tokio::test]
async fn folder_inner_connections_restore_like_session_load() {
use crate::connectable::ConnectableRef;
Expand Down Expand Up @@ -1469,6 +1509,10 @@ mod tests {
assert_eq!(engine.dispatch.pending_requests.len(), 1);
}

#[cfg_attr(
all(miri, target_os = "freebsd"),
ignore = "Tokio runtime uses kqueue, which Miri does not support on FreeBSD"
)]
#[tokio::test]
async fn offline_bounce_queue_starts_only_one_stem_at_a_time() {
let (mut engine, _client_rx) = make_engine_with_client();
Expand Down Expand Up @@ -1519,6 +1563,10 @@ mod tests {
}
}

#[cfg_attr(
all(miri, target_os = "freebsd"),
ignore = "Tokio runtime uses kqueue, which Miri does not support on FreeBSD"
)]
#[tokio::test]
async fn offline_bounce_queue_without_ready_worker_returns() {
let (mut engine, _client_rx) = make_engine_with_client();
Expand Down Expand Up @@ -3467,6 +3515,10 @@ mod tests {
false
}

#[cfg_attr(
all(miri, target_os = "freebsd"),
ignore = "Tokio runtime uses kqueue, which Miri does not support on FreeBSD"
)]
#[tokio::test]
async fn moving_nested_folder_preserves_child_routes() {
let (mut engine, _client_rx) = make_engine_with_client();
Expand Down Expand Up @@ -4039,6 +4091,10 @@ mod tests {
/// and drains at the cycle boundary with the full silence broadcast:
/// transport stops, hw worker receives HWSetPlaying(false) AND
/// HWZeroFillBuffers.
#[cfg_attr(
all(miri, target_os = "freebsd"),
ignore = "Tokio runtime uses kqueue, which Miri does not support on FreeBSD"
)]
#[tokio::test]
async fn stop_is_queued_and_broadcasts_zero_fill_at_cycle_boundary() {
let (mut engine, _client_rx) = make_engine_with_client();
Expand Down Expand Up @@ -4085,6 +4141,10 @@ mod tests {

/// Without an active transport (nothing can schedule a hw cycle), the
/// queued stop drains immediately.
#[cfg_attr(
all(miri, target_os = "freebsd"),
ignore = "Tokio runtime uses kqueue, which Miri does not support on FreeBSD"
)]
#[tokio::test]
async fn stop_without_active_transport_is_handled_immediately() {
let (mut engine, _client_rx) = make_engine_with_client();
Expand Down
16 changes: 16 additions & 0 deletions src/hw/oss/audio_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,10 @@ mod tests {
result
}

#[cfg_attr(
all(miri, target_os = "freebsd"),
ignore = "Syscall open is not supported by Miri"
)]
#[test]
fn mapped_period_wraps_without_overwriting_other_frames() {
let mut audio = mapped_audio();
Expand All @@ -707,6 +711,10 @@ mod tests {
assert_eq!(write.write_position, 12);
}

#[cfg_attr(
all(miri, target_os = "freebsd"),
ignore = "Syscall open is not supported by Miri"
)]
#[test]
fn late_write_keeps_the_unplayed_suffix() {
let mut audio = mapped_audio();
Expand All @@ -717,6 +725,10 @@ mod tests {
assert_eq!(ring(&audio), [3, 4, 0, 0, 0, 0, 0, 0]);
}

#[cfg_attr(
all(miri, target_os = "freebsd"),
ignore = "Syscall open is not supported by Miri"
)]
#[test]
fn full_ring_retains_pending_output_until_space_opens() {
let mut audio = mapped_audio();
Expand All @@ -734,6 +746,10 @@ mod tests {
assert_eq!(ring(&audio), [0, 0, 0, 0, 1, 2, 3, 4]);
}

#[cfg_attr(
all(miri, target_os = "freebsd"),
ignore = "Syscall open is not supported by Miri"
)]
#[test]
fn capture_prefetch_does_not_advance_primary_period() {
let mut audio = mapped_audio();
Expand Down
4 changes: 4 additions & 0 deletions src/hw/oss/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,10 @@ mod tests {
/// stop again. Readable proxies (the hardware refuses a ring read-back
/// mapping): DMA advancing during stop, and post-resume cycles at block
/// rate with no underrun accumulation.
#[cfg_attr(
all(miri, target_os = "freebsd"),
ignore = "Syscall open is not supported by Miri"
)]
#[test]
fn play_stop_play_stop_keeps_dma_healthy() {
let device = std::env::var("OSS_TEST_DEVICE").unwrap_or_else(|_| "/dev/dsp5".to_string());
Expand Down
Loading