diff options
author | Janne Grunau <janne-vlc@jannau.net> | 2020-08-22 13:19:24 +0300 |
---|---|---|
committer | Janne Grunau <janne-vlc@jannau.net> | 2020-08-23 01:32:43 +0300 |
commit | 1bcc5ecd8a0a06be8eb964213ceae83f5d1e6d92 (patch) | |
tree | feb7859cd21aace6b6b16e1fca74b8b88c33c362 /tests/meson.build | |
parent | 791c4697219b27ab79fb4536725a0a7d58c014d3 (diff) |
tests: test stand alone API header compilation
Errors on C11 features like anonymous strucs/unions.
Diffstat (limited to 'tests/meson.build')
-rw-r--r-- | tests/meson.build | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/meson.build b/tests/meson.build index 51de562..fb88ae1 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -101,6 +101,36 @@ if is_asm_enabled test('checkasm', checkasm, is_parallel: false) endif +c99_extension_flag = cc.first_supported_argument( + '-Werror=c11-extensions', + '-Werror=c99-c11-compat', + '-Wc11-extensions', + '-Wc99-c11-compat', +) + +# dav1d_api_headers +foreach header : dav1d_api_headers + header_file = '@0@'.format(header).split('/')[-1] + target = header_file + '_test' + + header_test_source = custom_target(target, + output : target + '.c', + input : 'header_test.c.in', + capture : true, + command : ['sed', '-e', 's/INPUT/' + header_file + '/', '@INPUT@'] + ) + + header_test_exe = executable(target, + header_test_source, + include_directories: dav1d_inc_dirs, + c_args: [c99_extension_flag], + build_by_default: true + ) + + test(target, header_test_exe) +endforeach + + # fuzzing binaries if meson.version().version_compare('>=0.49') subdir('libfuzzer') |