The purpose of this test is mostly to verify that matching the OS
language is not wrongly prioritized over other things (like the forced
flag, matching the audio language, etc).
This is a copy of the existing locale test, but with forced flag added
to all tracks. The forced flag should not affect language selection in
this case.
These functions could be useful for any libmpv test and in fact
check_string was already duplicated in a couple of places. Inline them
in libmpv_common.
Relevant for the forced subtitle case where we want a regional audio
language like en-US to match eng language subtitles. The general
matching logic is covered in the language test already.
This test requires that the OS language settings be English so the
--subs-match-os-language option is actually testable. In Linux, this can
be done by just setting LANG and it always will work. For macOS and
Windows, we use the OS APIs to get the languages and let the test
proceed if we find English. Gracefully fail and skip otherwise.
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.