mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-29 08:41:29 +00:00
* test(ffmpeg): use the test binary as a fake ffmpeg so process specs run on Windows The stderr capture, cancellation and ConvertAnimatedImage specs started /bin/sh, sleep, powershell or true, and several skipped on Windows. TestMain now turns the test binary into a fake ffmpeg that writes the given stdout and stderr, sleeps, and exits with the given code, so the same specs run everywhere. The probeClientReason and probeDetail specs only need an *exec.ExitError, so they now build one instead of starting a process. Part of #5381. * test: move the fake process trick into a shared tests/fakeproc helper The mpv and ffmpeg suites each had their own TestMain that turned the test binary into a fake child process. tests/fakeproc now holds that: a package calls fakeproc.Main from TestMain, and a spec calls fakeproc.Install with a Behavior (echo args, stdout, stderr, sleep, exit code) to get the binary to start. Install also sets GORACE so a fake that exits 0 skips the race detector's one second exit sleep.