mpv icon indicating copy to clipboard operation
mpv copied to clipboard

test/libmpv_test: add default track selection testing

Open Dudemanguy opened this issue 1 year ago • 2 comments

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.

Dudemanguy avatar Jun 20 '24 03:06 Dudemanguy

~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.

Dudemanguy avatar Jun 20 '24 05:06 Dudemanguy

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.

Dudemanguy avatar Jan 24 '25 04:01 Dudemanguy

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.

Dudemanguy avatar Jan 24 '25 17:01 Dudemanguy

Program ffmpeg found: NO

I think we should ensure that at least on linux ci the ffmpeg is there.

kasper93 avatar Jan 25 '25 22:01 kasper93

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.

Dudemanguy avatar Jan 28 '25 16:01 Dudemanguy

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.

llyyr avatar Jan 29 '25 01:01 llyyr

Program ffmpeg found: YES 7.1 7.1 (/usr/bin/ffmpeg)

Thanks, it's there now.

Dudemanguy avatar Jan 29 '25 01:01 Dudemanguy