[vlc-commits] [Git][videolan/vlc][master] 2 commits: test: libvlc: overrides VLC_LIB_PATH in test_init()

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Fri Aug 11 09:31:43 UTC 2023



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


Commits:
d7a1749f by Alexandre Janniaux at 2023-08-11T09:18:00+00:00
test: libvlc: overrides VLC_LIB_PATH in test_init()

Otherwise, the local installation can be used also. Printing the path in
module_find led to:

    module->plugin->abspath = /usr/local/lib/vlc/plugins/codec/libjpeg_plugin.dylib

- - - - -
25fa1436 by Alexandre Janniaux at 2023-08-11T09:18:00+00:00
test: dialog: use test_init()

test_init() will already setup VLC_PLUGIN_PATH and VLC_LIB_PATH, while
setting up the alarm() for the test timeout, using VLC_TEST_TIMEOUT
instead of ad-hoc value.

- - - - -


2 changed files:

- test/libvlc/test.h
- test/src/interface/dialog.c


Changes:

=====================================
test/libvlc/test.h
=====================================
@@ -97,6 +97,7 @@ static inline void test_init (void)
     }
 
     setenv( "VLC_PLUGIN_PATH", TOP_BUILDDIR"/modules", 1 );
+    setenv( "VLC_LIB_PATH", TOP_BUILDDIR, 1 );
 }
 
 #endif /* TEST_H */


=====================================
test/src/interface/dialog.c
=====================================
@@ -24,6 +24,7 @@
 #include <vlc/vlc.h>
 
 #include "../../../lib/libvlc_internal.h"
+#include "../../libvlc/test.h"
 
 #include <vlc_common.h>
 #include <vlc_plugin.h>
@@ -282,12 +283,10 @@ int
 main(int i_argc, char *ppsz_argv[])
 {
     bool b_test_all = i_argc > 1 && strcmp(ppsz_argv[1], "-a") == 0;
+    if (b_test_all)
+        setenv("VLC_TEST_TIMEOUT", "0", 1);
 
-    if (!b_test_all)
-        alarm(10);
-
-    setenv("VLC_PLUGIN_PATH", "../modules", 1);
-    setenv("VLC_LIB_PATH", "../modules", 1);
+    test_init();
 
     libvlc_instance_t *p_libvlc = libvlc_new(0, NULL);
     assert(p_libvlc != NULL);



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/03ec653336026ca7667b5bdb93dbe998965ea85d...25fa143634acbfbcebc326eace6c372cd334b0d7

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/03ec653336026ca7667b5bdb93dbe998965ea85d...25fa143634acbfbcebc326eace6c372cd334b0d7
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list