Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
37c31970 by Alexandre Janniaux at 2026-01-23T21:12:37+01:00
meson: add enabled key for tests

Allow to conditionally disable tests while keeping them registered in
the vlc_tests dictionary. Similar to the handling for plugins.

- - - - -
a0d986d2 by Alexandre Janniaux at 2026-01-23T21:12:37+01:00
meson: add support for wrapper driver in tests

This allow running some tests in wrappers like xvfb-run, which will be
used in follow-up tests.

- - - - -
6717b868 by Alexandre Janniaux at 2026-01-23T21:12:37+01:00
test: meson: use enabled

- - - - -


2 changed files:

- test/meson.build
- test/modules/meson.build


Changes:

=====================================
test/meson.build
=====================================
@@ -26,6 +26,8 @@ foreach vlc_test: vlc_tests
         'objc_args',
         'include_directories',
         'env',
+        'enabled',
+        'wrapper',
     ]
 
     foreach key : vlc_test.keys()
@@ -35,6 +37,11 @@ foreach vlc_test: vlc_tests
         endif
     endforeach
 
+    # Skip disabled tests
+    if not vlc_test.get('enabled', true)
+        continue
+    endif
+
     common_args = [
         '-DSRCDIR="@0@"'.format(vlc_src_root + '/test/'),
         '-DTOP_BUILDDIR="@0@"'.format(vlc_build_root),
@@ -72,22 +79,41 @@ foreach vlc_test: vlc_tests
             dependencies: qt6_dep)
     endif
 
-    test(vlc_test['name'],
-        executable(vlc_test['name'], vlc_test['sources'], moc_sources,
-            build_by_default: false,
-            link_with: [vlc_test.get('link_with', []),
-                vlc_libcompat],
-            link_args: [vlc_test.get('link_args', [])],
-            include_directories: [vlc_test.get('include_directories', []),
-                vlc_include_dirs],
-            dependencies: [vlc_test.get('dependencies', []),
-                libvlccore_deps, opengl_dep],
-            c_args: [vlc_test.get('c_args', []), common_args],
-            cpp_args: [vlc_test.get('cpp_args', []), common_args],
-            objc_args: [vlc_test.get('objc_args', []), common_args]),
+    test_exe = executable(vlc_test['name'], vlc_test['sources'], moc_sources,
+        build_by_default: false,
+        link_with: [vlc_test.get('link_with', []),
+            vlc_libcompat],
+        link_args: [vlc_test.get('link_args', [])],
+        include_directories: [vlc_test.get('include_directories', []),
+            vlc_include_dirs],
+        dependencies: [vlc_test.get('dependencies', []),
+            libvlccore_deps, opengl_dep],
+        c_args: [vlc_test.get('c_args', []), common_args],
+        cpp_args: [vlc_test.get('cpp_args', []), common_args],
+        objc_args: [vlc_test.get('objc_args', []), common_args])
+
+    # Handle optional test wrapper (e.g., xvfb-run for X11 tests)
+    # The wrapper must be a program object
+    if vlc_test.has_key('wrapper')
+        test_wrapper = vlc_test['wrapper']
+        if test_wrapper.found()
+            test(vlc_test['name'],
+                test_wrapper,
+                args: [test_exe],
+                env: vlc_test.get('env', []),
+                suite: [vlc_test.get('suite', []), 'test'],
+                depends: [test_modules_deps])
+        else
+            warning('Test \'@0@\' skipped: wrapper not found'.format(
+                vlc_test['name']))
+        endif
+    else
+        test(vlc_test['name'],
+            test_exe,
             env: vlc_test.get('env', []),
-        suite: [vlc_test.get('suite', []), 'test'],
-        depends: [test_modules_deps])
+            suite: [vlc_test.get('suite', []), 'test'],
+            depends: [test_modules_deps])
+    endif
 endforeach
 
 libvlc_demux_defines = []


=====================================
test/modules/meson.build
=====================================
@@ -108,7 +108,6 @@ vlc_tests += {
     'module_depends' : vlc_plugins_targets.keys()
 }
 
-if opengl_dep.found()
 vlc_tests += {
     'name' : 'test_modules_video_output_opengl_filters',
     'sources' : files(
@@ -125,11 +124,10 @@ vlc_tests += {
     'suite' : ['modules', 'test_modules'],
     'link_with' : [libvlc, libvlccore],
     'c_args' : ['-DVLC_TEST_OPENGL_API=VLC_OPENGL'],
-    'module_depends' : vlc_plugins_targets.keys()
+    'module_depends' : vlc_plugins_targets.keys(),
+    'enabled' : opengl_dep.found(),
 }
-endif
 
-if opengles2_dep.found()
 vlc_tests += {
     'name' : 'test_modules_video_output_opengl_es2_filters',
     'sources' : files(
@@ -146,9 +144,9 @@ vlc_tests += {
     'suite' : ['modules', 'test_modules'],
     'link_with' : [libvlc, libvlccore],
     'c_args' : ['-DVLC_TEST_OPENGL_API=VLC_OPENGL_ES2'],
-    'module_depends' : vlc_plugins_targets.keys()
+    'module_depends' : vlc_plugins_targets.keys(),
+    'enabled' : opengles2_dep.found(),
 }
-endif
 
 vlc_tests += {
     'name' : 'test_modules_stream_out_transcode',



View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/compare/b39334e89f49cfabae90557432d46b5fbe70d7fc...6717b8689577d688d2f992889e6e7460c877ec7f

-- 
View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/compare/b39334e89f49cfabae90557432d46b5fbe70d7fc...6717b8689577d688d2f992889e6e7460c877ec7f
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance
_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to