History

test/libmpv_test_track_selection: add a test for os languages

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.

Dudemanguy committed 1 year ago

Commit 87359741 parent ef3e6be2 files · +78 −1Browse files

Showing the changes to test/samples (1 of 2 files). Show all

Unified · Split

test/samples/meson.build+7−1
@@ -32,6 +32,11 @@ samples = { · 31 unmodified lines
32 '-disposition:s:0', 'forced', '@OUTPUT@'],32 '-disposition:s:0', 'forced', '@OUTPUT@'],
33 'eng_no_default.mkv':33 'eng_no_default.mkv':
34 [ffmpeg, common_args, '@OUTPUT@'],34 [ffmpeg, common_args, '@OUTPUT@'],
35 'locale.mkv':
36 [ffmpeg, '-v', 'error', '-y', '-i', video, '-i', audio, '-f', 'srt', '-i', sub, '-i', sub,
37 '-c', 'copy', '-map', '0:0', '-map', '1:0', '-map', '2:0', '-map', '3:0', '-metadata:s:s:0',
38 'language=ger', '-metadata:s:s:1', 'language=eng', '-disposition:s:0', 'default',
39 '-disposition:s:1', 'default', '@OUTPUT@'],
35 'multilang.mkv':40 'multilang.mkv':
36 [ffmpeg, '-v', 'error', '-y', '-i', video, '-i', audio, '-i', audio, '-i', audio, '-i', audio,41 [ffmpeg, '-v', 'error', '-y', '-i', video, '-i', audio, '-i', audio, '-i', audio, '-i', audio,
37 '-f', 'srt', '-i', sub, '-i', sub, '-i', sub, '-i', sub, '-c', 'copy', '-map', '0:0',42 '-f', 'srt', '-i', sub, '-i', sub, '-i', sub, '-i', sub, '-c', 'copy', '-map', '0:0',
@@ -57,9 +62,10 @@ foreach name, cmd: samples · 19 unmodified lines
57 depends: [video, audio],62 depends: [video, audio],
58 command: cmd,63 command: cmd,
59 )64 )
65 env = name == 'locale.mkv' ? 'LANG=C' : []
60 testname = 'libmpv-test-' + name66 testname = 'libmpv-test-' + name
61 exe = executable(testname, '../libmpv_test_track_selection.c',67 exe = executable(testname, '../libmpv_test_track_selection.c',
62 include_directories: incdir, link_with: libmpv)68 include_directories: incdir, link_with: libmpv)
63 test(testname, exe, args: [name, target.full_path()],69 test(testname, exe, args: [name, target.full_path()],
64 depends: target, suite: 'libmpv')70 depends: target, env: env, suite: 'libmpv')
65endforeach71endforeach

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t