mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-16 08:56:45 -05:00
spa: add a test for missing includes
For each header in the spa directory, generate a compilation test that includes just that header. This way we can pick up missing #includes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
6499f96396
commit
d08d989412
2 changed files with 30 additions and 0 deletions
|
|
@ -43,6 +43,31 @@ if have_cpp
|
||||||
install : false)
|
install : false)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Generate a compilation test for each SPA header, excluding the type-info.h
|
||||||
|
# ones which have circular dependencies and take some effort to fix.
|
||||||
|
find = find_program('find', required: false)
|
||||||
|
if find.found()
|
||||||
|
spa_headers = run_command(find_program('find'),
|
||||||
|
meson.source_root() / 'spa' / 'include',
|
||||||
|
'-name', '*.h',
|
||||||
|
'-not', '-name', 'type-info.h',
|
||||||
|
'-type', 'f',
|
||||||
|
'-printf', '%P\n')
|
||||||
|
foreach spa_header : spa_headers.stdout().split('\n')
|
||||||
|
if spa_header.endswith('.h') # skip empty lines
|
||||||
|
c = configuration_data()
|
||||||
|
c.set('INCLUDE', spa_header)
|
||||||
|
src = configure_file(input: 'spa-include-test-template.c',
|
||||||
|
output: 'spa-include-test-@0@.c'.format(spa_header.underscorify()),
|
||||||
|
configuration: c)
|
||||||
|
executable('spa-include-test-@0@'.format(spa_header.underscorify()),
|
||||||
|
src,
|
||||||
|
include_directories: [spa_inc],
|
||||||
|
install: false)
|
||||||
|
endif
|
||||||
|
endforeach
|
||||||
|
endif
|
||||||
|
|
||||||
benchmark_apps = [
|
benchmark_apps = [
|
||||||
'stress-ringbuffer',
|
'stress-ringbuffer',
|
||||||
'benchmark-pod',
|
'benchmark-pod',
|
||||||
|
|
|
||||||
5
spa/tests/spa-include-test-template.c
Normal file
5
spa/tests/spa-include-test-template.c
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
#include <@INCLUDE@>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue