mpv
mpv copied to clipboard
test/libmpv_test: add default track selection testing
The amount of options we have that are related track selection is insane and touching any of this stuff is scary. Add some track selection testing to the CI to hopefully make it slightly less scary to touch any of that. Since trying to work in media files from some outside source would be a pain and need to live in some repo somewhere, it's nicer to just generate dummy files on the fly with ffmpeg during the ci runs and use that. Obviously, the actual tests themselves could be even more thorough (external tracks were not even considered), but this is more than a good enough start for now.
Read this before you submit this pull request: https://github.com/mpv-player/mpv/blob/master/DOCS/contribute.md
Reading this link and following the rules will get your pull request reviewed and merged faster. Nobody wants lazy pull requests.
Download the artifacts for this pull request:
~Just for the record, I excluded the mingw, win32 (laziness) , openbsd (the ffmpeg commands got stuck), and ffmpeg 4.4 (the ffmpeg commands are bugged and give wrong output) from running the track selection tests.~
Edit: dated.
I reworked this so the libmpv_test.c file is split into separate files for every single test it does. Relevant functions are shared inline in libmpv_shared.h now. libmpv_test_track_selection.c uses meson custom targets as well.
edit: openbsd fails the test for some reason. Will take a look later.
openbsd fails the test for some reason. Will take a look later.
Fixed now. It's because openbsd had the old ffmpeg version (4.4) in its path and that version has a bug when setting forced tracks causing the test to fail. I don't believe there is a way for find_program to find something at compile time instead of configure time (at least it didn't seem to work for me), so it doesn't seem possible to use the ffmpeg binary that would be generated during compilation. So instead, I just added some version checks so this particular test is skipped.
Program ffmpeg found: NO
I think we should ensure that at least on linux ci the ffmpeg is there.
I think we should ensure that at least on linux ci the ffmpeg is there.
It just needs to thrown on the tumbleweed container. cc @llyyr.
I think we should ensure that at least on linux ci the ffmpeg is there.
Done, the new image should be there in 15-20 mins.
Program ffmpeg found: YES 7.1 7.1 (/usr/bin/ffmpeg)
Thanks, it's there now.