Rust unit tests
cargo test -p daw-engine --lib runs the engine’s unit tests. They need no audio device.
They cover, among others: loops and real copies, routing order and loop pruning (model/tests.rs, model/routing_tests.rs);
the click’s levels, accent, divisions and delay compensation (dsp/tests.rs); delay line taps and the
PDC solver; take folder comping, crossfades and recording plans (takes.rs); fade curves,
crossfade gain sums and placement (fades.rs, session/crossfades.rs); automation
evaluation and thinning; Channel EQ filters; resampling; transient detection; Standard MIDI
Files; bounce trimming, normalizing and 16-bit dither; range edits; autosave and recovery,
undo limits and recording placement (session/options.rs); crash-recovery journals,
recovering interrupted takes, atomic saves with a backup and falling back from a damaged
project.json (session/recovery.rs); repairing the WAV headers a crash leaves, for every format
the recorder writes (wav_repair.rs); preferences parsing; the recorder’s bit depths; the tempo map; contain(); preset files and names (presets.rs)
and the preset a slot or Channel EQ has loaded, through undo, saving and renamed or deleted user presets (session/preset_tests.rs);
parameter normalization and dynamics effects’ gain reduction (dsp/builtin.rs); channel
strip settings (copy and paste through JSON, onto audio and instrument tracks, missing plug-ins,
Reset, setting files: strip_settings.rs, session/strip_settings.rs); the clip indicators’
peak holds (session/strip_meters.rs); and each built-in effect’s DSP (fx/*.rs: the
Limiter’s ceiling and latency, the Reverb’s stability, the Tuner’s accuracy, the Loudness
Meter’s BS.1770 weighting and true peak, the Linear Phase EQ’s kernels, and more). The
modules added since cover their own pure parts too: region playback parameters
(region_params.rs), patterns (pattern.rs), comps and MIDI take folders (takes.rs), the
drag modes and Move Automation with Regions (drag_modes.rs, auto_move.rs), the
Arrangement track’s and the arranging commands’ time maps (arrangement.rs,
arrange_cmds.rs), Strip Silence, VCAs (vca.rs), controller assignments
(controllers.rs), and the session modules that apply them (session/*.rs). The worker pool’s
tests (dsp/pool.rs, dsp/parallel.rs) include workers refused real-time priority and a worker
stuck in a plug-in, left there while the rest plays on (its thread stays blocked until the test
lets the plug-in return, or for good in the one that drops the pool around it). Where the system grants real-time priority (rtkit), one of them makes a
real-time worker spin without sleeping past RLIMIT_RTTIME’s 200 ms: if the pool failed to demote
it, the kernel would kill the test binary (SIGKILL), so a run that ends that way is a failure.
cargo test -p daw runs the Tauri crate’s tests (old and partly malformed settings.json
files load with defaults; the menu bar’s spec, reading key specs, and, on Linux, that GTK draws
each key in tests/gtkKeyLabels.json as the app writes it). On Linux schemas.rs’s tests need
GTK’s file chooser schema on the search path, as the dev shell and an Ubuntu with GTK have it;
two of them rerun the test binary with XDG_DATA_DIRS changed, to see that a missing schema
is reported and that startup finds it again.
Marbble is released under the MIT licence.Source on GitHub.