aboutsummaryrefslogtreecommitdiffstats
path: root/test/meson.build
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-05-28 16:25:52 -0400
committerDavid Robillard <d@drobilla.net>2021-05-28 17:26:38 -0400
commit55f9506e4fe172cd5376ad9d95a99440a90b3c43 (patch)
tree3da847c441e1020528e49feddd7ea3c77e645fc3 /test/meson.build
parent3342e618b59e8c35f387bb27153fccf141670ef9 (diff)
downloadpugl-55f9506e4fe172cd5376ad9d95a99440a90b3c43.tar.gz
pugl-55f9506e4fe172cd5376ad9d95a99440a90b3c43.tar.bz2
pugl-55f9506e4fe172cd5376ad9d95a99440a90b3c43.zip
Split up warning suppression flags more finely
This avoids polluting the main list of suppressions with things that are only triggered in tests or examples, making it clearer which warning are present in pugl itself.
Diffstat (limited to 'test/meson.build')
-rw-r--r--test/meson.build65
1 files changed, 62 insertions, 3 deletions
diff --git a/test/meson.build b/test/meson.build
index bd838f3..a50b6c7 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -1,3 +1,38 @@
+# Suppress some additional C warnings in tests
+test_c_args = []
+if get_option('strict')
+ if cc.get_id() == 'clang'
+ test_c_args += [
+ '-Wno-float-equal',
+ ]
+ elif cc.get_id() == 'gcc'
+ test_c_args += [
+ '-Wno-float-equal',
+ ]
+ endif
+
+ test_c_args = cc.get_supported_arguments(test_c_args)
+endif
+
+# Suppress some additional C++ warnings in tests
+test_cpp_args = []
+if get_option('strict') and is_variable('cpp')
+ if cpp.get_id() == 'clang'
+ test_cpp_args += [
+ '-Wno-documentation', # Cairo
+ '-Wno-documentation-unknown-command', # Cairo
+ '-Wno-old-style-cast',
+ '-Wno-padded',
+ ]
+ elif cpp.get_id() == 'gcc'
+ test_cpp_args += [
+ '-Wno-padded',
+ ]
+ endif
+
+ test_cpp_args = cpp.get_supported_arguments(test_cpp_args)
+endif
+
basic_tests = [
'local_copy_paste',
'realize',
@@ -35,6 +70,7 @@ includes = [
foreach test : basic_tests
test(test,
executable('test_' + test, 'test_@0@.c'.format(test),
+ c_args: test_c_args,
include_directories: include_directories(includes),
dependencies: [pugl_dep, stub_backend_dep]))
endforeach
@@ -43,6 +79,7 @@ if opengl_dep.found()
foreach test : gl_tests
test(test,
executable('test_' + test, 'test_@0@.c'.format(test),
+ c_args: test_c_args,
include_directories: include_directories(includes),
dependencies: [pugl_dep, gl_backend_dep]))
endforeach
@@ -52,6 +89,7 @@ if cairo_dep.found()
foreach test : cairo_tests
test(test,
executable('test_' + test, 'test_@0@.c'.format(test),
+ c_args: test_c_args,
include_directories: include_directories(includes),
dependencies: [pugl_dep, cairo_backend_dep]))
endforeach
@@ -61,6 +99,8 @@ if vulkan_dep.found()
foreach test : vulkan_tests
test(test,
executable('test_' + test, 'test_@0@.c'.format(test),
+ c_args: test_c_args,
+ cpp_args: test_cpp_args,
include_directories: include_directories(includes),
dependencies: [pugl_dep, vulkan_backend_dep]))
endforeach
@@ -88,14 +128,33 @@ if host_machine.system() == 'darwin'
objcpp = meson.get_compiler('objcpp')
unified_args += objcpp.get_supported_arguments(
- c_warnings + cpp_warnings + objc_warnings)
+ c_warnings + test_cpp_args + objc_warnings)
executable('inline_objcpp', 'test_inline_objcpp.mm',
include_directories: include_directories(includes),
dependencies: unified_deps,
objcpp_args: unified_args)
+
elif is_variable('cpp')
- if cpp.get_id() == 'msvc'
+ unified_args = []
+
+ if cpp.get_id() == 'clang'
+ unified_args += [
+ '-Wno-old-style-cast',
+ '-Wno-reserved-id-macro',
+ '-Wno-switch-default',
+ '-Wno-switch-enum',
+ '-Wno-unused-macros', # Mac
+ ]
+ elif cpp.get_id() == 'gcc'
+ unified_args += [
+ '-Wno-conditionally-supported',
+ '-Wno-old-style-cast',
+ '-Wno-switch-default',
+ '-Wno-switch-enum',
+ '-Wno-useless-cast',
+ ]
+ elif cpp.get_id() == 'msvc'
unified_args += [
'/wd4464' # relative include path contains '..'
]
@@ -104,5 +163,5 @@ elif is_variable('cpp')
executable('inline_cpp', 'test_inline_cpp.cpp',
include_directories: include_directories(includes),
dependencies: unified_deps,
- cpp_args: unified_args)
+ cpp_args: test_cpp_args + unified_args)
endif