[vlc-commits] [Git][videolan/vlc][master] 2 commits: test: meson: allow setting some environment variables when testing
Steve Lhomme (@robUx4)
gitlab at videolan.org
Tue Feb 25 07:42:46 UTC 2025
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
17e3bbbb by Steve Lhomme at 2025-02-25T07:26:09+00:00
test: meson: allow setting some environment variables when testing
- - - - -
7254c2df by Steve Lhomme at 2025-02-25T07:26:09+00:00
meson: add compat tests
Just as with autotools it may not test the actual compat version of a function,
but the one provided by the toolchain. That allows validating the tests
with the real thing.
- - - - -
2 changed files:
- compat/meson.build
- test/meson.build
Changes:
=====================================
compat/meson.build
=====================================
@@ -11,3 +11,49 @@ if libcompat_sources.length() > 0
install_dir: get_option('libdir') / 'vlc'
)
endif
+
+heap_alloc_env = environment({'ASAN_OPTIONS': 'allocator_may_return_null=1'})
+vlc_tests += {
+ 'name': 'heap',
+ 'sources': files('test/heap.c'),
+ 'suite': ['compat'],
+ 'link_with': [vlc_libcompat],
+ 'env': heap_alloc_env,
+}
+
+vlc_tests += {
+ 'name': 'strnstr',
+ 'sources': files('test/strnstr.c'),
+ 'suite': ['compat'],
+ 'link_with': [vlc_libcompat],
+}
+
+vlc_tests += {
+ 'name': 'ckd_ckd',
+ 'sources': files('test/ckd.c'),
+ 'c_args': ['-DTEST_CKD'],
+ 'suite': ['compat'],
+ 'link_with': [vlc_libcompat],
+}
+
+ckd_builtin_cargs = ['-DTEST_BUILTIN']
+if cdata.has('HAVE_STDCKDINT_H')
+ ckd_builtin_cargs += '-DHAVE_CKD'
+endif
+vlc_tests += {
+ 'name': 'ckd_builtin',
+ 'sources': files('test/ckd.c'),
+ 'c_args': ckd_builtin_cargs,
+ 'suite': ['compat'],
+ 'link_with': [vlc_libcompat],
+}
+
+vlc_tests += {
+ 'name': 'ckd_compat',
+ 'sources': files('test/ckd.c'),
+ 'c_args': ['-DTEST_COMPAT'],
+ 'suite': ['compat'],
+ 'link_with': [vlc_libcompat],
+}
+
+#TODO: add clock_nanosleep test for Darwin
=====================================
test/meson.build
=====================================
@@ -24,6 +24,7 @@ foreach vlc_test: vlc_tests
'cpp_args',
'objc_args',
'include_directories',
+ 'env',
]
foreach key : vlc_test.keys()
@@ -82,6 +83,7 @@ foreach vlc_test: vlc_tests
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]),
+ env: vlc_test.get('env', []),
suite: [vlc_test.get('suite', []), 'test'],
depends: [test_modules_deps])
endforeach
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/cf7b9589d8ce97092ac17cf0ed5112a00f3962a4...7254c2dfc39cbd1b0f18ed71705deec7c3244d7d
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/cf7b9589d8ce97092ac17cf0ed5112a00f3962a4...7254c2dfc39cbd1b0f18ed71705deec7c3244d7d
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